Functional C++
summary
Walks through applying functional patterns to real C++: uses std::optional (Maybe), std::expected (Error), ranges, and a custom validation/Choice monad; builds a sum/pack library that makes overload sets composable so errors and multiple-dispatch are tracked in types. Claims this was used in a Citadel Securities crypto trading stack, yields fewer runtime bugs, stronger compile-time proofs, excellent runtime performance but heavier compile times, and one production hiccup around shared_ptr. Mentions ongoing proposals (p2300, p283) and open source slides/code.
AI-written summary · about
chapters (10)
- 0:00Introduction and motivation
- 3:24The role of context
- 7:36Monads as compositional tools
- 14:26Applying optional monads
- 20:23Refactoring with monads
- 34:52The expected monad
- 44:06Parser implementation
- 52:23Error handling with sums
- 1:06:56Composition with packs
- 1:25:45Advanced composition and Q&A
related talks
01h 02mFunctional C++
01h 04mFunctional C++ For Fun And Profit
01h 31mFunctional Programming in Modern C++: The Imperatives Must Go!
29m“Functional programming: functors and monads"
57mAnd Then() Some(T) Functional Adventures With C++23 std::optional and std::expected
01h 01mFunctional C++
49m“Applying functional programming in code design"
01h 03mHigher order functions for ordinary C++ developers
