2 ms·
Right, the article in question is just pointing out how C++ is implementing a specific monad. In this case the values of futures and then the futures library im
by Periodic 13y ago
Right, the article in question is just pointing out how C++ is implementing a specific monad. In this case the values of futures and then the futures library implements all the functions require for them to be a monad. The C++ spec certainly doesn't call them that and don't provide a generalized monad.
I think the main point to take away is that this is a case where a monad is the right abstraction and can be implemented very logically, but since C++ doesn't and cannot really speak about monads directly, there comes a lot of boilerplate and you lose a lot of "free" utility functions you'd get in a language that can talk about arbitrary monads.