[project @ 1998-02-02 17:27:26 by simonm]
[ghc-hetmet.git] / ghc / lib / std / PrelMain.lhs
diff --git a/ghc/lib/std/PrelMain.lhs b/ghc/lib/std/PrelMain.lhs
new file mode 100644 (file)
index 0000000..a64b361
--- /dev/null
@@ -0,0 +1,20 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1997
+%
+
+\section[PrelMain]{Module @PrelMain@}
+
+\begin{code}
+module PrelMain( mainIO ) where
+
+import Prelude
+import {-# SOURCE #-} qualified Main   -- for type of "Main.main"
+import PrelErr ( ioError )
+\end{code}
+
+\begin{code}
+mainIO :: IO ()                -- It must be of type (IO t) because that's what
+                       -- the RTS expects.  GHC doesn't check this, so
+                       -- make sure this type signature stays!
+mainIO = catch Main.main (\err -> ioError (showsPrec 0 err "\n"))
+\end{code}