~/talk

Monad Transformers Just Why

Talkat Scala Italy 2016 · on Saturday, 2016-05-14· [scala]
slides:none on file

Claim: monads do not compose generically, but specific compositions are practical. Example: a messy Future[Option[A]] becomes OptionT[Future[Option[A]], A] (or OptionT[Future, A]) and using cats or scalaz removes nested flatMaps and cleans up code. Worked for several two-layer cases, but stacking more than two layers gets clunky and requires constant lifting. Alternatives that scale better include the free monad approach and libraries like F / M; don’t expose transformers at API boundaries.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 4:03Functors and monads basics
  3. 7:15Monads in Scala and for comprehensions
  4. 10:24Problem with nested monads
  5. 13:38Why monads don't compose freely
  6. 16:52Introducing monad transformers
  7. 20:05OptionT and how it works
  8. 22:11Limitations of monad transformers
  9. 24:57Practical example with ResultT
  10. 27:47Stacking more than two monads
  11. 31:03Tips for using monad transformers
  12. 33:11Takeaways and alternatives
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.