diff options
author | Patrick Dougherty <patrick.doc@ameritech.net> | 2017-07-11 11:53:40 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-07-11 13:41:44 -0400 |
commit | 905dc8bc74bebf5370eb9237cc8756cd9fe871ae (patch) | |
tree | 2d758be7928ef4ca2a1450f73b5301aa94b46628 /ghc | |
parent | 31ceaba3edac536d8a8d97d49bb797d4f5bedac6 (diff) | |
download | haskell-905dc8bc74bebf5370eb9237cc8756cd9fe871ae.tar.gz |
Make ':info Coercible' display an arbitrary string (fixes #12390)
This change enables the addition of an arbitrary string to the output of
GHCi's ':info'. It was made for Coercible in particular but could be
extended if desired.
Updates haddock submodule.
Test Plan: Modified test 'ghci059' to match new output.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: goldfire, rwbarton, thomie
GHC Trac Issues: #12390
Differential Revision: https://phabricator.haskell.org/D3634
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 40bd0e59c3..d58724037f 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -1338,7 +1338,8 @@ infoThing :: GHC.GhcMonad m => Bool -> String -> m SDoc infoThing allInfo str = do names <- GHC.parseName str mb_stuffs <- mapM (GHC.getInfo allInfo) names - let filtered = filterOutChildren (\(t,_f,_ci,_fi) -> t) (catMaybes mb_stuffs) + let filtered = filterOutChildren (\(t,_f,_ci,_fi,_sd) -> t) + (catMaybes mb_stuffs) return $ vcat (intersperse (text "") $ map pprInfo filtered) -- Filter out names whose parent is also there Good @@ -1353,9 +1354,10 @@ filterOutChildren get_thing xs Just p -> getName p `elemNameSet` all_names Nothing -> False -pprInfo :: (TyThing, Fixity, [GHC.ClsInst], [GHC.FamInst]) -> SDoc -pprInfo (thing, fixity, cls_insts, fam_insts) - = pprTyThingInContextLoc thing +pprInfo :: (TyThing, Fixity, [GHC.ClsInst], [GHC.FamInst], SDoc) -> SDoc +pprInfo (thing, fixity, cls_insts, fam_insts, docs) + = docs + $$ pprTyThingInContextLoc thing $$ show_fixity $$ vcat (map GHC.pprInstance cls_insts) $$ vcat (map GHC.pprFamInst fam_insts) @@ -2828,8 +2830,8 @@ showBindings = do mb_stuff <- GHC.getInfo False (getName tt) return $ maybe (text "") pprTT mb_stuff - pprTT :: (TyThing, Fixity, [GHC.ClsInst], [GHC.FamInst]) -> SDoc - pprTT (thing, fixity, _cls_insts, _fam_insts) + pprTT :: (TyThing, Fixity, [GHC.ClsInst], [GHC.FamInst], SDoc) -> SDoc + pprTT (thing, fixity, _cls_insts, _fam_insts, _docs) = pprTyThing showToHeader thing $$ show_fixity where |