Add missing case

This commit is contained in:
2022-06-11 17:12:17 +01:00
parent 6cd1d6c130
commit 51cd9315ad
+12 -8
View File
@@ -163,20 +163,24 @@ logMB (MBranch str _ mt) = root ++.~ (str ++ ":") $ logMT mt
logMT :: MetaTree a -> Tree String
logMT mt = case mt of
MTree str _ branches -> Node ("M:"++str) $ map logMB branches
BTree str _ branches -> Node str $ map logMT branches
MTree str _ brs -> Node ("M:"++str) $ map logMB brs
BTree str _ brs -> Node str $ map logMT brs
composeAndSubLog :: MetaTree a -> IO (Tree a)
composeAndSubLog mt = case mt of
mt@MTree{} -> composeAndLog mt
MTree{} -> composeAndLog mt
bt -> do
branches <- mapM composeAndSubLog $ _btBranches bt
return $ Node (_btValue bt) branches
brs <- mapM composeAndSubLog $ _btBranches bt
return $ Node (_btValue bt) brs
composeAndLog :: MetaTree a -> IO (Tree a)
composeAndLog mt = case mt of
mt@MTree{} -> do
MTree{} -> do
putStrLn $ drawTree $ logMT mt
rt <- composeAndLog $ _mtTree mt
branches <- mapM (\mb -> (_mbAttach mb,) <$> composeAndSubLog (_mbTree mb)) $ _mtBranches mt
return $ attachList rt $ map pure branches
brs <- mapM (\mb -> (_mbAttach mb,) <$> composeAndSubLog (_mbTree mb)) $ _mtBranches mt
return $ attachList rt $ map pure brs
BTree{} -> do
putStrLn $ drawTree $ logMT mt
brs <- mapM composeAndSubLog $ _btBranches mt
return $ Node (_btValue mt) brs