diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/data/collection/sequence.lux | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/stdlib/source/library/lux/data/collection/sequence.lux b/stdlib/source/library/lux/data/collection/sequence.lux index 4105e22e5..44755f0db 100644 --- a/stdlib/source/library/lux/data/collection/sequence.lux +++ b/stdlib/source/library/lux/data/collection/sequence.lux @@ -23,11 +23,11 @@ {#.doc "An infinite sequence of values."} (Cont [a (Sequence a)])) -(def: #export (iterate f x) +(def: #export (iterations f x) {#.doc "Create a sequence by applying a function to a value, and to its result, on and on..."} (All [a] (-> (-> a a) a (Sequence a))) - (//.pending [x (iterate f (f x))])) + (//.pending [x (iterations f (f x))])) (def: #export (repeat x) {#.doc "Repeat a value forever."} @@ -59,12 +59,12 @@ [tail (Sequence a)] ) -(def: #export (nth idx sequence) +(def: #export (item idx sequence) (All [a] (-> Nat (Sequence a) a)) (let [[head tail] (//.run sequence)] (case idx 0 head - _ (nth (dec idx) tail)))) + _ (item (dec idx) tail)))) (template [<taker> <dropper> <splitter> <pred_type> <pred_test> <pred_step>] [(def: #export (<taker> pred xs) |