Building an Intuition for Composition
summary
Shows how to spot and expose concrete composition patterns in C++ so APIs do real work: uses std::accumulate / std::reduce and fold expressions to explain identity elements and how non‑associative minus produces different parallel results (sequential -53 vs parallel -23), builds composable orderings (lexicographic order_by), demonstrates ranges::views::transform for optionals and futures plus join/bind to avoid nested optionals, sketches parser combinators, converts sync code to async with coroutines, and maps static exceptions to an expected/either style.
AI-written summary · about
chapters (7)
- 0:00Introduction and motivation
- 3:00Monoids and accumulation
- 10:04Monoid examples in C++
- 16:38Functors and transformation
- 21:55Monads and composition
- 31:10Advanced monadic patterns
- 40:17Conclusion and Q&A
related talks
01h 33mComposition Intuition II
01h 01mFunction Composition in Programming Languages
54m"std::accumulate: Exploring an Algorithmic Empire"
01h 03mHigher order functions for ordinary C++ developers
01h 31mFunctional Programming in Modern C++: The Imperatives Must Go!
01h 18mSafe and Readable C++ Code: Monadic Operations in C++23
01h 02mThe Power of Composition
49m“Applying functional programming in code design"
