aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsven.panne <sven.panne@aedion.de>2006-04-20 12:39:23 +0000
committersven.panne <sven.panne@aedion.de>2006-04-20 12:39:23 +0000
commit34a994d64a3e1efd1fc4342202b55cfa99268de7 (patch)
treef1303afc3cfa9c85f72525316a756fb22235848f /src
parent8610849df8ef8ee39bb6ffd4b797fded23ceae7d (diff)
Avoid pattern guards
Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards.
Diffstat (limited to 'src')
-rw-r--r--src/HaddockHtml.hs21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs
index c8561491..5c6bd892 100644
--- a/src/HaddockHtml.hs
+++ b/src/HaddockHtml.hs
@@ -554,11 +554,10 @@ ifaceToHtml maybe_source_url maybe_wiki_url iface
contents = td << vanillaTable << ppModuleContents exports
description
- | Just doc <- iface_doc iface
- = (tda [theclass "section1"] << toHtml "Description") </>
- docBox (docToHtml doc)
- | otherwise
- = Html.emptyTable
+ = case iface_doc iface of
+ Nothing -> Html.emptyTable
+ Just doc -> (tda [theclass "section1"] << toHtml "Description") </>
+ docBox (docToHtml doc)
-- omit the synopsis if there are no documentation annotations at all
synopsis
@@ -910,9 +909,9 @@ ppHsClassDecl summary links instances orig_c
hdr = ppClassHdr summary ctxt nm tvs fds
- classdoc
- | Just d <- doc = ndocBox (docToHtml d)
- | otherwise = Html.emptyTable
+ classdoc = case doc of
+ Nothing -> Html.emptyTable
+ Just d -> ndocBox (docToHtml d)
methods_bit
| null decls = Html.emptyTable
@@ -1057,9 +1056,9 @@ ppHsQName n@(Qual mdl str)
| otherwise = linkId mdl (Just str) << ppHsName str
isSpecial :: HsName -> Bool
-isSpecial (HsTyClsName id0) | HsSpecial _ <- id0 = True
-isSpecial (HsVarName id0) | HsSpecial _ <- id0 = True
-isSpecial _ = False
+isSpecial (HsTyClsName (HsSpecial _)) = True
+isSpecial (HsVarName (HsSpecial _)) = True
+isSpecial _ = False
ppHsName :: HsName -> Html
ppHsName nm = toHtml (hsNameStr nm)