~/talk

HOW I UNDERSTOOD MONAD TRANSFORMERS

Talkat Scalar 2020 · on Friday, 2020-05-15· [functional-programming, scala]
slides:none on file

Mixing Future[Option[A]] in for-comprehensions becomes concrete: code shows a custom wrapper that maps and flatMaps the inner Option rather than the outer Future, then generalizes to a parametric OptionT using Functor/FlatMap/Applicative typeclass instances (cats) and implicits. The live coding reveals the need for an ExecutionContext for Future instances, how to lift/pure values, and tradeoffs: extra allocations hurt tight loops and don’t belong in public APIs if hiding cats types.

AI-written summary · about

  1. 0:00Introduction
  2. 1:03Example
  3. 5:58Implicit Switch
  4. 8:27Effect Type
  5. 10:06Internal Wrapper
  6. 14:28Future Wrapper
  7. 27:50Implicit
  8. 28:42Functor
  9. 30:32Flat Map
  10. 32:45Applicative
  11. 35:28Dependency
  12. 37:28OptionT
  13. 39:18Compiler Error
~/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.