IO behaves oddly if used nested

Lennart Augustsson lennart at augustsson.net
Thu Oct 2 14:52:01 EDT 2003


Derek Elkins wrote:

> If I'm not mistaken, the Report restricts main's type to be, at least,
> IO a.  Anyways, it's perfectly sensible to return anything.  The RTS
> simply discards it. The above example as an entire program is an IO
> action that returns an IO action that is discarded by the RTS.
You're right, the report says that the value of the IO is discarded
(nd it can be of any type.  While I don't think this is the best
choice of type for main, it does make the described behaviour perfectly
sensible.

	-- Lennart



More information about the Haskell mailing list