Live coding session with James Douglas
summary
Builds a toy effect system in Scala that represents an I/O program as a pure-value program: three effects (env lookup, read line, write) are encoded as traits hasEnv, hasReadLn, hasWrite and lifted into a Reader-based effect type with map/flatMap. The program composes reads and writes, runs by supplying an environment implementation (stdin stubbed as "james") and prints the expected output, then shows the same logic on ZIO using ZIO[R,E,A] with provide and the runtime — Reader is simple and workable for demos, ZIO is production-ready.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:10Building an effect system
- 5:15Reader Monad
- 12:25Program Monad
- 15:35Program Run
- 18:35Summary
related talks
58mEffect-Oriented Programming
30mTroll Driven Development: Implementing Functional Effects by Way of Self-Lobotomy
44mEffects, Algebraically yours ..
33mRethinking Effects with Effect Systems
43mSurviving a world overflowing with effects
42mThe making of an IO
26mYo Dawg, Heard You Want To FlatMap Your Direct-Style
25mScale By The Bay 2018 Unconference: Joe Kachmar
