@@ -63,6 +63,14 @@ import Util.Pretty(pretty, text)
63recinfo :: ElabInfo
63recinfo :: ElabInfo
64recinfo = EInfo [] emptyContext id Nothing elabDecl'
64recinfo = EInfo [] emptyContext id Nothing elabDecl'
66+-- | Return the elaborated term which calls 'main'
67+elabMain :: Idris Term
68+elabMain = do (m, _) <- elabVal recinfo ERHS
69+ (PApp fc (PRef fc (sUN "run__IO"))
70+ [pexp $ PRef fc (sNS (sUN "main") ["Main"])])
72+ where fc = fileFC "toplevel"
66-- | Elaborate primitives
74-- | Elaborate primitives
67elabPrims :: Idris ()
75elabPrims :: Idris ()
68elabPrims = do mapM_ (elabDecl' EAll recinfo)
76elabPrims = do mapM_ (elabDecl' EAll recinfo)