aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2008-07-29 19:47:36 +0000
committerDavid Waern <david.waern@gmail.com>2008-07-29 19:47:36 +0000
commitf624c3a9cba921a8a9d415ab635470c9d61e8273 (patch)
treeda2de70fe706b3d6a1097ec1fe3e8f4c5c2a08a6 /src/Haddock
parent8c73879959cfb611cf70d2a9497115b675356200 (diff)
Do not export ATs when not in list of subitems
Diffstat (limited to 'src/Haddock')
-rw-r--r--src/Haddock/Utils.hs9
1 files changed, 8 insertions, 1 deletions
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.