Proposal: add ifM and whenM to Control.Monad

John Wiegley johnw at newartisans.com
Mon Apr 21 22:31:52 UTC 2014


>>>>> Oliver Charles <ollie at ocharles.org.uk> writes:

> I'm +1 on whenM and unlessM - those I have wanted and think are very
> worthwhile. Regardless of the naming convention stuff (which I have never
> even been aware of in my day-to-day coding with Haskell), I think these are
> the right names, and they also match the naming with monad-loops (`whileM`,
> etc).  I'd be -1 on mwhen, munless, etc.

I completely agree with Oliver.  I've wanted "whenM" more times than I can
count, but mwhen doesn't feel right.  +1 for whenM/unlessM, -1 for the other
proposals.

John


More information about the Libraries mailing list