Living the Monadstic Life
summary
Demonstrates concrete implementations: an IntSet with contains: (Int) -> Bool that supports ranges, primes, infinite evens and set union/intersection by composing that function; a curried line as a struct holding a function from X to Y; interactive demos that show map vs flatMap explained with envelopes and parties (map lifts functions, flatMap flattens nested containers); and a working state monad RNG producing (value, nextState) used to generate reproducible random sequences. All examples run live with volunteers and illustrate testing and composition.
AI-written summary · about
chapters (11)
- 0:00Welcome and introduction
- 0:45Functional programming overview
- 1:51Implementing IntSet with closures
- 8:24Higher-order functions and lines
- 13:37State and monads introduction
- 14:19Live demo: Shake and hug functions
- 20:52Map vs flatMap explained
- 28:48State monad with random numbers
- 36:48Map as a design pattern
- 39:20Recursion and flatMap
- 40:51Q&A and conclusion
related talks
42mMonads you already use without knowing it
35mThe Functor, Applicative, Monad talk
55mMonoids, Monoids, Monoids
43mFunctional Programming with Effects
36mAn introduction to monadic structures and functional programming
39mDemystifying Monads with Java
34mMo' Problems, Mo 'Nads
33mFunctional Patterns and Gems in Scala
