Proposal: add new function "check" to Control.Monad
gale at sefer.org
Mon Aug 24 04:03:09 EDT 2009
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.
More information about the Libraries