The Imperatives Must Go!
summary
Claim: functional programming ideas are already inside modern C++. Code examples use C++20 lazy ranges and higher‑order utilities (lift library, compose) to build pipelines instead of mutation, and C++23 monadic extensions plus fmap-style lifting let std::optional be chained without unwrapping. Practical guidance: use std::expected for error info (parsing example), beware view reference semantics, and prefer composition — illustrated by Doug McElroy’s six‑line shell vs Knuth’s ten‑page Pascal and real C++ solutions applying ranges.
AI-written summary · about
chapters (15)
- 0:00Introduction and welcome
- 1:40Defining functional programming
- 4:11Historical context and goals
- 7:01The evolution of functional ideas
- 12:10Thinking in pipelines
- 16:37Learning resources and strategy
- 18:49Higher order functions
- 24:43Working with boxes
- 29:05Implementation of fmap
- 33:48Chaining computations
- 37:07Monadic extensions
- 41:46Parallels with other languages
- 45:02Error handling strategies
- 49:20Ranges and composition
- 54:07Conclusion and Q&A
