Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Monads are not related to laziness in any meaningful way.

Monads are just a generalization of a commonly recurring pattern.

All imperative languages can be said to have "monads" in the sense of having a "semicolon operator" (in some languages, that's just newline) that is the monadic bind. You're programming in one "ambient monad" whose power is fixed by the language itself.

Haskell has an overridable semicolon, and that gives you a lot of DSL power. Instead of one "ambient monad", you have lots of user-defined monads useful for different purposes.

Besides overridable semicolons, monads are just a plain useful abstraction of data structures.

Monads are incredibly useful in a huge variety of programming tasks (non-determinism, effects, exceptions, parsing, and much more). They make Haskell code utilizing them far more broadly useful than code I've seen in any other language.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: