aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/collection/sequence.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/data/collection/sequence.lux17
1 files changed, 9 insertions, 8 deletions
diff --git a/stdlib/source/library/lux/data/collection/sequence.lux b/stdlib/source/library/lux/data/collection/sequence.lux
index 2bed3b721..8efb47cce 100644
--- a/stdlib/source/library/lux/data/collection/sequence.lux
+++ b/stdlib/source/library/lux/data/collection/sequence.lux
@@ -112,9 +112,9 @@
(implementation: .public functor
(Functor Sequence)
- (def: (map f fa)
+ (def: (each f fa)
(let [[head tail] (//.result fa)]
- (//.pending [(f head) (map f tail)]))))
+ (//.pending [(f head) (each f tail)]))))
(implementation: .public comonad
(CoMonad Sequence)
@@ -123,17 +123,18 @@
(def: out head)
- (def: (split wa)
+ (def: (disjoint wa)
(let [[head tail] (//.result wa)]
- (//.pending [wa (split tail)]))))
+ (//.pending [wa (disjoint tail)]))))
(syntax: .public (^sequence& [patterns (<code>.form (<>.many <code>.any))
body <code>.any
branches (<>.some <code>.any)])
(with_identifiers [g!sequence]
- (let [body+ (` (let [(~+ (list\join (list\map (function (_ pattern)
- (list (` [(~ pattern) (~ g!sequence)])
- (` ((~! //.result) (~ g!sequence)))))
- patterns)))]
+ (let [body+ (` (let [(~+ (|> patterns
+ (list\each (function (_ pattern)
+ (list (` [(~ pattern) (~ g!sequence)])
+ (` ((~! //.result) (~ g!sequence))))))
+ list\conjoint))]
(~ body)))]
(in (list& g!sequence body+ branches)))))