- Functional Programming in C++, by Ivan Čukić
- My primer for functional programming. A bit dated (targets C++17), but explains a lot of functional concepts in an understandable way
- Category Theory for Programmers, by Bartosz Milewski
- I have only gotten partway into it, but this looks like a gold mine if you want to learn the theory behind functional programming. Also available on video (as a lecture series)
- Using Monads in C++ to Solve Constraints (Part 1 of a 4-part series)
- Explains in detail how to combine two monads to solve a non-trivial puzzle, and highlights the benefits of the solution. Weaves in a lot of theoretical background.
- You probably wrote half a monad by accident
- Short and entertaining, yet educational
- Monads/Writer monad
- Brief explanation of the writer monad, with example implementations in different languages
- How to Use Monadic Operations for
std::optional
in C++23- Blog post explaining the monadic interface of std::optional in C++23. If you'd like to read another explanation about that, this is a good place to start.
- The definite guide to std::expected
- Why use std::expected, and lots of examples on how to use it
- C++23: The stacktrace library
- More about std::stacktrace
- std::print in C++23
- Compact article on std::print, and why you might want to prefer it to printf and iostream.
- Asynchronous APIs in Qt 6
- Explains monadic operations on QtConcurrent
- Functional C++ - Gašper Ažman - C++Now 2024
- Presents a library that brings the usage of monads in C++ to new levels. Type-checked multi-dispatch with compile-time errors. Monads of monads. Goes far beyond my talk, both in depth and speed
- Ben Deane “Easy to Use, Hard to Misuse: Declarative Style in C++”
- Covers a much wider scope: Why should we strive for a more declarative coding style, and how can we achieve it in C++? With interesting excursions into the history of the language. Well researched, though slightly dated (from 2018).
- Monads in Modern C++ - Georgi Koyrushki & Alistair Fisher
- The inspiration for my own talk. Covers similar ground, but explains things a bit differently. Which one is better? Your call!
- Effective Ranges: A Tutorial for Using C++2x Ranges - Jeff Garland
- So far my best primer if you want to use std::ranges
- C++23: An Overview of Almost All New and Updated Features - Marc Gregoire
- Overview over C++23, really goes through the list and explains every feature briefly
- 'Declarative Thinking, Declarative Practice' - Kevlin Henney
- Mostly motivational talk why you should write more declarative code (and also how), not specific for C++. Entertaining.
- Understanding the Filter View to Use it Right
- std::views::filter has lots of traps built-in. This talk helps you understand and avoid them.
- Rappel: Compose Algorithms, Not Iterators - Google's Alternative to Ranges
- Presents a library that utilizes an alternative approach to std::ranges. Since the library is not open-sourced (as of writing), the most important takeaway is the motivation not to use ranges in the first place, and that's quite interesting.
- The One Ranges Proposal (P0896)
- Monadic operations for std::optional (P0798)
- std::expected (P0323)
- Monadic operations for std::expected (P2505)
- A Proposal to add stacktrace library (P0881)
- Formatted output (P2093)
- Text Formatting (P0645)
- Give std::optional Range Support (P3168)
- std::execution: sender-receiver model of execution control (P2300)
You want to use some of the features I presented, but do not have a new enough compiler and/or standard version? There are libraries you can use as replacement.
Disclaimer: I don't have first-hand experience with them. Please evaluate whether they fit your use case, and whether they are still actively maintained before using
- Ranges v3: The library gave the direction for the standardization of ranges, and surpasses C++23 ranges in some functionality
- Sy Brand's expected library: "By far the most popular implementation is Sy Brand’s, with over 500 stars on GitHub and extensive usage." (Quote from P0323R10 - std::expected)
- Boost optional: Optional with a monadic interface (look for "map" instead of "and_then", and it's partially missing in the docs)
- STX: C++17 & C++ 20 error-handling and utility extensions: Contains an 'optional' and 'expected' implementation with monadic operations