#4159: move Monad and MonadFix instances for Either from mtl to
Edward Z. Yang
ezyang at MIT.EDU
Wed Jun 30 06:31:08 EDT 2010
Excerpts from Claus Reinke's message of Wed Jun 30 03:36:00 -0400 2010:
> Every Monad should try to do its best with fail. If, at some point,
> fail in Monad gets replaced with throwError in MonadError, or
> with mzero in MonadZero, or with something else, we can ignore
> fail in Monad, but I would still expect pattern match error via fail
> to integrate well with at least one of MonadPlus or MonadError.
I respectfully disagree. It is far too easy to use fail in a stack of
monad transformers and end up using the wrong instance and getting
error "message" semantics; it is far safer to use the appropriate MonadPlus
function. fail is a disaster, from both an engineering and theoretical standpoint,
and I cannot in good conscious recommend that people use it.
More information about the Libraries