1 This is the mainPrimIO that must be used for Haskell~1.2.
4 module Main ( mainPrimIO ) where
6 import PreludeMainIO_help -- for type of "Main.main"
7 import PreludeDialogueIO ( requestToPrimIO )
11 mainPrimIO :: PrimIO ()
12 mainPrimIO s = case (requestToPrimIO main s) of
13 ( (), s2@(S# _) ) -> ( (), s2 )
18 Nota Bene! @mainIO@ is written as an explicit function, rather than
19 by saying: @mainIO = requestToIO main@ so that the code generator
20 recognises @mainIO@ as a {\em function} (hence HNF, hence not
21 updatable), rather than a zero-arity CAF (hence updatable). If it is
22 updated, then we have a mega-space leak, because the entire action
23 (@requestToIO main@) is retained indefinitely.
25 (This doesn't waste work because @mainIO@ is only used once.)