aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2008-11-06 21:47:12 +0000
committerDavid Waern <david.waern@gmail.com>2008-11-06 21:47:12 +0000
commite4f1594c6369557e70844e7f6421e6f4180f2f62 (patch)
tree73ae48a816def88e0c24213a28f58251824b5d7b /src/Haddock
parent2e6c7a024e53f34ffa619e54049e08c21e7beec1 (diff)
Fix warnings in Haddock.ModuleTree
Diffstat (limited to 'src/Haddock')
-rw-r--r--src/Haddock/ModuleTree.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Haddock/ModuleTree.hs b/src/Haddock/ModuleTree.hs
index eccfd3e5..ef82dddb 100644
--- a/src/Haddock/ModuleTree.hs
+++ b/src/Haddock/ModuleTree.hs
@@ -6,7 +6,6 @@
module Haddock.ModuleTree ( ModuleTree(..), mkModuleTree ) where
-import Haddock.DocName
import GHC ( HsDoc, Name )
import Module ( Module, moduleNameString, moduleName, modulePackageId )
#if __GLASGOW_HASKELL__ >= 609
@@ -19,14 +18,14 @@ data ModuleTree = Node String Bool (Maybe String) (Maybe (HsDoc Name)) [ModuleTr
mkModuleTree :: Bool -> [(Module, Maybe (HsDoc Name))] -> [ModuleTree]
mkModuleTree showPkgs mods =
- foldr fn [] [ (splitModule mod, modPkg mod, short) | (mod, short) <- mods ]
+ foldr fn [] [ (splitModule mdl, modPkg mdl, short) | (mdl, short) <- mods ]
where
- modPkg mod | showPkgs = Just (packageIdString (modulePackageId mod))
- | otherwise = Nothing
- fn (mod,pkg,short) trees = addToTrees mod pkg short trees
+ modPkg mod_ | showPkgs = Just (packageIdString (modulePackageId mod_))
+ | otherwise = Nothing
+ fn (mod_,pkg,short) trees = addToTrees mod_ pkg short trees
addToTrees :: [String] -> Maybe String -> Maybe (HsDoc Name) -> [ModuleTree] -> [ModuleTree]
-addToTrees [] pkg short ts = ts
+addToTrees [] _ _ ts = ts
addToTrees ss pkg short [] = mkSubTree ss pkg short
addToTrees (s1:ss) pkg short (t@(Node s2 leaf node_pkg node_short subs) : ts)
| s1 > s2 = t : addToTrees (s1:ss) pkg short ts
@@ -37,12 +36,12 @@ addToTrees (s1:ss) pkg short (t@(Node s2 leaf node_pkg node_short subs) : ts)
this_short = if null ss then short else node_short
mkSubTree :: [String] -> Maybe String -> Maybe (HsDoc Name) -> [ModuleTree]
-mkSubTree [] pkg short = []
+mkSubTree [] _ _ = []
mkSubTree [s] pkg short = [Node s True pkg short []]
mkSubTree (s:ss) pkg short = [Node s (null ss) Nothing Nothing (mkSubTree ss pkg short)]
splitModule :: Module -> [String]
-splitModule mod = split (moduleNameString (moduleName mod))
+splitModule mdl = split (moduleNameString (moduleName mdl))
where split mod0 = case break (== '.') mod0 of
(s1, '.':s2) -> s1 : split s2
(s1, _) -> [s1]