Proposal #1464: add dropPrefix to Data.List

Donald Bruce Stewart dons at
Wed Jun 27 01:04:55 EDT 2007

> Hi,
> I can see how this function can be useful.  However, I am strongly
> opposed to adding the general monadic version---not all monads support
> graceful failure, and for monads that do not support it, the only
> option is to throw a run-time exception, which is at odds with the
> purity of Haskell (which leads to headaches when you try to write
> robust code).  I think that the "Maybe" version is perfectly adequate
> but if we have to have an overloaded version, then we should use
> "MonadPlus".
> -Iavor

And in the dlist library we provide,

    maybeToMonadPlus :: MonadPlus m => Maybe a -> m a
    maybeToMonadPlus = maybe mzero return

For those who want it. (Maybe *that* should be in Data.Maybe).

-- Don

More information about the Libraries mailing list