Signature of Control.Monad when and unless

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Fri Aug 24 14:48:28 CEST 2012


On 24 August 2012 22:24, Stephen Tetley <stephen.tetley at gmail.com> wrote:
> Hasn't `void` recently been added to Base so that you can discard the
> result of any monadic action?
>
>> when True (void actionWithAnswer)

I also recall a similar discussion within the past six months on this
topic, though I'm having difficulty finding it either online or in my
emails :/

I believe the consensus of the previous discussion was that having
functions such as your stated when_ and unless_ are dangerous in the
general case due to the discarded results being implicitly ignored
(same as how GHC nowadays throws warnings when statements in a
do-block aren't of type m () ).

>
>
> On 24 August 2012 10:12, Oren Ben-Kiki <haskell-oren at ben-kiki.org> wrote:
> [CUT]
>
>>
>> That is, I agree that results shouldn't be discarded "by default", but it
>> should be easy to get rid of them if they are unneeded.
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries



-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com



More information about the Libraries mailing list