Hacker News new | ask | show | jobs
by bazoom42 268 days ago
Haskell have some syntactic sugar which makes monads nice to use, which is why monads are popular in Haskell.

Explaining monads in JavaScript or C# might show the mechanics but will not show why anyone would actually want to use them, since it just result in overly convoluted code.

1 comments

I strongly disagree. Monads are used all the time in non-FP languages. Parser combinators are one common example. It's just a programming pattern which gives the benefits of global variables without the downsides. They work perfectly fine without dedicated syntax.

I was very confused about what they were until I saw an article similar to the one I linked, and then I realized that I had actually been using monads all along, I just didn't know they were called that. I think a lot of developers are in the same boat.

I dispute that monads are used “all the time” in non-FP languages. Can you provide some examples?