Functional Patterns and Gems in Scala
summary
Defines a Planet monad and implements its Monad/Functor/Traverse laws in Scala, using Cats/Scalaz concepts, for-comprehensions and flatMap examples; shows a concrete doomsday postponed example where Earth/Mars/Venus preparation functions are lifted to disjunctions (Either) and inverted with Traverse and an Applicative instance. Demonstrates a natural transformation path toward free monads, recommends Ammonite REPL for imports, and provides runnable examples that validate the monad/identity/associativity and traverse laws.
AI-written summary · about
chapters (13)
- 0:00Introduction to FP patterns
- 1:29Declarative programming
- 3:38Beyond syntax and style
- 5:34Functional gems and concepts
- 7:31Sequential computation
- 9:28Signature-based design
- 12:03Monad laws and structure
- 14:19Monad and functor mechanics
- 17:07Composition and algebra
- 21:26Disjunctions and traversal
- 24:35Defining traverse and app
- 26:29Advanced composition laws
- 30:34Closing and recommendations
related talks
46mOptimusPrimeT
52mFunctional Patterns in Domain Modeling
49mMining Functional Patterns
50mFunctional Programming with Effects
42mA pragmatic introduction to Category Theory
55mMonoids, Monoids, Monoids
27mMonad Stacks or: How I Learned to Stop Worrying and Love the Free Monad
31mThe Eff monad, one monad to rule them all
