Proposal: Add Chris Done's "om" combinator to Control.Monad

Bryan O'Sullivan bos at
Fri Jul 26 19:19:21 CEST 2013

On Thu, Jul 25, 2013 at 9:37 PM, John Wiegley <johnw at> wrote:

> It's just that I tend to write the following a LOT:
>     x <- someMonadicFunction
>     when x $ do

Sure, this is a common pattern. But the name is terrible, and it's not
clear to me that the functionality is a useful generalization. Why not
advocate for whenM instead?

whenM :: Monad m => m Bool -> m () -> m ()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list