Adding an ignore function to Control.Monad

Bart Massey bart at cs.pdx.edu
Thu Jun 11 01:51:59 EDT 2009


Henning Thielemann <lemming <at> henning-thielemann.de> writes:
> > On the other hand, maybe it's also an argument to change all the
> > functions like forkIO to (:: IO a -> IO ThreadID)
> 
> No, I think it is already bad enough, that (>>) has type (m a -> m b ->
> m b) instead of (m () -> m b -> m b). It is like automatically ignoring
> return values in C. It is too easy to ignore a result that is important.

Exactly what I was going to say.  I think "ignore" is fine as a kludge-around,
and I'm definitely +1 for it.  However, if I want to ignore the result of, say,
getLine, it's easy enough to write (getLine >>= \_ -> ...), which makes it clear
that I meant to do that.




More information about the Libraries mailing list