aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Xhtml
diff options
context:
space:
mode:
authorMark Lentczner <markl@glyphic.com>2010-05-04 06:14:34 +0000
committerMark Lentczner <markl@glyphic.com>2010-05-04 06:14:34 +0000
commitbaa8453620fc1a69cecf6c888410242d6c5cce10 (patch)
tree6eb45f1a29d772570da7ecb666cc69dd60761ba6 /src/Haddock/Backends/Xhtml
parent734a15953ecf139274ac1f95d7e36fd5477f7b98 (diff)
added assoicated types and methods back into class decls
Diffstat (limited to 'src/Haddock/Backends/Xhtml')
-rw-r--r--src/Haddock/Backends/Xhtml/Decl.hs25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs
index 210a69f8..a40605b4 100644
--- a/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/src/Haddock/Backends/Xhtml/Decl.hs
@@ -367,9 +367,10 @@ ppClassDecl :: Bool -> LinksInfo -> [DocInstance DocName] -> SrcSpan
-> Maybe (Doc DocName) -> [(DocName, DocForDecl DocName)]
-> TyClDecl DocName -> Bool -> Html
ppClassDecl summary links instances loc mbDoc subdocs
- decl@(ClassDecl lctxt lname ltyvars lfds lsigs _ _ _) unicode
+ decl@(ClassDecl lctxt lname ltyvars lfds lsigs _ ats _) unicode
| summary = ppShortClassDecl summary links decl loc subdocs unicode
- | otherwise = classheader +++ maybeDocToHtml mbDoc +++ instancesBit
+ | otherwise = classheader +++ maybeDocToHtml mbDoc
+ +++ atBit +++ methodBit +++ instancesBit
where
classheader
| null lsigs = topDeclElem links loc nm (hdr unicode)
@@ -378,7 +379,25 @@ ppClassDecl summary links instances loc mbDoc subdocs
nm = unLoc $ tcdLName decl
hdr = ppClassHdr summary lctxt (unLoc lname) ltyvars lfds
-
+
+ atBit
+ | null ats = noHtml
+ | otherwise = atHdr +++ (
+ thediv ! [theclass "subdecl"] <<
+ concatHtml [ ppAssocType summary links doc at unicode
+ | at <- ats
+ , let doc = lookupAnySubdoc (tcdName $ unL at) subdocs ]
+ )
+
+ methodBit
+ | null lsigs = noHtml
+ | otherwise = methHdr +++ (
+ thediv ! [theclass "subdecl"] <<
+ concatHtml [ ppFunSig summary links loc doc n typ unicode
+ | L _ (TypeSig (L _ n) (L _ typ)) <- lsigs
+ , let doc = lookupAnySubdoc n subdocs ]
+ )
+
instId = collapseId (getName nm)
instancesBit
| null instances = noHtml