And Then() Some(T): C++ Combinators - Higher-Order Functions in Cpp
summary
Shows concrete C++ examples that turn string parse/trim/length and safe division into chained continuations so code never unwraps intermediate results and error cases carry context. Uses fmap style lifting for vector and optional pipelines, uses and_then / bind style chaining with optional/expected and demonstrates a parser returning optional<int> and a safe divide returning an error enum. Notes C++23 monadic extensions land unevenly so tl::optional and ntl::expected work as drop‑in replacements and the patterns compile and reduce boilerplate.
AI-written summary · about
chapters (4)
related talks
57mAnd Then() Some(T) Functional Adventures With C++23 std::optional and std::expected
01h 03mHigher order functions for ordinary C++ developers
01h 18mSafe and Readable C++ Code: Monadic Operations in C++23
01h 47mFunctional C++
29m“Functional programming: functors and monads"
58mMonoids, Monads, and Applicative Functors: Repeated Software Patterns
57mBuilding an Intuition for Composition
38mWhat's New In C++23
