Proposal: add ifM and whenM to Control.Monad

Edward Kmett ekmett at gmail.com
Mon Apr 21 17:52:22 UTC 2014


I can write precisely 2 implementations of that function. They probably
don't have the semantics you want, however. ;)

-Edward


On Mon, Apr 21, 2014 at 12:56 PM, David Mazieres <
dm-list-haskell-libraries at scs.stanford.edu> wrote:

> Mario Pastorelli <pastorelli.mario at gmail.com> writes:
>
> > Only the name 'mif' respects the rules with this type. The more generic
> > version of 'ifM' is
> >
> > ifM :: Monad m => m Bool -> a -> a -> a
> >
> > and I don't think there is a name conversion for this kind of function
> > in Control.Monad.
>
> Well, if you could actually implement the above function, convention
> would likely dictate that it be called "unsafeIf".
>
> David
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140421/1fc560ad/attachment.html>


More information about the Libraries mailing list