#2309: containers: specialize functions that fail in a Monad to Maybe

Dan Doel dan.doel at gmail.com
Sat May 24 21:23:10 EDT 2008

On Saturday 24 May 2008, Twan van Laarhoven wrote:
> To retain most of the convenience I would propose we use MonadPlus instead,
> which is arguably where fail should have been put in the first place (*).
> Twan
> (*) Actually in a superclass MonadZero, but let's work with what we have

This is where I'd cast my vote, as well. MonadPlus is, currently, the proper 
generalization of Maybe's safe failure behavior. We should use it.

I don't see how specializing to Maybe and requiring people to explicitly 
inject into an arbitrary MonadPlus gains anything over restricting to 
MonadPlus in the first place.

-- Dan

More information about the Libraries mailing list