From b6ef14069677c79f85cfdce7b5d69b06ca35f8b5 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Fri, 15 Mar 2013 14:16:10 +0000 Subject: 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 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Haddock/Interface') diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index f4107c63..62d08021 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 -- cgit v1.2.3