[Haskell-cafe] Changing type of 'when'

Maurí­cio briqueabraque at yahoo.com
Wed Jan 28 06:27:11 EST 2009


Sugestion: 'when' in Control.Monad is typed
as :: Bool -> IO () -> IO ().

Why not type it as:

:: forall a. => Bool -> IO a -> IO ()

? It is easy for 'when' to ignore the result
of the first computation, and this would not
break existing code, and also save a lot of
 >> return ()s.


More information about the Haskell-Cafe mailing list