aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/collection/sequence.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/data/collection/sequence.lux')
-rw-r--r--stdlib/source/library/lux/data/collection/sequence.lux13
1 files changed, 0 insertions, 13 deletions
diff --git a/stdlib/source/library/lux/data/collection/sequence.lux b/stdlib/source/library/lux/data/collection/sequence.lux
index 42cd682df..2bed3b721 100644
--- a/stdlib/source/library/lux/data/collection/sequence.lux
+++ b/stdlib/source/library/lux/data/collection/sequence.lux
@@ -20,25 +20,20 @@
["n" nat]]]]])
(type: .public (Sequence a)
- {#.doc "An infinite sequence of values."}
(Cont [a (Sequence a)]))
(def: .public (iterations step init)
- {#.doc "A stateful way of infinitely calculating the values of a sequence."}
(All [a b]
(-> (-> a [a b]) a (Sequence b)))
(let [[next x] (step init)]
(//.pending [x (iterations step next)])))
(def: .public (repeated x)
- {#.doc "Repeat a value forever."}
(All [a]
(-> a (Sequence a)))
(//.pending [x (repeated x)]))
(def: .public (cycle [start next])
- {#.doc (example "Go over the elements of a list forever."
- "The list should not be empty.")}
(All [a]
(-> [a (List a)] (Sequence a)))
(loop [head start
@@ -103,7 +98,6 @@
)
(def: .public (only predicate sequence)
- {#.doc (example "A new sequence only with items that satisfy the predicate.")}
(All [a] (-> (-> a Bit) (Sequence a) (Sequence a)))
(let [[head tail] (//.result sequence)]
(if (predicate head)
@@ -111,9 +105,6 @@
(only predicate tail))))
(def: .public (partition left? xs)
- {#.doc (example "Split a sequence in two based on a predicate."
- "The left side contains all entries for which the predicate is #1."
- "The right side contains all entries for which the predicate is #0.")}
(All [a] (-> (-> a Bit) (Sequence a) [(Sequence a) (Sequence a)]))
[(..only left? xs)
(..only (bit.complement left?) xs)])
@@ -139,10 +130,6 @@
(syntax: .public (^sequence& [patterns (<code>.form (<>.many <code>.any))
body <code>.any
branches (<>.some <code>.any)])
- {#.doc (example "Allows destructuring of sequences in pattern-matching expressions."
- "Caveat emptor: Only use it for destructuring, and not for testing values within the sequences."
- (let [(^sequence& x y z _tail) (some_sequence_func +1 +2 +3)]
- (func x y z)))}
(with_identifiers [g!sequence]
(let [body+ (` (let [(~+ (list\join (list\map (function (_ pattern)
(list (` [(~ pattern) (~ g!sequence)])