diff --git a/src/Dodge/Tree/Compose.hs b/src/Dodge/Tree/Compose.hs index 4d3ff3675..6663b20d9 100644 --- a/src/Dodge/Tree/Compose.hs +++ b/src/Dodge/Tree/Compose.hs @@ -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