Hacker News new | ask | show | jobs
by saurik 3799 days ago
What makes monads in Haskell interesting is that someone identified them as a pattern, generalized their usage, and then syntax was added to the language that lets you compose them in a natural manner. Sequential execution itself "is a monad", but in most languages we express that using something as simple as ";" or "\n": Haskell effectively generalized the idea of statements to support anything that is monadic, which is why identifying something as a monad ends up becoming so interesting in Haskell as opposed to many other languages.
1 comments

And Haskell gave up rich control flow (break, continue, early return) by doing so. If you trace through what having those statements means for monads as a first-class concept, you find that the situation becomes very much not that simple.
I've never heard this argument before. Very interesting.