4 ms·
Gods I hate the term monads. I've read the wiki at least 20 times in the past year and it sounds like such bloated rubbish. I love your answer.. And I love h
by john_the_writer 4y ago
Gods I hate the term monads. I've read the wiki at least 20 times in the past year and it sounds like such bloated rubbish.
I love your answer..
And I love how you can use it in every language.
- dmitriid 4y agoFunctional Programming Jargon is great at explaining these concepts. Monad: https://github.com/hemanth/functional-programming-jargon#monad https://github.com/hemanth/functional-programming-jargon#mon... Purists will say it's not entirely correct, but we don't care about purism :)
- leidenfrost 4y agoMy totally informal definition of monads is: "a monad is an island of stateful code in a sea of stateless FP code. On top of that we had some ". Someone correct me if I'm wrong.
- light_hue_1 4y agoIt is indeed wrong. For example, the Maybe monad has no state. It sequences operations that can fail. The Error monad aborts the computation and returns an error. Similarly, Min, Max, Product, Sum, Dual don't have an state.
- bspammer 4y agoYou cannot really understand monads just by reading about them. Or I couldn’t, at least. This is a very good article about the problems with monad tutorials: https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy https://byorgey.wordpress.com/2009/01/12/abstraction-intuiti... > “Of course!” Joe thinks. “It’s all so simple now. The key to understanding monads is that they are Like Burritos. If only I had thought of this before!” The problem, of course, is that if Joe HAD thought of this before, it wouldn’t have helped: the week of struggling through details was a necessary and integral part of forming Joe’s Burrito intuition, not a sad consequence of his failure to hit upon the idea sooner. TL;DR There’s no beautiful explanation that will help you understand, you need to get your hands dirty with code.