From 4d8d5e948cd6620ed923bf7b11ce408a728e3521 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 24 Jul 2002 09:42:18 +0000 Subject: [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. --- src/HaddockHH.hs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/HaddockHH.hs') 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 "
  • " <> nest 4 (text "" $$ text " text s <> text "\">" $$ - (if isleaf then text " text (moduleHtmlFile "" mod) <> text "\">" else empty) $$ + (if isleaf then text " text (moduleHtmlFile "" mdl) <> text "\">" else empty) $$ text "") $+$ text "
  • " 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 "
  • " <> nest 4 (text "" $$ text " text (show name) <> text "\">" $$ - text " text (moduleHtmlFile "" mod) <> char '#' <> text (show name) <> text "\">" $$ + text " text (moduleHtmlFile "" mdl) <> char '#' <> text (show name) <> text "\">" $$ text "") $+$ text "
  • " $$ - ppList mods + ppList mdls -- cgit v1.2.3