diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/data/collection/tree/zipper.lux | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/library/lux/data/collection/tree/zipper.lux b/stdlib/source/library/lux/data/collection/tree/zipper.lux index bb36e3e38..942ca5c09 100644 --- a/stdlib/source/library/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/library/lux/data/collection/tree/zipper.lux @@ -112,7 +112,7 @@ rights)) parent)))))) -(template [<one> <all> <side> <op-side>] +(template [<one> <all> <side> <op_side>] [(def: #export (<one> zipper) (All [a] (-> (Zipper a) (Maybe (Zipper a)))) (case (get@ #family zipper) @@ -122,12 +122,12 @@ (#.Some (for {@.old {#family (#.Some (|> family (set@ <side> side') - (update@ <op-side> (|>> (#.Cons (get@ #node zipper)))))) + (update@ <op_side> (|>> (#.Cons (get@ #node zipper)))))) #node next}} (let [move (: (All [a] (-> (List (Tree a)) (Zipper a) (Family Zipper a) (Family Zipper a))) (function (_ side' zipper) (|>> (set@ <side> side') - (update@ <op-side> (|>> (#.Cons (get@ #node zipper)))))))] + (update@ <op_side> (|>> (#.Cons (get@ #node zipper)))))))] {#family (#.Some (move side' zipper family)) #node next}))) @@ -151,13 +151,13 @@ (#.Cons last prevs) (#.Some (for {@.old {#family (#.Some (|> family (set@ <side> #.Nil) - (update@ <op-side> (|>> (#.Cons (get@ #node zipper)) + (update@ <op_side> (|>> (#.Cons (get@ #node zipper)) (list\compose prevs))))) #node last}} (let [move (: (All [a] (-> (List (Tree a)) (Zipper a) (Family Zipper a) (Family Zipper a))) (function (_ prevs zipper) (|>> (set@ <side> #.Nil) - (update@ <op-side> (|>> (#.Cons (get@ #node zipper)) + (update@ <op_side> (|>> (#.Cons (get@ #node zipper)) (list\compose prevs))))))] {#family (#.Some (move prevs zipper family)) #node last}))))))] @@ -281,8 +281,8 @@ (#.Some (update@ <side> (|>> (#.Cons (//.leaf value))) family)) zipper))))] - [insert-left #lefts] - [insert-right #rights] + [insert_left #lefts] + [insert_right #rights] ) (implementation: #export functor @@ -304,15 +304,15 @@ (def: unwrap (get@ [#node #//.value])) (def: (split (^slots [#family #node])) - (let [tree-splitter (: (All [a] (-> (Tree a) (Tree (Zipper a)))) - (function (tree-splitter tree) + (let [tree_splitter (: (All [a] (-> (Tree a) (Tree (Zipper a)))) + (function (tree_splitter tree) {#//.value (..zip tree) #//.children (|> tree (get@ #//.children) - (list\map tree-splitter))}))] + (list\map tree_splitter))}))] {#family (maybe\map (function (_ (^slots [#parent #lefts #rights])) {#parent (split parent) - #lefts (list\map tree-splitter lefts) - #rights (list\map tree-splitter rights)}) + #lefts (list\map tree_splitter lefts) + #rights (list\map tree_splitter rights)}) family) - #node (tree-splitter node)}))) + #node (tree_splitter node)}))) |