PDF - Dark, presentation theme
Get me to the compiler explorer links
- Book: 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
- Book: Category Theory for Programmers, by Bartosz Milewski
- Video: Category Theory for Programmers, by Bartosz Milewski
- My talk is light on theory, this is the opposite. Where I tried to stay close to conventional programming patterns, while adding some functional paradigms, this beams you to an alien planet. Appears to be very thorough and in general well-explained.
- Video: 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
- Video: 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).
- Video: 'Declarative Thinking, Declarative Practice' - Kevlin Henney
- Mostly motivational talk why you should write more declarative code (and also how), not specific for C++. Entertaining.
- Video: 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!
- Article: Your easy guide to Monads, Applicatives, & Functors
- Functor, Applicative (you haven't heard about that in my talk!) and monad explained, with code examples and nice animations
- Article: 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.
- Article: You probably wrote half a monad by accident
- Short and entertaining, yet educational
- Code sample: Monads/Writer monad
- Brief explanation of the writer monad, with example implementations in different languages
- Video: Applicative: The Forgotten Functional Pattern in C++ - Ben Deane
- 'Applicative' is a functor that can apply functions with more than one argument (the explanation is slightly different in languages built on currying, like Haskell). The video explains what applicative means, first in Haskell then in C++. It shows different implementations and usages of applicative, and how monads and applicative are related (and when to use which). In the end, it sheds some light on the hidden functional roots of C++26's senders and receivers.
- Video: Effective Ranges: A Tutorial for Using C++2x Ranges - Jeff Garland
- So far my best primer if you want to use std::ranges
- Video: Understanding the Filter View to Use it Right - Nikolai M. Josuttis
- std::views::filter has lots of traps built-in. This talk helps you understand and avoid them.
- Video: Implementing Ranges and Views - Roi Barkan
- Covering more advanced topics of ranges and views, for example how you write your own custom view adapter
- Video: 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.
- Paper: The One Ranges Proposal (P0896)
- Article: 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.
- Article: The definite guide to std::expected
- Why use std::expected, and lots of examples on how to use it
- Video: The expected outcome, by Ivan Čukić
- About error handling, and std::expected in particular.
- Paper: Monadic operations for std::optional (P0798)
- Paper: std::expected (P0323)
- Paper: Monadic operations for std::expected (P2505)
- Paper: Give std::optional Range Support (P3168)
- Article: Asynchronous APIs in Qt 6
- Explains monadic operations on QtConcurrent
- Article: Design and evolution of C++ future continuations
- About the many attempts to make continuation available in C++. There seems to be a really good chance that P2300 mentioned in the article makes it into C++26.
- Paper: std::execution: sender-receiver model of execution control (P2300)
- Article: C++23: The stacktrace library
- More about std::stacktrace
- Article: std::print in C++23
- Compact article on std::print, and why you might want to prefer it to printf and iostream.
- Video: 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
- Video: Advanced Usage of the C++23 Stacktrace Library - James Pascoe
- Usage of the C++23 stacktrace library, explained in just over 20 minutes
- Paper: A Proposal to add stacktrace library (P0881)
- Paper: Formatted output (P2093)
- Paper: Text Formatting (P0645)
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