[commit: haddock] master: Adapt to tcRnGetInfo returning family instances too (b6ef140)

Simon Peyton Jones simonpj at microsoft.com
Fri Mar 15 16:56:46 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b6ef14069677c79f85cfdce7b5d69b06ca35f8b5

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

commit b6ef14069677c79f85cfdce7b5d69b06ca35f8b5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Mar 15 14:16:10 2013 +0000

    Adapt to tcRnGetInfo returning family instances too
    
    This API change was part of the fix to Trac #4175.  But it offers new
    information to Haddock: the type-family instances, as well as the
    class instances, of this type.
    
    This patch just drops the new information on the floor, but there's an
    open opportunity to use it in the information that Haddock displays.

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

 src/Haddock/Interface/AttachInstances.hs |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs
index f4107c6..62d0802 100644
--- a/src/Haddock/Interface/AttachInstances.hs
+++ b/src/Haddock/Interface/AttachInstances.hs
@@ -64,14 +64,14 @@ attachToExportItem expInfo iface ifaceMap instIfaceMap export =
             export {
               expItemInstances =
                 case mb_info of
-                  Just (_, _, instances) ->
+                  Just (_, _, cls_instances, _fam_instances) ->
 {-
                     let insts = map (first synifyInstHead) $ sortImage (first instHead)
                                 [ (instanceSig i, getName i) | i <- instances ]
 -}
                     let insts = map (first synifyInstHead) $ sortImage (first instHead) $
                                 filter (\((_,_,cls,tys),_) -> not $ isInstanceHidden expInfo cls tys)
-                                [ (instanceHead' i, getName i) | i <- instances ]
+                                [ (instanceHead' i, getName i) | i <- cls_instances ]
                     in [ (inst, lookupInstDoc name iface ifaceMap instIfaceMap)
                        | (inst, name) <- insts ]
                   Nothing -> []
@@ -116,7 +116,7 @@ dropSilentArgs dfun theta = drop (dfunNSilent dfun) theta
 
 -- | Like GHC's getInfo but doesn't cut things out depending on the
 -- interative context, which we don't set sufficiently anyway.
-getAllInfo :: GhcMonad m => Name -> m (Maybe (TyThing,Fixity,[ClsInst]))
+getAllInfo :: GhcMonad m => Name -> m (Maybe (TyThing,Fixity,[ClsInst],[FamInst Branched]))
 getAllInfo name = withSession $ \hsc_env -> do 
    (_msgs, r) <- liftIO $ tcRnGetInfo hsc_env name
    return r





More information about the ghc-commits mailing list