
1 Oct
2002
1 Oct
'02
12:02 p.m.
In the GHC users guide Chapter 7.2.12 is the single primitve value realWorld# of the state of the world provided. This value is also used in the implementation of unsafePerformIO (GHC.IOBase), where it is applied as the argument to the IO action, and so on (after performing the action it's discarded).
My question is now: Is the same value (realWorld#) applied while using normal monadic - not unsafe - IO, more precisely is a programm main::IO () executing the expression (main realWorld#)?
In effect, yes. However, the implementation optimises away the actual values of type State#, so that no actual argument passing goes on most of the time. Cheers, Simon
8268
Age (days ago)
8268
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow