[Haskell-cafe] A question about State Monad and Monad in general
max.rabkin at gmail.com
Mon Jul 19 05:17:00 EDT 2010
On Mon, Jul 19, 2010 at 10:17 AM, Ketil Malde <ketil at malde.org> wrote:
> At it's heart, monads are "just" syntactic convenience, but like many
> other syntactic conveniences, allows you to structure your code better.
> Thus it's more about programmer efficiency than program efficiency.
> (The "do notation" is syntactic sugar for >>= and >>).
Well, in a sense yes, but there's more to it than "do" notation --
that's just syntactic sugar. The real power is like any typeclass:
algorithms (in this case sequenceM, forever, liftM, etc.) that work on
all monads without having to write code for each instance.
More information about the Haskell-Cafe