summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-01-19 13:11:58 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-01-21 10:07:12 +0000
commite604e916a9727a22a392062096ea947df5fbe2c6 (patch)
treef9af571f20c656e543783291f83b942f04312da0 /compiler/main
parent2e65aae757e789d70249086b76b97ab975747525 (diff)
downloadhaskell-e604e916a9727a22a392062096ea947df5fbe2c6.tar.gz
Comments only
Re Trac #11051
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/InteractiveEval.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs
index b7ed44fa7e..b7c2178fc3 100644
--- a/compiler/main/InteractiveEval.hs
+++ b/compiler/main/InteractiveEval.hs
@@ -248,8 +248,18 @@ runDeclsWithLocation source linenumber expr =
hsc_env' <- liftIO $ rttiEnvironment hsc_env
modifySession (\_ -> hsc_env')
return $ filter (not . isDerivedOccName . nameOccName)
+ -- For this filter, see Note [What to show to users]
$ map getName tyThings
+{- Note [What to show to users]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+We don't want to display internally-generated bindings to users.
+Things like the coercion axiom for newtypes. These bindings all get
+OccNames that users can't write, to avoid the possiblity of name
+clashes (in linker symbols). That gives a convenient way to suppress
+them. The relevant predicate is OccName.isDerivedOccName.
+See Trac #11051 for more background and examples.
+-}
withVirtualCWD :: GhcMonad m => m a -> m a
withVirtualCWD m = do