~/talk

Monad transformers down to earth

slides:none on file

Explains why monads don’t compose generically and shows the practical trick of wrapping F[G[A]] to get a usable monad instance, then replaces that boilerplate with Cats’ OptionT and EitherT to compose Future[Option[A]] and Future[Either[Err,A]] at the leaves. Demonstrates helpers like liftT and pulling the raw value with dot.value, warns about extra allocations and brittle, deep stacks, and recommends local transformer use or alternatives (Free monads, Tagless Final / F) rather than app-wide transformer stacks.

AI-written summary · about

  1. 0:00Introduction
  2. 1:19About this talk
  3. 2:19About the question
  4. 2:49The reasonable answer
  5. 3:42Category theory
  6. 4:13Functor
  7. 5:19Future
  8. 6:44WeCats
  9. 7:13Cats
  10. 7:55Lists
  11. 8:51Flatmap
  12. 24:01OptionT
  13. 24:38Generalization
  14. 25:15Metaphors
  15. 25:39GetUser
  16. 27:28Making the types fit
  17. 27:57Helpers
  18. 28:39Recap
  19. 29:21User exists
  20. 29:53Code dates
  21. 30:03Future of none
  22. 30:20Details errors
  23. 30:40Either
  24. 31:26MyErrorCase
  25. 32:45Not a silver bullet
  26. 33:52Personal tips
  27. 34:44Tragic Example
  28. 35:15Keep them for yourself
  29. 35:44Memory footprint
  30. 36:14Local optimization
  31. 37:33Other takeaways
  32. 38:25Free Mona
  33. 39:27F
  34. 41:19Questions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.