diff options
-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)] |