Safe and Readable C++ Code: Monadic Operations in C++23
summary
Explains how C++20/23 turns nested error-and-loop code into composable pipelines using std::views::transform and std::views::join, and how to replace ad‑hoc error flags with std::optional and std::expected for carryable diagnostics. Demonstrates a working pointer monadic wrapper cptr that unwraps and composes with optionals, shows a continuation pipeline using cute_concurrent plus a writer monad for lock‑free per‑pipeline tracing, and highlights real pitfalls (dangling refs, lazy views) and a checklist for compiler errors.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 4:01Talk goals
- 5:26Functors purpose
- 12:33Functor implementations
- 16:46Ranges views pitfalls
- 22:07Feeding functors
- 22:27Monads practical use
- 35:39Error handling with optional
- 43:02Basic optional operations
- 45:13Classic vs monadic errors
- 54:11Compiler errors fixes
- 57:52Custom monad wrapper
- 1:06:08Combining monads
- 1:14:03Key takeaways and practical advice
related talks
01h 10mSafe and Readable Code - Monadic Operations in C++23
01h 03mMonads in Modern C++
01h 26mMonadic Operations for Box-Like Types - Designing the Extensibility Model
01h 31mFunctional Programming in Modern C++: The Imperatives Must Go!
01h 16mFunctional Composition Beyond Monads
38mWhat's New In C++23
01h 35mC++20 – My Favourite Code Examples
05mPostmodern Meta C++
