#1617: Add :browse! and various other additions to GHCi
[ghc-hetmet.git] / compiler / main / GHC.hs
index 8b8ab84..03ad6de 100644 (file)
@@ -74,6 +74,7 @@ module GHC (
        setContext, getContext, 
        getNamesInScope,
        getRdrNamesInScope,
+        getGRE,
        moduleIsInterpreted,
        getInfo,
        exprType,
@@ -2049,6 +2050,12 @@ lookupGlobalName s name = withSession s $ \hsc_env -> do
    return $! lookupType (hsc_dflags hsc_env) 
                        (hsc_HPT hsc_env) (eps_PTE eps) name
 
+#ifdef GHCI
+-- | get the GlobalRdrEnv for a session
+getGRE :: Session -> IO GlobalRdrEnv
+getGRE s = withSession s $ \hsc_env-> return $ ic_rn_gbl_env (hsc_IC hsc_env)
+#endif
+
 -- -----------------------------------------------------------------------------
 -- Misc exported utils