aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-05-13 15:19:03 +0000
committersimonmar <unknown>2002-05-13 15:19:03 +0000
commita90130c4e9199a3f3255a12c1ad24b013df687e0 (patch)
tree2f025819f40742f261ff1ab13ecd4aa5cda6111d
parentdcd5320d201d48e95442351f062afc37c18097c7 (diff)
[haddock @ 2002-05-13 15:19:03 by simonmar]
Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs).
-rw-r--r--src/HaddockHtml.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs
index 5a16b669..2bd6b102 100644
--- a/src/HaddockHtml.hs
+++ b/src/HaddockHtml.hs
@@ -501,7 +501,10 @@ ppHsDataDecl doc_map summary is_newty decl@(HsDataDecl loc ctx nm args cons drv)
= td << vanillaTable << (header </> datadoc </> constrs)
where
header = declBox (ppHsDataHeader False is_newty nm args)
- datadoc = docBox (markup htmlMarkup (fromJust doc))
+
+ datadoc
+ | isJust doc = docBox (markup htmlMarkup (fromJust doc))
+ | otherwise = Html.emptyTable
constr_hdr = tda [ theclass "section4" ] << toHtml "Constructors"
@@ -560,7 +563,11 @@ ppHsFullConstr doc_map (HsRecDecl pos nm tvs ctxt fields maybe_doc) =
)
where hdr = declBox (ppHsConstrHdr tvs ctxt +++ ppHsBinder False nm)
- constr_doc = docBox (markup htmlMarkup (fromJust doc))
+
+ constr_doc
+ | isJust doc = docBox (markup htmlMarkup (fromJust doc))
+ | otherwise = Html.emptyTable
+
fields_html =
td <<
table ! [width "100%", cellpadding 0, cellspacing 8] << (