Adding an ignore function to Control.Monad

Henning Thielemann lemming at henning-thielemann.de
Thu Jun 11 14:02:22 EDT 2009


On Thu, 11 Jun 2009, Sittampalam, Ganesh wrote:

> David Menendez wrote:
>>
>> How is that a problem? The whole *point* of (>>) is that it discards
>> unneeded return values.
>
> I think we should avoid having syntax that implicitly does this. So
>
> do getLine
>   return 3
>
> should be banned, and users should be forced to write something like
>
> do getLine >> ignore
>   return 3

or

do ignore getLine
    return 3


> or
>
> do _ <- getLine
>   return 3


More information about the Libraries mailing list