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 )
21 mainPrimIO13 :: PrimIO ()
24 = case (main s) of { (result, s2@(S# _)) ->
26 Right () -> ( (), s2 )
27 Left err -> error ("I/O error: "++shows err "\n")
33 Nota Bene! @mainIO@ is written as an explicit function, rather than
34 by saying: @mainIO = requestToIO main@ so that the code generator
35 recognises @mainIO@ as a {\em function} (hence HNF, hence not
36 updatable), rather than a zero-arity CAF (hence updatable). If it is
37 updated, then we have a mega-space leak, because the entire action
38 (@requestToIO main@) is retained indefinitely.
40 (This doesn't waste work because @mainIO@ is only used once.)