Functional C++ For Fun And Profit
summary
Argues that C++ can adopt practical functional ideas: use C++11 lambdas and immediately-invoked lambda tricks to make expression-oriented code, prefer immutability with a companion immutable string with builder (move semantics + refcounts) for speed, and implement persistent data structures (shared nodes, atomic root swap) to simplify concurrency. Reports real-world use in financial code with benchmarks showing better string performance and roughly 10% overhead on persistent RB-tree ops, and much shallower ~3–5 hops using a hash-array mapped trie.
AI-written summary · about
chapters (8)
- 0:00Introduction and motivation
- 5:16Expression-oriented programming
- 15:18Replacing loops with algorithms
- 16:39Immutable data with Builder pattern
- 27:43Immutable strings and builders
- 36:52Persistent data structures
- 51:13Optional and monads
- 1:01:55Summary and Q&A
related talks
01h 02mFunctional C++
01h 01mFunctional C++
49m“Applying functional programming in code design"
01h 47mFunctional C++
52mC++: Functional programming, also in C++
01h 31mFunctional Programming in Modern C++: The Imperatives Must Go!
49mThe Evolution of Functional Programming in C++
01h 01mfunctional: What's New, And Proper Usage
