#2309: containers: specialize functions that fail in a Monad
to Maybe
Ross Paterson
ross at soi.city.ac.uk
Sat May 24 20:30:35 EDT 2008
On Sat, May 24, 2008 at 05:04:25PM -0700, Don Stewart wrote:
> This is Haskell, and as such, program crashable effects should not be
> the default, whenever possible.
Note that there are still functions that can crash, like
findMin :: Map k a -> (k, a)
Perhaps they could be deprecated in a separate proposal. But at least
one can easily check that a program does not use these, or at least find
the places that need checking (by looking for findMin by name).
The functions that return in a monad are worse, because you're supposed
to use them if you want safe behaviour, but you can't tell whether a
particular use is safe without figuring out which monad it's in.
More information about the Libraries
mailing list