3 ms·
that's very neat, and basically what i understood by "monad" (although i wouldn't have been able to express it so well). however, as the burrito explanation ma
by andrewcooke 17y ago
that's very neat, and basically what i understood by "monad" (although i wouldn't have been able to express it so well).
however, as the burrito explanation makes clear (and the apple thread confuses spectacularly) there's also some extra bits related to whether related boxes are identical or not. and it's kind-of obvious that these are important, because if you can't look into the box directly then you need to have some idea of what makes some boxes different while others remain equal.
- barrkel 17y agoFor sure, and there are other details - for one, the function you pass in maps the value from a -> M b, rather than a -> b. But I think the aha! moment is the one you need to get to as quickly as possible where monads are concerned, and then worry about the details later. I, for one, was mightily confused by the Haskell do notation - I couldn't figure out why certain sequences worked, and other orders of operations didn't, and I had no intuition of what way types were flowing - it was the essence of a cargo-cult example. And without some sufficiently abstract description of the thing, it's easy to fail to generalize from the seemingly unrelated concepts as a Maybe type and I/O.