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

Neil Mitchell ndmitchell at gmail.com
Sat May 24 20:09:21 EDT 2008


+1 in favour too.

> This is Haskell, and as such, program crashable effects should not be
> the default, whenever possible.

Indeed!

> Regarding support for older programs relying on IO effects here,
> deprecated versions with the old type would be a good concession to
> backwards compatibility, or adding a lifter of,
>
>    ... => Maybe a -> m a

fromJustM?

> No information is lost, because in each case there is a single failure
> mode.

Also, they call fail with a String, which pretty much means there is
no information beyond debugging hints present anyway. If you wanted to
indicate failure either added information, Monad.fail, Maybe or Either
String would not be the way to do it,.

Thanks

Neil


More information about the Libraries mailing list