[Haskell] Types of when and unless in Control.Monad
lemming at henning-thielemann.de
Sun Apr 22 13:56:29 CEST 2012
On Sun, 22 Apr 2012, Ivan Lazar Miljenovic wrote:
> On 22 April 2012 21:39, Christian Höner zu Siederdissen <choener at tbi.univie.ac.at> wrote:
>> Wouldn't "when_" and "unless_" or similar be better? I'd probably like
>> to have the compiler annoy me, since it is not clear that I want to
>> discard the result. If I really want to discard, I should have to make
>> it clear as there is probably a good reason for the inner function to
>> return a result in the first place?
> Agreed; I'm not sure if I agree with having such functionality
> (Henning makes some good points), but if people deem it desirable then
> I think it would be better to have them with new names for the reasons
> you state.
The underscores would also be consistent with mapM_, forM_ and so on.
But please still count me as -1.
More information about the Libraries