5 ms·
I found the article the author links to, which explains functors, applicatives, and monads in pictures, to be way more helpful: http://adit.io/posts/2013-04-17-
by bobmichael 7y ago
I found the article the author links to, which explains functors, applicatives, and monads in pictures, to be way more helpful: http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html http://adit.io/posts/2013-04-17-functors,_applicatives,_and_...
- itronitron 7y agoYeah, interesting to learn that a monad is a value in a box, almost as if it were an object
- the_af 7y agoThe problem is, of course, that a monad is not a value in a box. That's a misunderstanding, resulting from an oversimplified metaphor. This shows a frequent problem with metaphors. See "the fallacy of 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...
- chongli 7y agoIt isn’t though. A monad is just an abstract mathematical object that satisfies a few axioms. It doesn’t have anything to do with implementations or computations, let alone objects in the OOP sense. It’s better to think of it like this: a value in a box is one example of a data type that can satisfy the monad axioms. Another example is a delayed computation that produces a value when executed. Yet another is a delayed computation which produces no value at all but causes a message to be printed to the screen.