The Imperatives Must Go!
summary
Claims that functional ideas from Haskell are already embedded in modern C++, demonstrates concrete code patterns: lifting/fmap over std::optional and std::vector, composing projections for sort/find, a quick Haskell quicksort for contrast. Uses C++17/20 features, references Bjorn’s lift library and TartanLlama optional implementations, highlights monadic extensions (std::optional/std::expected) and ranges are lazy but views have reference semantics. Warns about accidental copies and performance pitfalls; slides and survey links provided.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 2:31Functional programming overview
- 7:57Imperative vs functional
- 11:09History of functional
- 15:46Functional in mainstream
- 17:53QuickSort styles
- 20:02Unix pipeline solution
- 22:51Learning functional patterns
- 24:16Higher-order functions
- 29:40Type constructors in C++
- 34:00Lifting with optional
- 38:57Lifting functions with vectors
- 43:57Transformation pipelines with fmap
- 46:49Monadic C++23 error handling
- 49:20Declarative style in C++
- 51:30Value design in legacy
- 53:16Ranges and functional
- 55:28String splitting with ranges
- 57:59Closing remarks
- 58:42Q&A: Debugging
- 1:00:25Q&A: Performance
related talks
01h 00mDesign Idioms from an Alternate Universe
01h 00mBack to Basics: (Range) Algorithms in C++
59mBuilding an Intuition for Composition
49mApplied Modern C++: beyond type erasure and visitor pattern
01h 01mComposable C++: Principles and Patterns
01h 02m“Modern C++ Design (part 1 of 2)”
57mDesign Patterns - The Most Common Misconceptions (2 of N)
01h 03mBreaking Dependencies: The SOLID Principles
