diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-01-09 17:58:37 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2014-01-09 17:58:48 +0000 |
commit | 15a3de1288fe9d055f3dc92d554cb59b3528fa30 (patch) | |
tree | 65f797c04aa0c8223b03c167d343adc2f16593af /compiler/main/InteractiveEval.hs | |
parent | 73c08ab10e4077e18e459a1325996bff110360c3 (diff) | |
download | haskell-15a3de1288fe9d055f3dc92d554cb59b3528fa30.tar.gz |
Comments only
Diffstat (limited to 'compiler/main/InteractiveEval.hs')
-rw-r--r-- | compiler/main/InteractiveEval.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 35239a2912..622d600cd2 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -800,9 +800,13 @@ fromListBL bound l = BL (length l) bound l [] -- ----------------------------------------------------------------------------- -- | Set the interactive evaluation context. -- --- Setting the context doesn't throw away any bindings; the bindings --- we've built up in the InteractiveContext simply move to the new --- module. They always shadow anything in scope in the current context. +-- (setContext imports) sets the ic_imports field (which in turn +-- determines what is in scope at the prompt) to 'imports', and +-- constucts the ic_rn_glb_env environment to reflect it. +-- +-- We retain in scope all the things defined at the prompt, and kept +-- in ic_tythings. (Indeed, they shadow stuff from ic_imports.) + setContext :: GhcMonad m => [InteractiveImport] -> m () setContext imports = do { hsc_env <- getSession @@ -830,7 +834,7 @@ findGlobalRdrEnv hsc_env imports -- This call also loads any orphan modules ; return $ case partitionEithers (map mkEnv imods) of ([], imods_env) -> Right (foldr plusGlobalRdrEnv idecls_env imods_env) - (err : _, _) -> Left err } + (err : _, _) -> Left err } where idecls :: [LImportDecl RdrName] idecls = [noLoc d | IIDecl d <- imports] |