From f624c3a9cba921a8a9d415ab635470c9d61e8273 Mon Sep 17 00:00:00 2001 From: David Waern Date: Tue, 29 Jul 2008 19:47:36 +0000 Subject: Do not export ATs when not in list of subitems --- src/Haddock/Utils.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Haddock/Utils.hs b/src/Haddock/Utils.hs index 8f5b087c..8c9cf5b1 100644 --- a/src/Haddock/Utils.hs +++ b/src/Haddock/Utils.hs @@ -40,6 +40,7 @@ module Haddock.Utils ( ) where import Haddock.Types +import Haddock.GHC.Utils import GHC import SrcLoc @@ -89,7 +90,8 @@ restrictTo names (L loc decl) = L loc $ case decl of [] -> TyClD (d { tcdND = DataType, tcdCons = [] }) [con] -> TyClD (d { tcdCons = [con] }) TyClD d | isClassDecl d -> - TyClD (d { tcdSigs = restrictDecls names (tcdSigs d) }) + TyClD (d { tcdSigs = restrictDecls names (tcdSigs d), + tcdATs = restrictATs names (tcdATs d) }) _ -> decl restrictCons :: [Name] -> [LConDecl Name] -> [LConDecl Name] @@ -117,6 +119,11 @@ restrictDecls names decls = filter keep decls where keep d = fromJust (sigName d) `elem` names -- has to have a name, since it's a class method type signature + +restrictATs :: [Name] -> [LTyClDecl Name] -> [LTyClDecl Name] +restrictATs names ats = [ at | at <- ats , tcdName (unL at) `elem` names ] + + -- ----------------------------------------------------------------------------- -- Filename mangling functions stolen from s main/DriverUtil.lhs. -- cgit v1.2.3