~/talk

Applicative: The Forgotten C++ Functional Pattern

Talkat CppCon 2023 · on Wednesday, 2023-10-04· at 14:00· Adams, 6700 North Gaylord Rockies Boulevard· [rust]
slides:none on file

Shows a concrete implementation: variadic fmap/apply for std::optional and std::expected, a lazy-call wrapper to avoid eager eval, and a Cartesian-product applicative for ranges and tuples that replaces many overloads with one variadic template. Microbenchmarks show the optimizer collapses the wrappers so performance matches handwritten code. Uses parsing examples (quote and hex parsers) and maps p2300 senders/receivers to applicative primitives; the prototypes compile and behave as intended.

AI-written summary · about

  1. 0:00Functional patterns in C++
  2. 1:55Applicative overlooked
  3. 9:12Haskell vs C++ applicative
  4. 17:42Error propagation with applicative
  5. 27:14Implementing std::expected applicative
  6. 36:28Applicative vs monad
  7. 39:25Applicative in C++ ranges
  8. 46:23List comprehensions
  9. 51:03Applicative in parsing
  10. 56:21Applicative with P2300
  11. 59:33Conclusion & Q&A
~/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.