@@ -21,7 +21,7 @@ mkTree = mkCofree
2121drawTree :: Tree String -> String
2222drawTree t = tailRec go {level: 0, drawn: (head t) <> "\n", current: (tail t)}
2323 where
24− go :: _ -> Step _ String
24+ go :: { current :: List (Tree String) , drawn :: String , level :: Int } -> Step { current :: List (Tree String) , drawn :: String , level :: Int } String
2525 go {level: l, drawn: s, current: Nil} = Done s
2626 go {level: l, drawn: s, current: c:cs } =
2727 let drawn = (power " " l) <> "|----> " <> (head c) <> "\n" in
@@ -39,7 +39,7 @@ scanTree f b n =
3939 let fb = f (head n) b
4040 in fb :< (tailRec go {b: fb, current: (tail n), final: Nil})
4141 where
42− go :: _ -> Step _ (Forest b)
42+ go :: { final :: List (Cofree List b) , current :: List (Cofree List a) , b :: b } -> Step { final :: List (Cofree List b) , current :: List (Cofree List a) , b :: b } (Forest b)
4343 go {b: b', current: Nil, final: final} = Done final
4444 go {b: b', current: c:cs, final: final} =
4545 let fb' = f (head c) b'
@@ -52,7 +52,7 @@ scanTreeAccum f b n =
5252 let fb = f (head n) b
5353 in fb.value :< (tailRec go {b: fb.accum , current: (tail n), final: Nil})
5454 where
55− go :: _ -> Step _ (Forest c)
55+ go :: { final :: List (Cofree List c) , current :: List (Cofree List a) , b :: b } -> Step { final :: List (Cofree List c) , current :: List (Cofree List a) , b :: b } (Forest c)
5656 go {b: b', current: Nil, final: final} = Done final
5757 go {b: b', current: c:cs, final: final} =
5858 let fb' = f (head c) b'