summaryrefslogtreecommitdiff
path: root/compiler/main/InteractiveEval.hs
diff options
context:
space:
mode:
authorPatrick Dougherty <patrick.doc@ameritech.net>2017-07-11 11:53:40 -0400
committerBen Gamari <ben@smart-cactus.org>2017-07-11 13:41:44 -0400
commit905dc8bc74bebf5370eb9237cc8756cd9fe871ae (patch)
tree2d758be7928ef4ca2a1450f73b5301aa94b46628 /compiler/main/InteractiveEval.hs
parent31ceaba3edac536d8a8d97d49bb797d4f5bedac6 (diff)
downloadhaskell-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 'compiler/main/InteractiveEval.hs')
-rw-r--r--compiler/main/InteractiveEval.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs
index 8e396cc16a..88d5dbe57d 100644
--- a/compiler/main/InteractiveEval.hs
+++ b/compiler/main/InteractiveEval.hs
@@ -726,20 +726,21 @@ moduleIsInterpreted modl = withSession $ \h ->
-- are in scope (qualified or otherwise). Otherwise we list a whole lot too many!
-- The exact choice of which ones to show, and which to hide, is a judgement call.
-- (see Trac #1581)
-getInfo :: GhcMonad m => Bool -> Name -> m (Maybe (TyThing,Fixity,[ClsInst],[FamInst]))
+getInfo :: GhcMonad m => Bool -> Name
+ -> m (Maybe (TyThing,Fixity,[ClsInst],[FamInst], SDoc))
getInfo allInfo name
= withSession $ \hsc_env ->
do mb_stuff <- liftIO $ hscTcRnGetInfo hsc_env name
case mb_stuff of
Nothing -> return Nothing
- Just (thing, fixity, cls_insts, fam_insts) -> do
+ Just (thing, fixity, cls_insts, fam_insts, docs) -> do
let rdr_env = ic_rn_gbl_env (hsc_IC hsc_env)
-- Filter the instances based on whether the constituent names of their
-- instance heads are all in scope.
let cls_insts' = filter (plausible rdr_env . orphNamesOfClsInst) cls_insts
fam_insts' = filter (plausible rdr_env . orphNamesOfFamInst) fam_insts
- return (Just (thing, fixity, cls_insts', fam_insts'))
+ return (Just (thing, fixity, cls_insts', fam_insts', docs))
where
plausible rdr_env names
-- Dfun involving only names that are in ic_rn_glb_env