aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/poly/lux/abstract/functor.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/poly/lux/abstract/functor.lux28
1 files changed, 14 insertions, 14 deletions
diff --git a/stdlib/source/poly/lux/abstract/functor.lux b/stdlib/source/poly/lux/abstract/functor.lux
index d68d55af8..e607f1174 100644
--- a/stdlib/source/poly/lux/abstract/functor.lux
+++ b/stdlib/source/poly/lux/abstract/functor.lux
@@ -38,7 +38,7 @@
(function (_ unwrappedT)
(if (n.= 1 num_vars)
(` ((~! /.Functor) (~ (poly.code *env* unwrappedT))))
- (let [paramsC (|> num_vars -- list.indices (list\map (|>> %.nat code.local_identifier)))]
+ (let [paramsC (|> num_vars -- list.indices (list\each (|>> %.nat code.local_identifier)))]
(` (All [(~+ paramsC)]
((~! /.Functor) ((~ (poly.code *env* unwrappedT)) (~+ paramsC)))))))))
Arg<?> (: (-> Code (<type>.Parser Code))
@@ -55,13 +55,13 @@
membersC (<type>.variant (p.many (Arg<?> valueC)))
.let [last (-- (list.size membersC))]]
(in (` (case (~ valueC)
- (~+ (list\join (list\map (function (_ [tag memberC])
- (if (n.= last tag)
- (list (` ((~ (code.nat (-- tag))) #1 (~ valueC)))
- (` ((~ (code.nat (-- tag))) #1 (~ memberC))))
- (list (` ((~ (code.nat tag)) #0 (~ valueC)))
- (` ((~ (code.nat tag)) #0 (~ memberC))))))
- (list.enumeration membersC))))))))
+ (~+ (list\conjoint (list\each (function (_ [tag memberC])
+ (if (n.= last tag)
+ (list (` ((~ (code.nat (-- tag))) #1 (~ valueC)))
+ (` ((~ (code.nat (-- tag))) #1 (~ memberC))))
+ (list (` ((~ (code.nat tag)) #0 (~ valueC)))
+ (` ((~ (code.nat tag)) #0 (~ memberC))))))
+ (list.enumeration membersC))))))))
... Tuples
(do p.monad
[pairsCC (: (<type>.Parser (List [Code Code]))
@@ -73,11 +73,11 @@
[_ (in [])
memberC (Arg<?> slotC)]
(recur (++ idx)
- (list\compose pairsCC (list [slotC memberC])))))
+ (list\composite pairsCC (list [slotC memberC])))))
(in pairsCC)))))]
(in (` (case (~ valueC)
- [(~+ (list\map product.left pairsCC))]
- [(~+ (list\map product.right pairsCC))]))))
+ [(~+ (list\each product.left pairsCC))]
+ [(~+ (list\each product.right pairsCC))]))))
... Functions
(do !
[_ (in [])
@@ -87,14 +87,14 @@
(Arg<?> outL))
.let [inC+ (|> (list.size inT+)
list.indices
- (list\map (|>> %.nat (format "____________inC") code.local_identifier)))]]
+ (list\each (|>> %.nat (format "____________inC") code.local_identifier)))]]
(in (` (function ((~ g!) (~+ inC+))
(let [(~ outL) ((~ valueC) (~+ inC+))]
(~ outC))))))
... Recursion
(do p.monad
[_ <type>.recursive_call]
- (in (` ((~' map) (~ funcC) (~ valueC)))))
+ (in (` ((~' each) (~ funcC) (~ valueC)))))
... Parameters
(do p.monad
[_ <type>.any]
@@ -106,5 +106,5 @@
(p.failure (format "Cannot create Functor for: " (%.type inputT)))))]
(in (` (: (~ (@Functor inputT))
(implementation
- (def: ((~' map) (~ funcC) (~ inputC))
+ (def: ((~' each) (~ funcC) (~ inputC))
(~ outputC))))))))