Safe and Readable Code: Monadic Operations in C++23

By Robert Schimkowitsch

Let’s talk about monads. What are they? Why and how would you use them?

The aim of this talk is to introduce some fundamental functional programming techniques (such as monads) and explain how they make your code safer and more readable. Using C++20 and 23 additions, multiple classic condition- and loop-based code examples are transformed into a more functional, declarative form. The resulting code is less complex, has less duplication and a lower likelihood of containing bugs.

The talk is intended for anyone who would like to learn about functional programming techniques and add new tools to their code design toolbox. After it, you will

  • Have an idea what functors and monads are

  • Know multiple ways to pass callables to them

  • Confidently use std::views::transform and std::views::join, std::optional and std::expected

  • Know about some some common pitfalls and how to avoid them

  • Have the tools to write your own monadic wrapper

Being able to read basic C++ code is recommended.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.