4 ms·
Further evidence for my hypothesis that everyone who has ever understood monads has gone on to write a blog post trying to explain them.
by kinofcain 12y ago
Further evidence for my hypothesis that everyone who has ever understood monads has gone on to write a blog post trying to explain them.
- bad_user 12y agoThis is because monads are quite simple and effective abstractions, yet they've proven hard to explain effectively, because contrary to other well known abstractions (let's take as an example the Iterator), monads are more abstract and have been used to describe things that don't bear a resemblance to each other in the minds of beginners. Lets take the Iterator - which is simple to explain (an API that allows you to iterate over a collection of items only once, a collection of items which may be infinite), but that has on the other hand strong limitations in what you can implement under it (e.g. the API calls are synchronous and you can only get the items one by one, sequentially). An Iterator can be a Monad if you provide a flatMap / bind implementation with the right behavior and lo and behold, this operation doesn't care about how the items are produced (synchronously or asynchronously or in what order). In OOP terms, you could have Iterator be a subtype of Monad, with the Monad being the more generic interface. So it's hard to explain because it is very generic, can be applied to many things and everybody has an aha! moment once they spot the resemblance in the various monad implementations, hence the urge to write a blog post.
- chocolateboy 12y ago... and failed: > Once you understand what monads are, and why they exist, you lose the ability to explain them to anybody. -- Douglas Crockford [1] [1] http://www.youtube.com/watch?v=dkZFtimgAcM http://www.youtube.com/watch?v=dkZFtimgAcM
- marcosdumay 12y agoHow can one lose it? Before understanding it, one also has no ability to explain.