Adding an ignore function to Control.Monad

Isaac Dupree ml at
Wed Jun 10 13:13:03 EDT 2009

On the other hand, maybe it's also an argument to change all the 
functions like forkIO from
:: IO () -> IO ThreadID
:: IO a -> IO ThreadID

I mean, surely they don't rely on the value of a () return-type, other 
than to pass on to other places that artificially require the ()-type?

okay, a hypothetical function
twice :: IO () -> IO ()
twice a = a >> a
would really need not to return the second result arbitrarily (as it 
would have to with a mere type-change, to "IO a -> IO a"), so it could be
twice :: IO a -> IO ()
twice a = ignore (a >> a)

Isaac Dupree wrote:
> +1, I also invented that ignore function with that name.

More information about the Libraries mailing list