summaryrefslogtreecommitdiff
path: root/compiler/main/GHC.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/GHC.hs')
-rw-r--r--compiler/main/GHC.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
index 39af5fa984..1a7d4ef71e 100644
--- a/compiler/main/GHC.hs
+++ b/compiler/main/GHC.hs
@@ -99,7 +99,7 @@ module GHC (
-- ** Get/set the current context
parseImportDecl,
setContext, getContext,
- setGHCiMonad,
+ setGHCiMonad, getGHCiMonad,
#endif
-- ** Inspecting the current context
getBindings, getInsts, getPrintUnqual,
@@ -124,7 +124,8 @@ module GHC (
lookupName,
#ifdef GHCI
-- ** Compiling expressions
- InteractiveEval.compileExpr, HValue, dynCompileExpr,
+ HValue, parseExpr, compileParsedExpr,
+ InteractiveEval.compileExpr, dynCompileExpr,
-- ** Other
runTcInteractive, -- Desired by some clients (Trac #8878)
@@ -1457,6 +1458,10 @@ setGHCiMonad name = withSession $ \hsc_env -> do
let ic = (hsc_IC s) { ic_monad = ty }
in s { hsc_IC = ic }
+-- | Get the monad GHCi lifts user statements into.
+getGHCiMonad :: GhcMonad m => m Name
+getGHCiMonad = fmap (ic_monad . hsc_IC) getSession
+
getHistorySpan :: GhcMonad m => History -> m SrcSpan
getHistorySpan h = withSession $ \hsc_env ->
return $ InteractiveEval.getHistorySpan hsc_env h