aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/specification/compositor
diff options
context:
space:
mode:
authorEduardo Julian2021-08-24 05:23:45 -0400
committerEduardo Julian2021-08-24 05:23:45 -0400
commit36303d6cb2ce3ab9e36d045b9516c997bd461862 (patch)
treeb9d2f1495143054d61d9af129f36833624db9dac /stdlib/source/specification/compositor
parentec1f31b5a1492d5e0ab260397291d4449483bbd9 (diff)
Outsourced the syntax for labelled type definitions to macros.
Diffstat (limited to '')
-rw-r--r--stdlib/source/specification/compositor/generation/case.lux6
-rw-r--r--stdlib/source/specification/compositor/generation/common.lux6
-rw-r--r--stdlib/source/specification/compositor/generation/function.lux10
-rw-r--r--stdlib/source/specification/compositor/generation/reference.lux2
-rw-r--r--stdlib/source/specification/compositor/generation/structure.lux8
5 files changed, 16 insertions, 16 deletions
diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux
index 87fc1a5fc..3bfcec4e8 100644
--- a/stdlib/source/specification/compositor/generation/case.lux
+++ b/stdlib/source/specification/compositor/generation/case.lux
@@ -32,7 +32,7 @@
(def: size
(Random Nat)
- (|> r.nat (\ r.monad map (|>> (n.% ..limit) (n.max 2)))))
+ (|> r.nat (\ r.monad each (|>> (n.% ..limit) (n.max 2)))))
(def: (tail? size idx)
(-> Nat Nat Bit)
@@ -66,7 +66,7 @@
[(r.unicode 5) synthesis.text synthesis.path/text]))
(do {! r.monad}
[size ..size
- idx (|> r.nat (\ ! map (n.% size)))
+ idx (|> r.nat (\ ! each (n.% size)))
[subS subP] case
.let [unitS (synthesis.text synthesis.unit)
caseS (synthesis.tuple
@@ -81,7 +81,7 @@
(in [caseS caseP]))
(do {! r.monad}
[size ..size
- idx (|> r.nat (\ ! map (n.% size)))
+ idx (|> r.nat (\ ! each (n.% size)))
[subS subP] case
.let [right? (tail? size idx)
caseS (synthesis.variant
diff --git a/stdlib/source/specification/compositor/generation/common.lux b/stdlib/source/specification/compositor/generation/common.lux
index 6387b3013..729ce81f4 100644
--- a/stdlib/source/specification/compositor/generation/common.lux
+++ b/stdlib/source/specification/compositor/generation/common.lux
@@ -118,7 +118,7 @@
(def: simple_frac
(Random Frac)
- (|> r.nat (\ r.monad map (|>> (n.% 1000) .int i.frac))))
+ (|> r.nat (\ r.monad each (|>> (n.% 1000) .int i.frac))))
(def: (f64 run)
(-> Runner Test)
@@ -175,12 +175,12 @@
(def: (text run)
(-> Runner Test)
(do {! r.monad}
- [sample_size (|> r.nat (\ ! map (|>> (n.% 10) (n.max 1))))
+ [sample_size (|> r.nat (\ ! each (|>> (n.% 10) (n.max 1))))
sample_lower (r.ascii/lower_alpha sample_size)
sample_upper (r.ascii/upper_alpha sample_size)
sample_alpha (|> (r.ascii/alpha sample_size)
(r.only (|>> (text\= sample_upper) not)))
- char_idx (|> r.nat (\ ! map (n.% sample_size)))
+ char_idx (|> r.nat (\ ! each (n.% sample_size)))
.let [sample_lowerS (synthesis.text sample_lower)
sample_upperS (synthesis.text sample_upper)
sample_alphaS (synthesis.text sample_alpha)
diff --git a/stdlib/source/specification/compositor/generation/function.lux b/stdlib/source/specification/compositor/generation/function.lux
index 8a090094f..36b45c283 100644
--- a/stdlib/source/specification/compositor/generation/function.lux
+++ b/stdlib/source/specification/compositor/generation/function.lux
@@ -30,11 +30,11 @@
(def: arity
(Random Arity)
- (|> r.nat (r\map (|>> (n.% max_arity) (n.max 1)))))
+ (|> r.nat (r\each (|>> (n.% max_arity) (n.max 1)))))
(def: (local arity)
(-> Arity (Random Register))
- (|> r.nat (r\map (|>> (n.% arity) ++))))
+ (|> r.nat (r\each (|>> (n.% arity) ++))))
(def: function
(Random [Arity Register Synthesis])
@@ -51,10 +51,10 @@
(-> Runner Test)
(do {! r.monad}
[[arity local functionS] ..function
- partial_arity (|> r.nat (\ ! map (|>> (n.% arity) (n.max 1))))
+ partial_arity (|> r.nat (\ ! each (|>> (n.% arity) (n.max 1))))
inputs (r.list arity r.safe_frac)
.let [expectation (maybe.trusted (list.item (-- local) inputs))
- inputsS (list\map (|>> synthesis.f64) inputs)]]
+ inputsS (list\each (|>> synthesis.f64) inputs)]]
($_ _.and
(_.test "Can read arguments."
(|> (synthesis.function/apply {#synthesis.function functionS
@@ -75,7 +75,7 @@
(or (n.= 1 arity)
(let [environment (|> partial_arity
(enum.range n.enum 1)
- (list\map (|>> #reference.Local)))
+ (list\each (|>> #reference.Local)))
variableS (if (n.<= partial_arity local)
(synthesis.variable/foreign (-- local))
(synthesis.variable/local (|> local (n.- partial_arity))))
diff --git a/stdlib/source/specification/compositor/generation/reference.lux b/stdlib/source/specification/compositor/generation/reference.lux
index 02338e915..ee9da7455 100644
--- a/stdlib/source/specification/compositor/generation/reference.lux
+++ b/stdlib/source/specification/compositor/generation/reference.lux
@@ -40,7 +40,7 @@
(def: (variable run)
(-> Runner Test)
(do {! r.monad}
- [register (|> r.nat (\ ! map (n.% 100)))
+ [register (|> r.nat (\ ! each (n.% 100)))
expected r.safe_frac]
(_.test "Local variables."
(|> (synthesis.branch/let [(synthesis.f64 expected)
diff --git a/stdlib/source/specification/compositor/generation/structure.lux b/stdlib/source/specification/compositor/generation/structure.lux
index de61ed882..ec9893e7c 100644
--- a/stdlib/source/specification/compositor/generation/structure.lux
+++ b/stdlib/source/specification/compositor/generation/structure.lux
@@ -31,8 +31,8 @@
(def: (variant run)
(-> Runner Test)
(do {! r.monad}
- [num_tags (|> r.nat (\ ! map (|>> (n.% 10) (n.max 2))))
- tag_in (|> r.nat (\ ! map (n.% num_tags)))
+ [num_tags (|> r.nat (\ ! each (|>> (n.% 10) (n.max 2))))
+ tag_in (|> r.nat (\ ! each (n.% num_tags)))
.let [last?_in (|> num_tags -- (n.= tag_in))]
value_in r.i64]
(_.test (%.name (name_of synthesis.variant))
@@ -66,10 +66,10 @@
(def: (tuple run)
(-> Runner Test)
(do {! r.monad}
- [size (|> r.nat (\ ! map (|>> (n.% 10) (n.max 2))))
+ [size (|> r.nat (\ ! each (|>> (n.% 10) (n.max 2))))
tuple_in (r.list size r.i64)]
(_.test (%.name (name_of synthesis.tuple))
- (|> (synthesis.tuple (list\map (|>> synthesis.i64) tuple_in))
+ (|> (synthesis.tuple (list\each (|>> synthesis.i64) tuple_in))
(run "tuple")
(case> (#try.Success tuple_out)
(let [tuple_out (:as (Array Any) tuple_out)]