UP YOUR MTL GAME WITH CLASSY OPTICS
summary
Claims that replacing monad transformers with MTL plus classy optics removes lifting, keeps polymorphic F, and derives instances (Reader/State/Error) via generated lenses/prisms. Implements applicative ask and MonadError derivation for nested config and a PaymentError ADT, maps business errors to HTTP responses in production since Sept 2018, and materializes programs with a RIO-style newtype or zero/Task. Works in practice but increases cognitive load; recommends using a small subset (ask, MonadError), Ref for state, and module-based interpreters.
AI-written summary · about
chapters (14)
- 0:00Intro
- 0:43What is MTL
- 5:48What is Classy Optics
- 15:25Remo
- 16:46Zero
- 17:22Example
- 19:05Benefits and drawbacks
- 19:56Personal recommendation
- 21:28Avoid this
- 21:52Create modules
- 22:12Time Apps
- 23:31Refactoring
- 24:19Disclaimer
- 24:57Legality
related talks
33mGETTING MORE MILEAGE FROM YOUR MONADS WITH MTL
44mIO monad & Error management: From Exceptions to Cats MTL
38mA roadtrip with monads: from MTL, through tagless, to BIO
24mUsing Monad Transformers without understanding them
01h 07mMonad transformers are good, actually
21mEffectful Lenses: There and Back with Different Monads
19mFinding the Free Way
31mThe Eff monad, one monad to rule them all
