[Haskell-beginners] Monad transformers and MonadPlus

Daniel Fischer daniel.is.fischer at web.de
Fri Jul 30 14:01:55 EDT 2010


On Friday 30 July 2010 19:23:00, Brent Yorgey wrote:
>
> If I understand correctly, however, there is some debate over what the
> "correct" laws for MonadPlus ought to be.

Yes, and the haskellwiki page on MonadPlus doesn't even mention the 'right 
zero' property (but the Control.Monad haddocks do).

> One can also imagine other
> useful monads which satisfy other MonadPlus laws but not the one
> above, such as MaybeT (State Int), in which failure short-circuits any
> future modifications to the state, but does not roll back any state
> modifications that may have happened up to the point of failure.
>
> -Brent

Yep, there are several useful variants possible. That is probably why 
there's no final agreement on the laws.



More information about the Beginners mailing list