Fix compiler warnings

This commit is contained in:
Jordan Martinez 2022-02-15 08:19:54 -06:00
parent 0c5d7db714
commit 0285d31f84
2 changed files with 5 additions and 5 deletions

View File

@ -45,7 +45,7 @@ drawForest' level forest = tailRec goForest { level: level, drawn: "", current:
goForest
:: { current :: Forest String, drawn :: String, level :: Int }
-> Step { current :: Forest String, drawn :: String, level :: Int } String
goForest { level: l, drawn: s, current: Nil } = Done s
goForest { drawn: s, current: Nil } = Done s
goForest { level: l, drawn: s, current: c : cs } = do
let
drawnTree = drawTree' l c
@ -70,7 +70,7 @@ scanTree f b n = do
fb :< (tailRec go { b: fb, current: (tail n), final: Nil })
where
go :: { final :: Forest b, current :: Forest a, b :: b } -> Step { final :: Forest b, current :: Forest a, b :: b } (Forest b)
go { b: b', current: Nil, final: final } = Done final
go { current: Nil, final: final } = Done final
go { b: b', current: c : cs, final: final } = do
let
fb' = f (head c) b'
@ -85,7 +85,7 @@ scanTreeAccum f b n = do
fb.value :< (tailRec go { b: fb.accum, current: (tail n), final: Nil })
where
go :: { final :: Forest c, current :: Forest a, b :: b } -> Step { final :: Forest c, current :: Forest a, b :: b } (Forest c)
go { b: b', current: Nil, final: final } = Done final
go { current: Nil, final: final } = Done final
go { b: b', current: c : cs, final: final } = do
let
fb' = f (head c) b'

View File

@ -124,7 +124,7 @@ lastChild n =
-- | Move the cursor to a specific sibling by it's index.
siblingAt :: forall a. Int -> Loc a -> Maybe (Loc a)
siblingAt i l@(Loc r) = do
p@(Loc r') <- up l
p <- up l
c <- (children p) !! i
let before' = reverse $ take i (children p)
let after' = drop (i + 1) (children p)
@ -214,7 +214,7 @@ delete l@(Loc r) =
Nil ->
case r.parents of
Nil -> l
c : cs -> Loc
c : _ -> Loc
{ node: mkTree (value c) Nil
, before: before c
, after: after c