From baa8453620fc1a69cecf6c888410242d6c5cce10 Mon Sep 17 00:00:00 2001
From: Mark Lentczner <markl@glyphic.com>
Date: Tue, 4 May 2010 06:14:34 +0000
Subject: added assoicated types and methods back into class decls

---
 html/xhaddock.css                  |  2 +-
 src/Haddock/Backends/Xhtml/Decl.hs | 25 ++++++++++++++++++++++---
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/html/xhaddock.css b/html/xhaddock.css
index 8f4d71e1..6eb060fb 100644
--- a/html/xhaddock.css
+++ b/html/xhaddock.css
@@ -183,7 +183,7 @@ div.decldoc h5 {
 	margin-left: 10px;
 }
 
-div.decldoc table {
+div.decldoc table, div.subdecl {
 	margin-left: 20px;
 }
 
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
-- 
cgit v1.2.3