#4159: move Monad and MonadFix instances for Either from mtl
john at repetae.net
Wed Jun 30 12:31:56 EDT 2010
On Tue, Jun 29, 2010 at 09:16:03PM +0200, Claus Reinke wrote:
> -1, because the default definition of fail is error, which would
> render the Monad instance useless (unless I'm missing something?).
I don't see this as a problem, the either monad provides a generic monad
with a short-circuit return, there is no particular reason to associate
a short circuit return with failure. There can be many reasons you want
a short circuit return rather than just a concept of 'failure'. The
original mistake was thinking that 'Left' had to be associated with
failure or errors for some reason. Like any other monad without a
sensible definition for 'fail', the default of 'error' is just fine.
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
More information about the Libraries