Yo Dawg, Heard You Want To FlatMap Your Direct-Style
summary
Builds a small prototype effect system using Scala 3 context functions and capability-passing style to express nondeterminism and error effects without monads, wiring unsafe implementations (Scala Random, throw) to handlers that produce recipes and run at the program boundary. Demonstrates a test handler that fixes nondeterminism, shows the system works as a prototype, warns handlers must run at boundaries, and then reintroduce for-comprehension syntax by wrapping context functions in an inline class so direct style and monad style are interchangeable.
AI-written summary · about
chapters (7)
- 0:00Functional programming basics
- 2:40Understanding effect systems
- 6:05Scala effect library survey
- 13:05Building a custom system
- 18:00Implementing effect handlers
- 22:14Advanced concurrency options
- 23:01Reintroducing monadic style
related talks
50mFunctional Programming with Effects
43mFunctional Programming with Effects
33mRethinking Effects with Effect Systems
31mThe Eff monad, one monad to rule them all
33mAnalyzing Functional Programs
31mFunction-Passing Style Typed, Distributed Functional Programming
34mPatterns of a pragmatic functional architecture
58mEffect-Oriented Programming
