Proposal: add new function "check" to Control.Monad

Iavor Diatchki iavor.diatchki at gmail.com
Wed Aug 26 12:49:33 EDT 2009


Hello,
I don't really think that we need this function, it is plenty easy to
just write with "guard".  Furthermore, if you choose to add it, then
please do not use "check" for the name.  This is way too generic a
name which I often use for local functions that do some validation.
-Iavor

On Mon, Aug 24, 2009 at 1:03 AM, Yitzchak Gale<gale at sefer.org> wrote:
> Jón Fairbairn wrote:
>> Trac ticket #3453. Two week time frame.
>> Add check function to Control.Monad
>> check :: (MonadPlus m) => (a -> Bool) -> a -> m a
>
> I remember needing this on a number of occasions.
>
>>   mfilter = (join .) . liftM . check
>
> I might write that as:
>
> mFilter = (=<<) . check
>
> That is an intriguing dual to filterM.
>
> Regards,
> Yitz
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>


More information about the Libraries mailing list