diff options
author | simonmar <unknown> | 2002-04-10 14:59:51 +0000 |
---|---|---|
committer | simonmar <unknown> | 2002-04-10 14:59:51 +0000 |
commit | cfbaf9f7c17481e3df32e1c1c25e8eb5c06591a6 (patch) | |
tree | fd9ddd36f6a2e13c0f9cf1be0ed2703c1a6f0d11 | |
parent | f3778be679c7a071a6b00f2878f5d093e0353bd3 (diff) |
[haddock @ 2002-04-10 14:59:51 by simonmar]
Sort the module tree
-rw-r--r-- | src/HaddockHtml.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs index 277e45c4..2ba34af0 100644 --- a/src/HaddockHtml.hs +++ b/src/HaddockHtml.hs @@ -160,8 +160,9 @@ addToTrees :: [String] -> [ModuleTree] -> [ModuleTree] addToTrees [] ts = ts addToTrees ss [] = mkSubTree ss addToTrees (s1:ss) (t@(Node s2 leaf subs) : ts) + | s1 > s2 = t : addToTrees (s1:ss) ts | s1 == s2 = Node s2 (leaf || null ss) (addToTrees ss subs) : ts - | otherwise = t : addToTrees (s1:ss) ts + | otherwise = mkSubTree (s1:ss) ++ t : ts mkSubTree [] = [] mkSubTree (s:ss) = [Node s (null ss) (mkSubTree ss)] |