2 ms·
There are clearly a bunch of examples of monads that are even pretty understandable in contexts that aren't Haskel (Maybe and Either, as this blog post points o
by stormbrew 12y ago
There are clearly a bunch of examples of monads that are even pretty understandable in contexts that aren't Haskel (Maybe and Either, as this blog post points out, are succinct examples). It's multiple concepts under the same banner in the same way that 'the visitor pattern' can represent a whole bunch of actual tasks, but the way you perform them is similar enough to justify a name for it.
Really the problem, alluded to in the blog post, is that the worst thing you can possibly do to 'explain' monads is to try to remove them from their context. They aren't fruit, they aren't tupperwear, and a bunch of the incarnations of them aren't useful in imperative programming, so trying to explain them in those contexts is futile.
- logicallee 12y agoIn case you didn't notice, the blog post doesn't bother to explain Maybe or Either. In the terminology of the blog post, this is like asking what a musical instrument technically is, and being told to go learn the piano and violin - from someone else, no help here - and stop bothering the busy blogger.
- stormbrew 12y agoTo be fair, I don't think the blog post is even attempting to explain what a monad is. Its audience is the people who keep making misguided posts that attempt to do so badly. Sure, maybe that's a little unfairly meta if you really want to know, but it is what it is.
- logicallee 12y agoYes, my criticism is that the blog post does not even attempt to explain, or teach, what a monad is. Which would be a primary reason to click on it.
- kqr 12y agoHello, author here. As I hint to in this article, explaining or teaching "what a monad is" is fallacious. Given that each monad requires 400–2000 words to teach in its most basic form, explaining the most common monads in a single article would make that article around 15 pages long. That is way out of scope of this article, but perhaps suitable for five other separate articles. I'll have to think about it! Meanwhile, I'm sure you can Google search for Stack Overflow questions on Maybe, Either, List and other monad types to get used to them. You can imagine it a little like walking up to a musician and asking, "Will you please teach me the musical instruments?" The answer you get will be filled with counter-questions: "Do you know any musical instrument? What kind of instrument are you interested in? Can you read sheet music?" (Or, for that matter, try asking an OOP programmer, "Teach me the Gang of Four patterns, please!" It will elicit a similar response, not a 15-page blog post. ;) )
- logicallee 12y agoGo ahead. Take 15 pages. It's why I - and I presume many others - clicked the article. As a bit of a motivator, I've now upvoted your blog post here. You can post the rest over the course of five or six articles. Add Part 1 to the title of this one. It's a good appetizer! :) So as an intro it's a fine outline. Now get cracking on writing those 15 pages. :) Break it down into 5 parts. I'll upvote every one. Make it suitable for someone coming from a language that doesn't have Monads. After all, it's a feature. If it can be learned - as you imply a way to do - then you can show and teach it, just as you've outlined. (By the way, the difference between what you've just written of 'walking up to a musician' is that a student didn't ask you - you took it upon yourself to show a superior alternative to other people's blog posts on the subject. :)) So get cracking :) Note: originally rather than post a critical comment here, I tried to email you, but didn't find an email address on your site, not even under "about" where you introduce yourself in two paragraphs - including your first name and city. Maybe add an email address there :)
- kybernetikos 12y ago> Make it suitable for someone coming from a language that doesn't have Monads. Most languages either have or support particular examples of Monads, but what is missing from many is the ability to write code that works on all Monads. Writing a Monad tutorial is pretty cliche now, because basically everyone who finally gets what the fuss was all about then blogs their own way of explaining it (guilty of this myself), so I'm not at all surprised that the author of this post didn't want to add yet another to pile.