aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockHH.hs
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-07-24 09:42:18 +0000
committersimonmar <unknown>2002-07-24 09:42:18 +0000
commit4d8d5e948cd6620ed923bf7b11ce408a728e3521 (patch)
tree07cdc2e4dde15cb1e3a212d7f22998198829e6b6 /src/HaddockHH.hs
parent1d44cadf21cdf3d5437e6cd438723d9ce7c895e2 (diff)
[haddock @ 2002-07-24 09:42:17 by simonmar]
Patches to quieten ghc -Wall, from those nice folks at Galois.
Diffstat (limited to 'src/HaddockHH.hs')
-rw-r--r--src/HaddockHH.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/HaddockHH.hs b/src/HaddockHH.hs
index 5feac3e4..d1c0f486 100644
--- a/src/HaddockHH.hs
+++ b/src/HaddockHH.hs
@@ -7,6 +7,7 @@ import HaddockModuleTree
import HaddockUtil
import HaddockTypes
+contentsHHFile, indexHHFile :: String
contentsHHFile = "index.hhc"
indexHHFile = "index.hhk"
@@ -36,6 +37,7 @@ ppHHContents odir mods = do
fn :: [String] -> [ModuleTree] -> Doc
fn ss [x] = ppNode ss x
fn ss (x:xs) = ppNode ss x $$ fn ss xs
+ fn _ [] = error "HaddockHH.ppHHContents.fn: no module trees given"
ppNode :: [String] -> ModuleTree -> Doc
ppNode ss (Node s leaf []) =
@@ -50,11 +52,11 @@ ppHHContents odir mods = do
text "<LI>" <> nest 4
(text "<OBJECT type=\"text/sitemap\">" $$
text "<PARAM name=\"Name\" value=\"" <> text s <> text "\">" $$
- (if isleaf then text "<PARAM name=\"Local\" value=\"" <> text (moduleHtmlFile "" mod) <> text "\">" else empty) $$
+ (if isleaf then text "<PARAM name=\"Local\" value=\"" <> text (moduleHtmlFile "" mdl) <> text "\">" else empty) $$
text "</OBJECT>") $+$
text "</LI>"
where
- mod = foldr (++) "" (s' : map ('.':) ss')
+ mdl = foldr (++) "" (s' : map ('.':) ss')
(s':ss') = reverse (s:ss)
-- reconstruct the module name
@@ -80,15 +82,15 @@ ppHHIndex odir ifaces = do
iface_indices = map getIfaceIndex ifaces
full_index = foldr1 plusFM iface_indices
- getIfaceIndex (mod,iface) = listToFM
- [ (name, mod) | (name, Qual mod' _) <- fmToList (iface_env iface), mod == mod']
+ getIfaceIndex (mdl,iface) = listToFM
+ [ (name, mdl) | (name, Qual mdl' _) <- fmToList (iface_env iface), mdl == mdl']
ppList [] = empty
- ppList ((name,Module mod):mods) =
+ ppList ((name,Module mdl):mdls) =
text "<LI>" <> nest 4
(text "<OBJECT type=\"text/sitemap\">" $$
text "<PARAM name=\"Name\" value=\"" <> text (show name) <> text "\">" $$
- text "<PARAM name=\"Local\" value=\"" <> text (moduleHtmlFile "" mod) <> char '#' <> text (show name) <> text "\">" $$
+ text "<PARAM name=\"Local\" value=\"" <> text (moduleHtmlFile "" mdl) <> char '#' <> text (show name) <> text "\">" $$
text "</OBJECT>") $+$
text "</LI>" $$
- ppList mods
+ ppList mdls