aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Html.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2007-11-11 02:56:58 +0000
committerDavid Waern <david.waern@gmail.com>2007-11-11 02:56:58 +0000
commit5d3d5af3f860178fb7c2173a8312432a3f324bc1 (patch)
tree607c51f5c8eb992e39d6d5ce38d5831b3e814859 /src/Haddock/Backends/Html.hs
parent88b0377f346fa62ff05c196d4050c6990520a3cf (diff)
Fix conflicts
Diffstat (limited to 'src/Haddock/Backends/Html.hs')
-rw-r--r--src/Haddock/Backends/Html.hs51
1 files changed, 21 insertions, 30 deletions
diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs
index f28bc3a3..8c73e0ff 100644
--- a/src/Haddock/Backends/Html.hs
+++ b/src/Haddock/Backends/Html.hs
@@ -902,13 +902,15 @@ ppDataDecl summary links instances x loc mbDoc dataDecl
| summary = declWithDoc summary links loc name mbDoc
(ppShortDataDecl summary links loc mbDoc dataDecl)
- | otherwise = dataHeader </>
- tda [theclass "body"] << vanillaTable << (
- datadoc </>
- constrBit </>
- instancesBit
- )
-
+ | otherwise
+ = (if validTable then (</>) else const) dataHeader $
+ tda [theclass "body"] << vanillaTable << (
+ datadoc </>
+ constrBit </>
+ instancesBit
+ )
+
+
where
name = orig (tcdLName dataDecl)
context = unLoc (tcdCtxt dataDecl)
@@ -945,30 +947,19 @@ ppDataDecl summary links instances x loc mbDoc dataDecl
instId = collapseId name
- | otherwise
- = dataheader </>
- tda [theclass "body"] << vanillaTable << (
- datadoc </>
- constr_bit </>
- instances_bit
+ instancesBit
+ | null instances = Html.emptyTable
+ | otherwise
+ = instHdr instId </>
+ tda [theclass "body"] <<
+ collapsed thediv instId (
+ spacedTable1 << (
+ aboves (map (declBox . ppInstHead) instances)
)
- where
- dataheader = topDeclBox links loc nm (ppHsDataHeader False is_newty nm args)
-
- constr_table
- | any isRecDecl cons = spacedTable5
- | otherwise = spacedTable1
-
- datadoc | isJust doc = ndocBox (docToHtml (fromJust doc))
- | otherwise = Html.emptyTable
-
- constr_bit
- | null cons = Html.emptyTable
- | otherwise =
- constr_hdr </>
- (tda [theclass "body"] << constr_table <<
- aboves (map ppSideBySideConstr cons)
- )
+ )
+
+ validTable = isJust mbDoc || not (null cons) || not (null instances)
+
isRecCon lcon = case con_details (unLoc lcon) of
RecCon _ -> True