summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-05-25 15:31:26 +0000
committersimonpj@microsoft.com <unknown>2010-05-25 15:31:26 +0000
commit84e10e6c110f218991fc9573bcb16aa2e647e02c (patch)
tree00b1b4c47b5c9fea20292698e04d4e7008cb2dff /ghc
parent79324024325fd2e966427faef770ac96c3c60c70 (diff)
downloadhaskell-84e10e6c110f218991fc9573bcb16aa2e647e02c.tar.gz
Refactor pretty printing of TyThings to fix Trac #4015
Diffstat (limited to 'ghc')
-rw-r--r--ghc/InteractiveUI.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index e0498317dd..22bff85338 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -32,7 +32,7 @@ import Packages
-- import PackageConfig
import UniqFM
-import HscTypes ( implicitTyThings, handleFlagWarnings )
+import HscTypes ( handleFlagWarnings )
import qualified RdrName ( getGRE_NameQualifier_maybes ) -- should this come via GHC?
import Outputable hiding (printForUser, printForUserPartWay)
import Module -- for ModuleEnv
@@ -824,9 +824,12 @@ info s = handleSourceError GHC.printExceptionAndWarnings $ do
-- constructor in the same type
filterOutChildren :: (a -> TyThing) -> [a] -> [a]
filterOutChildren get_thing xs
- = [x | x <- xs, not (getName (get_thing x) `elemNameSet` implicits)]
+ = filterOut has_parent xs
where
- implicits = mkNameSet [getName t | x <- xs, t <- implicitTyThings (get_thing x)]
+ all_names = mkNameSet (map (getName . get_thing) xs)
+ has_parent x = case pprTyThingParent_maybe (get_thing x) of
+ Just p -> getName p `elemNameSet` all_names
+ Nothing -> False
pprInfo :: PrintExplicitForalls -> (TyThing, Fixity, [GHC.Instance]) -> SDoc
pprInfo pefas (thing, fixity, insts)