diff options
Diffstat (limited to 'stdlib/source/library/lux/data/collection')
12 files changed, 53 insertions, 53 deletions
diff --git a/stdlib/source/library/lux/data/collection/dictionary.lux b/stdlib/source/library/lux/data/collection/dictionary.lux index 5fc1d3ebb..a4b122919 100644 --- a/stdlib/source/library/lux/data/collection/dictionary.lux +++ b/stdlib/source/library/lux/data/collection/dictionary.lux @@ -232,10 +232,10 @@ ... Produces the index of a KV-pair within a #Collisions node. (def: (collision_index key_hash key colls) (All (_ k v) (-> (Hash k) k (Collisions k v) (Maybe Index))) - (# maybe.monad each product.left - (array.example' (function (_ idx [key' val']) - (# key_hash = key key')) - colls))) + (at maybe.monad each product.left + (array.example' (function (_ idx [key' val']) + (at key_hash = key key')) + colls))) ... When #Hierarchy nodes grow too small, they're demoted to #Base ... nodes to save space. @@ -276,7 +276,7 @@ {.#Right [key' val']} (array.has! hierarchy_idx - (node#has (level_up level) (# key_hash hash key') key' val' key_hash ..empty_node) + (node#has (level_up level) (at key_hash hash key') key' val' key_hash ..empty_node) h_array))] default)) [0 @@ -325,11 +325,11 @@ ... Otherwise, if it's being used by a KV, compare the keys. {.#Right key' val'} (array#revised idx - (if (# key_hash = key key') + (if (at key_hash = key key') ... If the same key is found, replace the value. {.#Right key val} ... Otherwise, compare the hashes of the keys. - {.#Left (let [hash' (# key_hash hash key')] + {.#Left (let [hash' (at key_hash hash key')] (if (n.= hash hash') ... If the hashes are ... the same, a new @@ -432,7 +432,7 @@ node ... But if it came out empty... (if (node#empty? sub_node') - ...# ... figure out whether that's the only position left. + ...at ... figure out whether that's the only position left. (if (only_bit_position? bit bitmap) ... If so, removing it leaves this node empty too. ..empty_node @@ -448,7 +448,7 @@ ... If, however, there was a KV-pair instead of a sub-node. {.#Right [key' val']} ... Check if the keys match. - (if (# key_hash = key key') + (if (at key_hash = key key') ... If so, remove the KV-pair and unset the Bit_Position. {#Base (without_bit_position bit bitmap) (array#lacks idx base)} @@ -493,16 +493,16 @@ (node#value (level_up level) hash key key_hash sub_node) {.#Right [key' val']} - (if (# key_hash = key key') + (if (at key_hash = key key') {.#Some val'} {.#None})) {.#None})) ... For #Collisions nodes, do a linear scan of all the known KV-pairs. {#Collisions _hash _colls} - (# maybe.monad each product.right - (array.example (|>> product.left (# key_hash = key)) - _colls)) + (at maybe.monad each product.right + (array.example (|>> product.left (at key_hash = key)) + _colls)) )) (def: (node#size node) @@ -577,17 +577,17 @@ (def: .public (has key val dict) (All (_ k v) (-> k v (Dictionary k v) (Dictionary k v))) (let [[key_hash node] dict] - [key_hash (node#has root_level (# key_hash hash key) key val key_hash node)])) + [key_hash (node#has root_level (at key_hash hash key) key val key_hash node)])) (def: .public (lacks key dict) (All (_ k v) (-> k (Dictionary k v) (Dictionary k v))) (let [[key_hash node] dict] - [key_hash (node#lacks root_level (# key_hash hash key) key key_hash node)])) + [key_hash (node#lacks root_level (at key_hash hash key) key key_hash node)])) (def: .public (value key dict) (All (_ k v) (-> k (Dictionary k v) (Maybe v))) (let [[key_hash node] dict] - (node#value root_level (# key_hash hash key) key key_hash node))) + (node#value root_level (at key_hash hash key) key key_hash node))) (def: .public (key? dict key) (All (_ k v) (-> (Dictionary k v) k Bit)) @@ -732,7 +732,7 @@ (All (_ k) (Functor (Dictionary k))) (def: (each f fa) - (.revised #root (# ..node_functor each f) fa))) + (.revised #root (at ..node_functor each f) fa))) (implementation: .public (monoid hash) (All (_ k v) (-> (Hash k) (Monoid (Dictionary k v)))) diff --git a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux index 46889f723..76e5939be 100644 --- a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux @@ -69,11 +69,11 @@ {.#Some node} (let [node_key (the #key node)] - (cond (# dict = node_key key) + (cond (at dict = node_key key) ... (_#= node_key key) {.#Some (the #value node)} - (# dict < node_key key) + (at dict < node_key key) ... (_#< node_key key) (again (the #left node)) @@ -94,9 +94,9 @@ {.#Some node} (let [node_key (the #key node)] - (or (# dict = node_key key) + (or (at dict = node_key key) ... (_#= node_key key) - (if (# dict < node_key key) + (if (at dict < node_key key) ... (_#< node_key key) (again (the #left node)) (again (the #right node))))))))) @@ -357,7 +357,7 @@ {.#Some (right_balanced (the #key right) (the #value right) (the #right right>>left) - (# maybe.functor each reddened (the #right right)))}) + (at maybe.functor each reddened (the #right right)))}) _ (panic! error_message)) @@ -384,7 +384,7 @@ (the #value left>>right) {.#Some (left_balanced (the #key left) (the #value left) - (# maybe.functor each reddened (the #left left)) + (at maybe.functor each reddened (the #left left)) (the #left left>>right))} {.#Some (black key value (the #right left>>right) ?right)}) diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux index 4f64f9ddf..903d5ae3f 100644 --- a/stdlib/source/library/lux/data/collection/list.lux +++ b/stdlib/source/library/lux/data/collection/list.lux @@ -298,7 +298,7 @@ #1 [{.#Item x xs'} {.#Item y ys'}] - (and (# Equivalence<a> = x y) + (and (at Equivalence<a> = x y) (= xs' ys')) [_ _] @@ -309,13 +309,13 @@ (All (_ a) (-> (Hash a) (Hash (List a)))) (def: equivalence - (..equivalence (# super equivalence))) + (..equivalence (at super equivalence))) (def: hash - (# ..mix mix - (function (_ member hash) - (n.+ (# super hash member) hash)) - 0))) + (at ..mix mix + (function (_ member hash) + (n.+ (at super hash member) hash)) + 0))) (implementation: .public monoid (All (_ a) (Monoid (List a))) @@ -405,7 +405,7 @@ #0 {.#Item x' xs'} - (or (# eq = x x') + (or (at eq = x x') (member? eq xs' x)))) (template [<name> <output> <side>] @@ -569,7 +569,7 @@ (def: .public together (All (_ a) (-> (List (List a)) (List a))) - (# ..monad conjoint)) + (at ..monad conjoint)) (implementation: .public (with monad) (All (_ M) (-> (Monad M) (Monad (All (_ a) (M (List a)))))) @@ -579,7 +579,7 @@ ..functor)) (def: in - (|>> (# ..monad in) (# monad in))) + (|>> (at ..monad in) (at monad in))) (def: (conjoint MlMla) (do [! monad] @@ -593,7 +593,7 @@ (def: .public (lifted monad) (All (_ M a) (-> (Monad M) (-> (M a) (M (List a))))) - (# monad each (# ..monad in))) + (at monad each (at ..monad in))) (def: .public (enumeration xs) (All (_ a) (-> (List a) (List [Nat a]))) diff --git a/stdlib/source/library/lux/data/collection/queue.lux b/stdlib/source/library/lux/data/collection/queue.lux index 103e38506..0d11963cd 100644 --- a/stdlib/source/library/lux/data/collection/queue.lux +++ b/stdlib/source/library/lux/data/collection/queue.lux @@ -82,9 +82,9 @@ (All (_ a) (-> (Equivalence a) (Equivalence (Queue a)))) (def: (= reference subject) - (# (list.equivalence super) = - (..list reference) - (..list subject)))) + (at (list.equivalence super) = + (..list reference) + (..list subject)))) (implementation: .public functor (Functor Queue) diff --git a/stdlib/source/library/lux/data/collection/queue/priority.lux b/stdlib/source/library/lux/data/collection/queue/priority.lux index 7ff7d3195..f62ff3c6a 100644 --- a/stdlib/source/library/lux/data/collection/queue/priority.lux +++ b/stdlib/source/library/lux/data/collection/queue/priority.lux @@ -76,7 +76,7 @@ (loop (again [node tree]) (case (tree.root node) {0 #0 reference} - (# equivalence = reference member) + (at equivalence = reference member) {0 #1 [left right]} (or (again left) @@ -102,24 +102,24 @@ {.#Some right} {.#Some =left} - {.#Some (# ..builder branch =left right)}) + {.#Some (at ..builder branch =left right)}) (case (again right) {.#None} {.#Some left} {.#Some =right} - {.#Some (# ..builder branch left =right)}))))))) + {.#Some (at ..builder branch left =right)}))))))) (def: .public (end priority value queue) (All (_ a) (-> Priority a (Queue a) (Queue a))) - (let [addition (# ..builder leaf priority value)] + (let [addition (at ..builder leaf priority value)] (abstraction (case (representation queue) {.#None} {.#Some addition} {.#Some tree} - {.#Some (# ..builder branch tree addition)})))) + {.#Some (at ..builder branch tree addition)})))) ) (def: .public empty? diff --git a/stdlib/source/library/lux/data/collection/sequence.lux b/stdlib/source/library/lux/data/collection/sequence.lux index 2c8fdadaa..74654008c 100644 --- a/stdlib/source/library/lux/data/collection/sequence.lux +++ b/stdlib/source/library/lux/data/collection/sequence.lux @@ -244,8 +244,8 @@ (exception: .public [a] (index_out_of_bounds [sequence (Sequence a) index Nat]) (exception.report - "Size" (# n.decimal encoded (the #size sequence)) - "Index" (# n.decimal encoded index))) + "Size" (at n.decimal encoded (the #size sequence)) + "Index" (at n.decimal encoded index))) (exception: base_was_not_found) @@ -445,7 +445,7 @@ [#level (the #level xs) #size (the #size xs) #root (let [... TODO: This binding was established to get around a compilation error. Fix and inline! - $ (# node_functor each $)] + $ (at node_functor each $)] (|> xs (the #root) (array.each $))) #tail (|> xs (the #tail) (array.each $))])) diff --git a/stdlib/source/library/lux/data/collection/set.lux b/stdlib/source/library/lux/data/collection/set.lux index bd82175ab..1d32060b9 100644 --- a/stdlib/source/library/lux/data/collection/set.lux +++ b/stdlib/source/library/lux/data/collection/set.lux @@ -78,7 +78,7 @@ (def: (hash set) (|> set ..list - (# (list.hash (..member_hash set)) hash)))) + (at (list.hash (..member_hash set)) hash)))) (implementation: .public (monoid hash) (All (_ a) (-> (Hash a) (Monoid (Set a)))) diff --git a/stdlib/source/library/lux/data/collection/set/multi.lux b/stdlib/source/library/lux/data/collection/set/multi.lux index 30ca10e23..ac422fd99 100644 --- a/stdlib/source/library/lux/data/collection/set/multi.lux +++ b/stdlib/source/library/lux/data/collection/set/multi.lux @@ -135,7 +135,7 @@ (let [set (representation set) [hash _] set] (list#mix (function (_ [elem multiplicity] acc) - (|> elem (# hash hash) (n.* multiplicity) (n.+ acc))) + (|> elem (at hash hash) (n.* multiplicity) (n.+ acc))) 0 (dictionary.entries set))))) ) diff --git a/stdlib/source/library/lux/data/collection/set/ordered.lux b/stdlib/source/library/lux/data/collection/set/ordered.lux index f55418053..9e83655b9 100644 --- a/stdlib/source/library/lux/data/collection/set/ordered.lux +++ b/stdlib/source/library/lux/data/collection/set/ordered.lux @@ -70,8 +70,8 @@ (All (_ a) (Equivalence (Set a))) (def: (= reference sample) - (# (list.equivalence (# (representation reference) equivalence)) - = (..list reference) (..list sample)))) + (at (list.equivalence (at (representation reference) equivalence)) + = (..list reference) (..list sample)))) ) (def: .public (sub? super sub) diff --git a/stdlib/source/library/lux/data/collection/stack.lux b/stdlib/source/library/lux/data/collection/stack.lux index 4994baf67..1b52dfdaa 100644 --- a/stdlib/source/library/lux/data/collection/stack.lux +++ b/stdlib/source/library/lux/data/collection/stack.lux @@ -53,7 +53,7 @@ (Equivalence (Stack a)))) (def: (= reference subject) - (# (//.equivalence super) = (representation reference) (representation subject)))) + (at (//.equivalence super) = (representation reference) (representation subject)))) (implementation: .public functor (Functor Stack) @@ -61,6 +61,6 @@ (def: (each f value) (|> value representation - (# //.functor each f) + (at //.functor each f) abstraction))) ) diff --git a/stdlib/source/library/lux/data/collection/tree.lux b/stdlib/source/library/lux/data/collection/tree.lux index f7dfcf617..43f2f16c9 100644 --- a/stdlib/source/library/lux/data/collection/tree.lux +++ b/stdlib/source/library/lux/data/collection/tree.lux @@ -63,8 +63,8 @@ (All (_ a) (-> (Equivalence a) (Equivalence (Tree a)))) (def: (= tx ty) - (and (# super = (the #value tx) (the #value ty)) - (# (list.equivalence (equivalence super)) = (the #children tx) (the #children ty))))) + (and (at super = (the #value tx) (the #value ty)) + (at (list.equivalence (equivalence super)) = (the #children tx) (the #children ty))))) (implementation: .public functor (Functor Tree) diff --git a/stdlib/source/library/lux/data/collection/tree/finger.lux b/stdlib/source/library/lux/data/collection/tree/finger.lux index 1e2b87d25..1a559f2ef 100644 --- a/stdlib/source/library/lux/data/collection/tree/finger.lux +++ b/stdlib/source/library/lux/data/collection/tree/finger.lux @@ -50,7 +50,7 @@ (def: (branch left right) (abstraction [#monoid monoid - #tag (# monoid composite (..tag left) (..tag right)) + #tag (at monoid composite (..tag left) (..tag right)) #root {.#Right [left right]}]))) (def: .public (value tree) |