Finding the Free Way
summary
Team adoption of Free Monads yields concrete results: algebra-first design, a Play action wrapper so controller methods return Free and get interpreted, synchronous in-memory and mock interpreters for testing, then future-backed production interpreters. Uses cats, kind-projector and Scala 2.11 fixes. Builds reusable interpreters (write to MonadError once), lifting helpers to wrap interpreters into Kleisli/Play request contexts, and a generic retry interpreter that retries any F => M when M is a MonadError. Outcome: much cleaner controller code and faster onboarding.
AI-written summary · about
chapters (12)
- 0:00Intro
- 1:39The Free Monad
- 2:29The Theory
- 3:03The Code
- 5:01Design in Algebra
- 6:06Interpreters
- 8:41Libraries
- 8:57Time Projector
- 9:39Retry Interpreter
- 9:59Apply Interpreter
- 11:43Are we done
- 12:20Make it work
related talks
41mWhy the free Monad isn't free
37mIntro to FP in Scala: Exploring a Toolbox for Solving Problems - Part 6 of 6
50mHierarchical Free Monads & Software Design in Functional Programming
44mCAN WE FREE CONCURRENT PROGRAMMING FROM THE MONADIC STYLE
46mOptimusPrimeT
19mScala for the Rest of Us
31mThe Eff monad, one monad to rule them all
26mUP YOUR MTL GAME WITH CLASSY OPTICS
