Abstract

The introduction of lambdas and first class function objects forever changed the nature of C++, opening up the floodgates to functional programming. Sometimes the best library design is based on a pattern that’s very familiar to a Haskell programmer but alien to a C++ programmer. The new std::future proposal for C++17 hides several functional patterns including that of a monad — the boogeyman of generations of imperative programmers. But once seen in action, the monad becomes just one more pattern in the toolbox of a library designer.