3 ms·
Monads handle much more than state -- they're an elegant alternative to exception handling, IO, and anything sequential. There's no performance penalty involved
by jmillikin 17y ago
Monads handle much more than state -- they're an elegant alternative to exception handling, IO, and anything sequential. There's no performance penalty involved in using a monad, and very little penalty for using lazy evaluation. I've written Haskell code which is on even ground performance-wise with C, and no hoops were involved.
Monads are also not a feature of Haskell -- they can be used in any language which supports closures. I've used them in Python to great effect, though the lack of syntax support is annoying.