[Haskell-cafe] What are the MonadPlus laws?

ajb at spamcop.net ajb at spamcop.net
Wed Jan 26 19:36:16 EST 2005


G'day all.

Quoting Iavor Diatchki <iavor.diatchki at gmail.com>:

> This is not enough, at least in some cases.
> Consider lists, and m being an infinite list, e.g. [1..]
> Then we need that the inifinte concatenation of a empty lists
> gives us the empty list which is not the case.

It also doesn't work for monad transformers (e.g. Ralf Hinze's backtracking
transformer) when stacked over monads like IO.

I say we remove the "law" altogether.  It clearly causes problems, and if
you use the Hughes/Hinze method for deriving the monads, it turns out that
you don't need it anyway.

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list