~/talk

Functional Composition Beyond Monads

Talkat C++Now 2026 · 2026-05-04..05-08· [functional-programming, c-and-cpp]
links:none on file
slides:none on file

Shows how to map functor/applicative/monad patterns onto C++: wraps callables with a small macro to build pipelines, implements fmap for optionals/ranges/senders, implements bind (join/let_value) to avoid double-boxing, and provides a generic sequence via traverse that flips vector<Sender> to Sender<vector> but runs serially when derived from monadic bind. Explains that applicatives permit concurrency while monads force sequencing, that std::map cannot be applicative, and demos lenses for targeted updates and reads via lenses that work as expected.

AI-written summary · about

  1. 0:00Functional composition intro
  2. 0:43Basic function composition
  3. 1:26Composition operators & pipelines
  4. 3:33Problem with boxed values
  5. 4:15Exploring different kinds of boxes
  6. 7:23Functors and fmap
  7. 10:55fmap in pipelines
  8. 11:15Composing boxed functions
  9. 13:00Applicatives for boxes
  10. 16:31Applicative zero & variadic
  11. 17:12Functors vs applicatives
  12. 18:58Alternatives for choosing
  13. 20:00Alternatives implementation
  14. 22:50All functors alternatives?
  15. 24:05Applicatives vs alternatives
  16. 24:49Monads and bind
  17. 27:16Monads in decisions
  18. 29:43Monad is applicative
  19. 31:49Applicatives vs monads concurrency
  20. 33:11Recap functors applicatives alternatives monads
  21. 33:55Q&A senders applicatives
  22. 34:58Contravariant functors
  23. 37:44Contravariant practice
  24. 39:30Contravariant fmap & predicates
  25. 41:36Contravariant applicatives divisible
  26. 44:31Documentation challenges in functional programming
  27. 45:56Contravariant alternatives decidable
  28. 48:46Contravariant monads comonads
  29. 50:32Foldables monoids
  30. 53:49Foldable examples limits
  31. 54:52Foldables vs functors
  32. 55:13Applicatives alternatives monoids
  33. 55:59Validating boxed values
  34. 59:07Sequence traversable boxes
  35. 1:00:54Traverse applications
  36. 1:03:45Q&A optional vectors sequence
  37. 1:04:47Lenses & traversals
  38. 1:07:58Generic function transforms
  39. 1:09:23Lenses vs traversals view
  40. 1:12:30Why composition patterns matter
  41. 1:13:34Summary type class relations
  42. 1:13:55Q&A unwrapping identity traversals
~/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.