diff options
Diffstat (limited to 'stdlib/source/lux/data/coll/array.lux')
-rw-r--r-- | stdlib/source/lux/data/coll/array.lux | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/stdlib/source/lux/data/coll/array.lux b/stdlib/source/lux/data/coll/array.lux index 160fa69f3..304bd6ec7 100644 --- a/stdlib/source/lux/data/coll/array.lux +++ b/stdlib/source/lux/data/coll/array.lux @@ -45,7 +45,7 @@ (Array a))) (if (n.= +0 length) dest-array - (List/fold (lambda [offset target] + (List/fold (function [offset target] (case (get (n.+ offset src-start) src-array) #;None target @@ -58,7 +58,7 @@ (def: #export (occupied array) {#;doc "Finds out how many cells in an array are occupied."} (All [a] (-> (Array a) Nat)) - (List/fold (lambda [idx count] + (List/fold (function [idx count] (case (get idx array) #;None count @@ -77,7 +77,7 @@ (All [a] (-> (-> a Bool) (Array a) (Array a))) (List/fold (: (-> Nat (Array ($ +0)) (Array ($ +0))) - (lambda [idx xs'] + (function [idx xs'] (case (get idx xs) #;None xs' @@ -125,7 +125,7 @@ (def: #export (clone xs) (All [a] (-> (Array a) (Array a))) (let [arr-size (size xs)] - (List/fold (lambda [idx ys] + (List/fold (function [idx ys] (case (get idx xs) #;None ys @@ -137,7 +137,7 @@ (def: #export (from-list xs) (All [a] (-> (List a) (Array a))) - (product;right (List/fold (lambda [x [idx arr]] + (product;right (List/fold (function [x [idx arr]] [(n.inc idx) (put idx x arr)]) [+0 (new (list;size xs))] xs))) @@ -145,7 +145,7 @@ (def: #export (to-list array) (All [a] (-> (Array a) (List a))) (let [_size (size array)] - (product;right (List/fold (lambda [_ [idx tail]] + (product;right (List/fold (function [_ [idx tail]] (case (get idx array) (#;Some head) [(n.dec idx) (#;Cons head tail)] @@ -163,7 +163,7 @@ (let [sxs (size xs) sxy (size ys)] (and (n.= sxy sxs) - (List/fold (lambda [idx prev] + (List/fold (function [idx prev] (and prev (case [(get idx xs) (get idx ys)] [#;None #;None] @@ -195,7 +195,7 @@ (if (n.= +0 arr-size) (new arr-size) (List/fold (: (-> Nat (Array ($ +1)) (Array ($ +1))) - (lambda [idx mb] + (function [idx mb] (case (get idx ma) #;None mb |