GETTING MORE MILEAGE FROM YOUR MONADS WITH MTL
summary
Shows how MTL lets one write incomeTax once and run it as Task, Either, Option or lifted transformers like EitherT/OptionT by coding to typeclasses such as MonadError and Applicative; demonstrates State/MonadState to stop threading spaceship state and recruiter logic, and builds small tax and spaceship apps that mostly work. Reveals a concrete Scala problem: MonadError/MonadState trait design causes ambiguous implicits with stacked constraints and gives a practical workaround (copying a slimmer MonadError) that compiles and runs.
AI-written summary · about
chapters (18)
- 0:00Intro
- 1:00What is MTL
- 2:27Storyline
- 4:22Startup
- 5:18Handling errors
- 7:58Which method to use
- 10:24Not an error
- 13:03Option vs Try
- 13:50Error Handling
- 14:30Example
- 15:06Environment Variable
- 17:25Option T
- 18:22Application
- 21:34State
- 22:45Apply method
- 25:28Status report
- 28:12Monad error
- 29:40Compile with error
related talks
26mUP YOUR MTL GAME WITH CLASSY OPTICS
38mA roadtrip with monads: from MTL, through tagless, to BIO
31mThe Eff monad, one monad to rule them all
45mHOW I UNDERSTOOD MONAD TRANSFORMERS
44mCAN WE FREE CONCURRENT PROGRAMMING FROM THE MONADIC STYLE
46mOptimusPrimeT
47mMonad transformers down to earth
18mEasy, intuitive, direct-style syntax for Monad-comprehensions!
