[commit: ghc] master: Comments only (15a3de1)

git at git.haskell.org git at git.haskell.org
Fri Jan 10 08:52:19 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/15a3de1288fe9d055f3dc92d554cb59b3528fa30/ghc

>---------------------------------------------------------------

commit 15a3de1288fe9d055f3dc92d554cb59b3528fa30
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Jan 9 17:58:37 2014 +0000

    Comments only


>---------------------------------------------------------------

15a3de1288fe9d055f3dc92d554cb59b3528fa30
 compiler/main/InteractiveEval.hs |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs
index 35239a2..622d600 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]



More information about the ghc-commits mailing list