Journey to the Heart of the For-Yield
summary
Explains that Scala's for-comprehension is syntactic sugar that desugars to flatMap and map/filter so the same pattern works for List, Option, Try and Future; demonstrates with concrete code: a nested loop turned into map/flatten then flatMap, a postcard-sending example, a dinner-planner that halts on missing ingredients, and Futures that run some lookups in parallel; shows Try wrapping exceptions instead of throwing; points to Iteratees, IO and Reader/Writer/State as additional monads; examples compile and behave as described.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:00Functional Programming in Scala
- 4:25The ForYield
- 8:27Generics
- 10:27List of Lists
- 14:55Lists
- 16:57Options
- 17:16Map
- 23:41Call Blocking
- 24:07Future
- 25:37Postcard
- 26:31Other M words
- 27:54Objections
- 30:28Conclusion
related talks
49mScalaz, or: how I learned to stop worrying and love monads
41mThe Free Monad by Example
39mThe Futures are Calling and I Must Choose
01h 03mFunctional Programming Patterns for Mere Mortals
24mScala Ecosystems: Lightbend vs Typelevel
26mThe Power Of Small Abstractions
41mArchitectures Using Functional Programming Concepts
52mGo Fully Functional and Take Your Legacy Code with You!
