diff options
Diffstat (limited to 'stdlib/source/library/lux/data/collection/dictionary/ordered.lux')
-rw-r--r-- | stdlib/source/library/lux/data/collection/dictionary/ordered.lux | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux index ef9e53973..acb2599f2 100644 --- a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux @@ -33,7 +33,7 @@ (template [<create> <color>] [(def: (<create> key value left right) - (All [k v] (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) + (All (_ k v) (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) {#color <color> #key key #value value @@ -50,14 +50,14 @@ #root (Maybe (Node k v))})) (def: .public (empty order) - (All [k v] (-> (Order k) (Dictionary k v))) + (All (_ k v) (-> (Order k) (Dictionary k v))) {#&order order #root #.None}) ... TODO: Doing inneficient access of Order functions due to compiler bug. ... TODO: Must improve it as soon as bug is fixed. (def: .public (value key dict) - (All [k v] (-> k (Dictionary k v) (Maybe v))) + (All (_ k v) (-> k (Dictionary k v) (Maybe v))) (let [... (^open "_\.") (value@ #&order dict) ] (loop [node (value@ #root dict)] @@ -82,7 +82,7 @@ ... TODO: Doing inneficient access of Order functions due to compiler bug. ... TODO: Must improve it as soon as bug is fixed. (def: .public (key? dict key) - (All [k v] (-> (Dictionary k v) k Bit)) + (All (_ k v) (-> (Dictionary k v) k Bit)) (let [... (^open "_\.") (value@ #&order dict) ] (loop [node (value@ #root dict)] @@ -101,7 +101,7 @@ (template [<name> <side>] [(def: .public (<name> dict) - (All [k v] (-> (Dictionary k v) (Maybe v))) + (All (_ k v) (-> (Dictionary k v) (Maybe v))) (case (value@ #root dict) #.None #.None @@ -120,7 +120,7 @@ ) (def: .public (size dict) - (All [k v] (-> (Dictionary k v) Nat)) + (All (_ k v) (-> (Dictionary k v) Nat)) (loop [node (value@ #root dict)] (case node #.None @@ -131,12 +131,12 @@ (recur (value@ #right node))))))) (def: .public empty? - (All [k v] (-> (Dictionary k v) Bit)) + (All (_ k v) (-> (Dictionary k v) Bit)) (|>> ..size (n.= 0))) (template [<name> <other_color> <self_color> <no_change>] [(def: (<name> self) - (All [k v] (-> (Node k v) (Node k v))) + (All (_ k v) (-> (Node k v) (Node k v))) (case (value@ #color self) <other_color> (with@ #color <self_color> self) @@ -150,7 +150,7 @@ ) (def: (with_left addition center) - (All [k v] (-> (Node k v) (Node k v) (Node k v))) + (All (_ k v) (-> (Node k v) (Node k v) (Node k v))) (case (value@ #color center) #Red (red (value@ #key center) @@ -199,7 +199,7 @@ <default_behavior>)))) (def: (with_right addition center) - (All [k v] (-> (Node k v) (Node k v) (Node k v))) + (All (_ k v) (-> (Node k v) (Node k v) (Node k v))) (case (value@ #color center) #Red (red (value@ #key center) @@ -248,7 +248,7 @@ <default_behavior>)))) (def: .public (has key value dict) - (All [k v] (-> k v (Dictionary k v) (Dictionary k v))) + (All (_ k v) (-> k v (Dictionary k v) (Dictionary k v))) (let [(^open "_\.") (value@ #&order dict) root' (loop [?root (value@ #root dict)] (case ?root @@ -277,7 +277,7 @@ (with@ #root root' dict))) (def: (left_balanced key value ?left ?right) - (All [k v] (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) + (All (_ k v) (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) (case ?left (^multi (#.Some left) {(value@ #color left) #Red} @@ -306,7 +306,7 @@ (black key value ?left ?right))) (def: (right_balanced key value ?left ?right) - (All [k v] (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) + (All (_ k v) (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) (case ?right (^multi (#.Some right) {(value@ #color right) #Red} @@ -333,7 +333,7 @@ (black key value ?left ?right))) (def: (without_left key value ?left ?right) - (All [k v] (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) + (All (_ k v) (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) (case ?left (^multi (#.Some left) {(value@ #color left) #Red}) @@ -362,7 +362,7 @@ )) (def: (without_right key value ?left ?right) - (All [k v] (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) + (All (_ k v) (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) (case ?right (^multi (#.Some right) {(value@ #color right) #Red}) @@ -391,7 +391,7 @@ ))) (def: (prepended ?left ?right) - (All [k v] (-> (Maybe (Node k v)) (Maybe (Node k v)) (Maybe (Node k v)))) + (All (_ k v) (-> (Maybe (Node k v)) (Maybe (Node k v)) (Maybe (Node k v)))) (case [?left ?right] [#.None _] ?right @@ -471,7 +471,7 @@ (undefined))) (def: .public (lacks key dict) - (All [k v] (-> k (Dictionary k v) (Dictionary k v))) + (All (_ k v) (-> k (Dictionary k v) (Dictionary k v))) (let [(^open "_\.") (value@ #&order dict) [?root found?] (loop [?root (value@ #root dict)] (case ?root @@ -526,7 +526,7 @@ ))) (def: .public (revised key transform dict) - (All [k v] (-> k (-> v v) (Dictionary k v) (Dictionary k v))) + (All (_ k v) (-> k (-> v v) (Dictionary k v) (Dictionary k v))) (case (..value key dict) (#.Some old) (..has key (transform old) dict) @@ -535,7 +535,7 @@ dict)) (def: .public (of_list order list) - (All [k v] (-> (Order k) (List [k v]) (Dictionary k v))) + (All (_ k v) (-> (Order k) (List [k v]) (Dictionary k v))) (list\mix (function (_ [key value] dict) (has key value dict)) (empty order) @@ -543,7 +543,7 @@ (template [<name> <type> <output>] [(def: .public (<name> dict) - (All [k v] (-> (Dictionary k v) (List <type>))) + (All (_ k v) (-> (Dictionary k v) (List <type>))) (loop [node (value@ #root dict)] (case node #.None @@ -561,7 +561,7 @@ ) (implementation: .public (equivalence (^open ",\.")) - (All [k v] (-> (Equivalence v) (Equivalence (Dictionary k v)))) + (All (_ k v) (-> (Equivalence v) (Equivalence (Dictionary k v)))) (def: (= reference sample) (let [(^open "/\.") (value@ #&order reference)] |