Functional Programming with Effects
summary
Claim: monads follow directly from category laws and restore function composition for effectful code. Demonstrates six concrete effects — option, either, list, reader, writer, state — implements pure and flatMap as a Scala type class, derives map and tuple, and shows law tests require property testing (Cats). Builds a state-based RNG and composes die rolls deterministically from a seed so it works end to end. Practical result at work: adopting FP increases code quality and maintainability. Tools shown include for-comprehensions and Cats typeclasses.
AI-written summary · about
chapters (17)
- 0:00Intro
- 0:11Goals for Today
- 3:09Functional Programming
- 4:53Referential Transparency
- 7:41World of Expressions
- 8:15Function Composition
- 13:22So what about ...
- 22:19What do they have in common?
- 26:30The Operations
- 28:49The Rules
- 31:35Monad
- 34:09Functor Laws
- 38:26Let's talk about Option Again
- 40:19Let's talk about Either Again
- 41:39Let's talk about List Again
- 42:25Let's talk about Reader Again
- 43:40Let's talk about State Again
related talks
43mFunctional Programming with Effects
43mSurviving a world overflowing with effects
14mFundamentalist Functional Programming
31mThe Eff monad, one monad to rule them all
35mThe Functor, Applicative, Monad talk
01h 06mThe Evolution of Effects
28mA Series of Unfortunate Effects
33mExtensible Effects: A Leaner Cake for Purely Functional Code
