[Yhc] coreFunc has extra argument
shackell at cs.york.ac.uk
Tue Mar 4 11:11:20 EST 2008
Tom Shackell wrote:
> The value of World comes up in only two places that I know of.
Ah I lie, the final use of World is in the Show instance of the IO Monad.
instance (Show a) => Show (IO a) where
showsType (IO fta) = showString "(IO " . showsType ta . showChar ')'
where (_E ta) = fta World
Interestingly this applies World to the IO action, however, since the
only thing that is done with the result is 'showsType' the computation
is never actually evaluated (since you don't need to evaluate it to know
Though why this doesn't just use unsafePerformIO I don't know ...
showsType io = showString "(IO " . showsType a . showChar ')'
a = unsafePerformIO io
This would work just as well. *shrugs* Yhc has quite a lot of historical
carry-overs from nhc98 :)
More information about the Yhc