News for hackers. Stuff that matters.
Re:C++17: I See a Monad in Your Future by bitL on Thursday February 27, 2014 @06:00PM (#7315881)
I find it quite funny. Monads were considered a hack to functional programming to add some imperative features like, you know, IO and similar funky stuff for which there was no math theory. Now seeing them grafted to a language that is considered the golden measure of all imperative languages is kinda LOL.
Re:C++17: I See a Monad in Your Future by eru on Thursday February 27, 2014 @09:03PM (#7316780)
That's somewhat backward. Monads come from Category theory.

A while ago the FP people figured out that their `hacks' to do IO actually conform to the structure of a Monad. So they exploited the fact. Now the author sees that the `hack' to do futures in C++ also conforms to the structure of a Monad, and suggests exploiting that fact.

Re:C++17: I See a Monad in Your Future by bitL on Friday February 28, 2014 @06:07AM (#7318104)
Sure, monads come from category theory. IO and interactivity doesn't.

Yes, though futures were always like that when you look at Java for example. Java always suffered from the need to prepare complex design patterns to do simplest things as it was much less flexible than C++. Now C++ is getting there as well.

I personally would stick with some earlier C++ standard and use Haskell for my functional programming needs. Feels much more natural than trying to bend each language to support every thought process imaginable, and doing a poor job at that.

Re:C++17: I See a Monad in Your Future by Dewie on Friday February 28, 2014 @07:17AM (#7318307)
Imperative languages seem like state monads. But a monad doesn't need to be a state monad. If you want something different than a state monad, it might not be any more simple to implement that in an imperative language than a declarative one.