[Haskell] Types of when and unless in Control.Monad

Peter Simons simons at cryp.to
Wed Jun 6 16:29:27 CEST 2012


Henning Thielemann wrote:

 > The type of 'when' is not arbitrarily restrictive. It makes sure,
 > that no monadic result is ignored by accident.

I completely agree with this point. If 'when' had a more relaxed type
signature, then the combinator would be slightly more convenient to use,
but it would also be more dangerous to use. Personally, I prefer to err
on the side of caution. Besides, it's not my impression that 'when' is
particularly inconvenient to use as it is now, especially since the
introduction of 'void'.

Just my 2 cents.

Peter




More information about the Libraries mailing list