News for hackers. Stuff that matters.
Re:A Gentle Intro to Monads … Maybe? by flebron on Friday January 17, 2014 @12:10PM (#7076922)
Because passing around tuples and pattern matching against them becomes tiring. So you wrap that code repetition pattern around in a State. The State monad is implemented in terms of the language itself, it's not adding anything to the language in terms of computability or expressiveness. It's simply making you type less, for something you could already write in the language itself.

All of these things - Functors, Applicative, Monads, Lenses - are all design patterns in functional programming. In the same way you can use an Observer pattern in OOP, you can use a Monad pattern in functional programming. Neither adds neither computational nor expressive power to the language, but it does avoid code repetition.

Re:A Gentle Intro to Monads … Maybe? by Mithaldu on Friday January 17, 2014 @12:17PM (#7076979)
Thank you, that makes sense to me, and i hope i understood it right. Could you please check https://news.ycombinator.com/item?id=7076961 to see if my understanding is right?
Re:A Gentle Intro to Monads … Maybe? by tel on Friday January 17, 2014 @12:17PM (#7076977)
But that doesn't answer as to why you'd want to use tuples and pattern matching if your language has first class mutability.