[Haskell-cafe] IO (Either a Error) question
Gregory Crosswhite
gcross at phys.washington.edu
Fri May 7 20:02:53 EDT 2010
On May 7, 2010, at 4:54 PM, Limestraël wrote:
> > Personally I think fail is a terrible wart, and should be shunned.
>
> So do I.
> I can't understand its purpose since monads which can fail can be implemented through MonadPlus.
As far as I can tell, its purpose is to essentially allow you to catch pattern match errors in pure code and turn them into a value, since Haskell calls fail whenever there is a failed pattern match. (I am not saying that this is a good idea, only that this is not something that you would simply get by using MonadPlus.)
Cheers,
Greg
More information about the Haskell-Cafe
mailing list