Author: Vipul Kumar

Cats Effect : Pure Functional way to code in Scala

Reading Time: 2 minutes Follow 5 Simple Rules with Cats Program written using Cats Effect provides incredibly strong guarantees and powerful functionality, performance, safety, and composability, provided you follow each of the following rules: Wrap all side-effects in delay, async, blocking, or interruptible (pro tip: try to keep the size of your delay blocks small; two delays with a flatMap is much better than one big delay) Use bracket or Resource for anything which must be closed Never hard-block a thread outside of blocking or interruptible Use IOApp instead of writing your own def main Continue Reading