Proposal: add ifM and whenM to Control.Monad

Henning Thielemann schlepptop at henning-thielemann.de
Sun Apr 27 07:35:40 UTC 2014


Am 21.04.2014 17:53, schrieb Alexander Berntsen:

> On 21/04/14 17:47, Edward Kmett wrote:
>> I, for one, could get behind just taking ifM, whenM, unlessM for
>> these operations, proper naming conventions aside.
>>
>> They've been independently reinvented in 60+ packages with these
>> exact names.
>>
>> If we do this, over time we'll save another 60+ packages the
>> trouble of doing the same thing.

> This looks pragmatic now, but I, for one, think that in the future we
> would be appreciative of our decision to stick to conventions instead
> of giving in to the slippery slope of myopic pragmatism.

I started to add monadic functions without M suffix or prefix to 
Control.Monad.HT module in my utility-ht package. This way I can write 
Monad.lift2, which is both readable and canonical. I don't see a reason 
why sometimes a prefix 'm' means Monoid and sometimes Monad. utility-ht 
is also very basic such that it can run on old GHC's and thus my 
packages do not need to depend in GHC-7.10 only because I like to use ifM.



More information about the Libraries mailing list