1 This is the mainPrimIO13 that must be used for Haskell~1.3.
4 module Main ( mainPrimIO13 ) where
6 import PreludeMain13_help -- for type of "Main.main"
7 import Builtin ( error )
17 import Prel ( (.), not )
18 import PS ( _PackedString, _unpackPS )
23 mainPrimIO13 :: PrimIO ()
26 = case (main s) of { (result, s2@(S# _)) ->
28 Right () -> ( (), s2 )
29 Left err -> error ("I/O error: "++showsPrec 0 err "\n")
35 Nota Bene! @mainIO@ is written as an explicit function, rather than
36 by saying: @mainIO = requestToIO main@ so that the code generator
37 recognises @mainIO@ as a {\em function} (hence HNF, hence not
38 updatable), rather than a zero-arity CAF (hence updatable). If it is
39 updated, then we have a mega-space leak, because the entire action
40 (@requestToIO main@) is retained indefinitely.
42 (This doesn't waste work because @mainIO@ is only used once.)