3 ms·
For 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 o
by barrkel 17y ago
For 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.