3 ms·
It is overly specific, but it's probably the easiest to understand explanation for someone who is familiar with imperative programming. Concurrency, continuati
by viscanti 15y ago
It is overly specific, but it's probably the easiest to understand explanation for someone who is familiar with imperative programming. Concurrency, continuations and exception monads are all likely more difficult to grasp.
A more accurate explanation would say that monads are just an abstraction that encapsulates program logic. Someone unfamiliar with the concept might not see WHY that's important. So my example was tangible, but not all inclusive.
One of the big issues with abstract concepts like monads, is that most people insist on using a long-winded complex explanation up front. I find it's better to pique interest, and make the concepts accessible, with the hope that the reader later is willing to dig in and learn more themselves. I probably could have done a better job of explaining that the IO monad isn't the only monad, but I think it did a "good enough" job of explaining a way to think about them.
- Rusky 15y agoThis is a good point of view to come from. I just think it's important to emphasize two things, to avoid the monad-insanity that people often get- 1) IO is not the only monad, and 2) monads are not the only, or even best, of this kind of abstraction. Learning about monads without (applicative) functors makes everything look like an over-complicated nail.