aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/spec
diff options
context:
space:
mode:
authorEduardo Julian2020-12-02 06:42:20 -0400
committerEduardo Julian2020-12-02 06:42:20 -0400
commit34e310622bdeb1d0588c0664c0e78cbaa84f837c (patch)
treeeb7c04185b57c781f45d0ccdb955bc9afc2aa8dc /stdlib/source/spec
parent982a19e0c5d57b53f9726b780fec4c18f0787b4f (diff)
Re-named "::" and ":::" macros to "\" and "\\", to be consistent with the convention that only macros that deal with types may start with a colon.
Diffstat (limited to 'stdlib/source/spec')
-rw-r--r--stdlib/source/spec/aedifex/repository.lux10
-rw-r--r--stdlib/source/spec/compositor/common.lux11
-rw-r--r--stdlib/source/spec/compositor/generation/case.lux8
-rw-r--r--stdlib/source/spec/compositor/generation/common.lux6
-rw-r--r--stdlib/source/spec/compositor/generation/function.lux2
-rw-r--r--stdlib/source/spec/compositor/generation/reference.lux2
-rw-r--r--stdlib/source/spec/compositor/generation/structure.lux6
-rw-r--r--stdlib/source/spec/lux/abstract/apply.lux10
-rw-r--r--stdlib/source/spec/lux/abstract/comonad.lux18
-rw-r--r--stdlib/source/spec/lux/abstract/functor.lux10
-rw-r--r--stdlib/source/spec/lux/abstract/monad.lux18
-rw-r--r--stdlib/source/spec/lux/world/console.lux10
-rw-r--r--stdlib/source/spec/lux/world/shell.lux14
13 files changed, 64 insertions, 61 deletions
diff --git a/stdlib/source/spec/aedifex/repository.lux b/stdlib/source/spec/aedifex/repository.lux
index a660722d9..77c453f4b 100644
--- a/stdlib/source/spec/aedifex/repository.lux
+++ b/stdlib/source/spec/aedifex/repository.lux
@@ -28,15 +28,15 @@
[expected (_binary.random 100)]
(wrap ($_ _.and'
(do promise.monad
- [upload!/good (:: subject upload valid-identity valid-artifact //artifact/extension.lux-library expected)
- download!/good (:: subject download valid-artifact //artifact/extension.lux-library)
+ [upload!/good (\ subject upload valid-identity valid-artifact //artifact/extension.lux-library expected)
+ download!/good (\ subject download valid-artifact //artifact/extension.lux-library)
- upload!/bad (:: subject upload invalid-identity invalid-artifact //artifact/extension.lux-library expected)
- download!/bad (:: subject download invalid-artifact //artifact/extension.lux-library)]
+ upload!/bad (\ subject upload invalid-identity invalid-artifact //artifact/extension.lux-library expected)
+ download!/bad (\ subject download invalid-artifact //artifact/extension.lux-library)]
(_.cover' [/.Repository]
(and (case [upload!/good download!/good]
[(#try.Success _) (#try.Success actual)]
- (:: binary.equivalence = expected actual)
+ (\ binary.equivalence = expected actual)
_
false)
diff --git a/stdlib/source/spec/compositor/common.lux b/stdlib/source/spec/compositor/common.lux
index df351c008..ed3b53f30 100644
--- a/stdlib/source/spec/compositor/common.lux
+++ b/stdlib/source/spec/compositor/common.lux
@@ -19,8 +19,11 @@
[default
["." platform (#+ Platform)]]]]])
-(type: #export Runner (-> Text Synthesis (Try Any)))
-(type: #export Definer (-> Name Synthesis (Try Any)))
+(type: #export Runner
+ (-> Text Synthesis (Try Any)))
+
+(type: #export Definer
+ (-> Name Synthesis (Try Any)))
(type: #export (Instancer what)
(All [anchor expression directive]
@@ -37,7 +40,7 @@
(do phase.monad
[_ runtime]
(phase expressionS)))]
- (:: host evaluate! evaluation-name expressionG))))
+ (\ host evaluate! evaluation-name expressionG))))
(def: (definer (^slots [#platform.runtime #platform.phase #platform.host])
state)
@@ -52,7 +55,7 @@
[host-name host-value host-directive] (generation.define! lux-name expressionG)
_ (generation.learn lux-name host-name)]
(phase (synthesis.constant lux-name))))]
- (:: host evaluate! "definer" definitionG))))
+ (\ host evaluate! "definer" definitionG))))
(def: #export (executors target expander platform
analysis-bundle generation-bundle directive-bundle
diff --git a/stdlib/source/spec/compositor/generation/case.lux b/stdlib/source/spec/compositor/generation/case.lux
index 908fef201..958110ce4 100644
--- a/stdlib/source/spec/compositor/generation/case.lux
+++ b/stdlib/source/spec/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 map (|>> (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 (\ ! map (n.% size)))
[subS subP] case
#let [unitS (synthesis.text synthesis.unit)
caseS (synthesis.tuple
@@ -81,7 +81,7 @@
(wrap [caseS caseP]))
(do {! r.monad}
[size ..size
- idx (|> r.nat (:: ! map (n.% size)))
+ idx (|> r.nat (\ ! map (n.% size)))
[subS subP] case
#let [right? (tail? size idx)
caseS (synthesis.variant
@@ -249,7 +249,7 @@
(_.test "==="
(and (text\= (synthesis.%path special-path)
(synthesis.%path special-pattern-path))
- (:: synthesis.path-equivalence = special-path special-pattern-path)))
+ (\ synthesis.path-equivalence = special-path special-pattern-path)))
(_.test "CODE"
(|> special-input
(run "special-input")
diff --git a/stdlib/source/spec/compositor/generation/common.lux b/stdlib/source/spec/compositor/generation/common.lux
index 60caf1a32..a963cd7f6 100644
--- a/stdlib/source/spec/compositor/generation/common.lux
+++ b/stdlib/source/spec/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 map (|>> (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 (\ ! map (|>> (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.filter (|>> (text\= sample-upper) not)))
- char-idx (|> r.nat (:: ! map (n.% sample-size)))
+ char-idx (|> r.nat (\ ! map (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/spec/compositor/generation/function.lux b/stdlib/source/spec/compositor/generation/function.lux
index 21b2b4446..6d0f8d541 100644
--- a/stdlib/source/spec/compositor/generation/function.lux
+++ b/stdlib/source/spec/compositor/generation/function.lux
@@ -49,7 +49,7 @@
(-> Runner Test)
(do {! r.monad}
[[arity local functionS] ..function
- partial-arity (|> r.nat (:: ! map (|>> (n.% arity) (n.max 1))))
+ partial-arity (|> r.nat (\ ! map (|>> (n.% arity) (n.max 1))))
inputs (r.list arity r.safe-frac)
#let [expectation (maybe.assume (list.nth (dec local) inputs))
inputsS (list\map (|>> synthesis.f64) inputs)]]
diff --git a/stdlib/source/spec/compositor/generation/reference.lux b/stdlib/source/spec/compositor/generation/reference.lux
index f1e12ff96..a94824f28 100644
--- a/stdlib/source/spec/compositor/generation/reference.lux
+++ b/stdlib/source/spec/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 (\ ! map (n.% 100)))
expected r.safe-frac]
(_.test "Local variables."
(|> (synthesis.branch/let [(synthesis.f64 expected)
diff --git a/stdlib/source/spec/compositor/generation/structure.lux b/stdlib/source/spec/compositor/generation/structure.lux
index e728867eb..a8f820786 100644
--- a/stdlib/source/spec/compositor/generation/structure.lux
+++ b/stdlib/source/spec/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 (\ ! map (|>> (n.% 10) (n.max 2))))
+ tag-in (|> r.nat (\ ! map (n.% num-tags)))
#let [last?-in (|> num-tags dec (n.= tag-in))]
value-in r.i64]
(_.test (%.name (name-of synthesis.variant))
@@ -66,7 +66,7 @@
(def: (tuple run)
(-> Runner Test)
(do {! r.monad}
- [size (|> r.nat (:: ! map (|>> (n.% 10) (n.max 2))))
+ [size (|> r.nat (\ ! map (|>> (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))
diff --git a/stdlib/source/spec/lux/abstract/apply.lux b/stdlib/source/spec/lux/abstract/apply.lux
index 399e69e9e..40bd37826 100644
--- a/stdlib/source/spec/lux/abstract/apply.lux
+++ b/stdlib/source/spec/lux/abstract/apply.lux
@@ -18,7 +18,7 @@
(def: (identity injection comparison (^open "_//."))
(All [f] (-> (Injection f) (Comparison f) (Apply f) Test))
(do {! random.monad}
- [sample (:: ! map injection random.nat)]
+ [sample (\ ! map injection random.nat)]
(_.test "Identity."
((comparison n.=)
(_//apply (injection function.identity) sample)
@@ -28,7 +28,7 @@
(All [f] (-> (Injection f) (Comparison f) (Apply f) Test))
(do {! random.monad}
[sample random.nat
- increase (:: ! map n.+ random.nat)]
+ increase (\ ! map n.+ random.nat)]
(_.test "Homomorphism."
((comparison n.=)
(_//apply (injection increase) (injection sample))
@@ -38,7 +38,7 @@
(All [f] (-> (Injection f) (Comparison f) (Apply f) Test))
(do {! random.monad}
[sample random.nat
- increase (:: ! map n.+ random.nat)]
+ increase (\ ! map n.+ random.nat)]
(_.test "Interchange."
((comparison n.=)
(_//apply (injection increase) (injection sample))
@@ -48,8 +48,8 @@
(All [f] (-> (Injection f) (Comparison f) (Apply f) Test))
(do {! random.monad}
[sample random.nat
- increase (:: ! map n.+ random.nat)
- decrease (:: ! map n.- random.nat)]
+ increase (\ ! map n.+ random.nat)
+ decrease (\ ! map n.- random.nat)]
(_.test "Composition."
((comparison n.=)
(_$ _//apply
diff --git a/stdlib/source/spec/lux/abstract/comonad.lux b/stdlib/source/spec/lux/abstract/comonad.lux
index a45c89e26..ed56d5787 100644
--- a/stdlib/source/spec/lux/abstract/comonad.lux
+++ b/stdlib/source/spec/lux/abstract/comonad.lux
@@ -17,9 +17,9 @@
(All [f] (-> (Injection f) (CoMonad f) Test))
(do {! random.monad}
[sample random.nat
- morphism (:: ! map (function (_ diff)
- (|>> _//unwrap (n.+ diff)))
- random.nat)
+ morphism (\ ! map (function (_ diff)
+ (|>> _//unwrap (n.+ diff)))
+ random.nat)
#let [start (injection sample)]]
(_.test "Left identity."
(n.= (morphism start)
@@ -39,12 +39,12 @@
(All [f] (-> (Injection f) (Comparison f) (CoMonad f) Test))
(do {! random.monad}
[sample random.nat
- increase (:: ! map (function (_ diff)
- (|>> _//unwrap (n.+ diff)))
- random.nat)
- decrease (:: ! map (function (_ diff)
- (|>> _//unwrap(n.- diff)))
- random.nat)
+ increase (\ ! map (function (_ diff)
+ (|>> _//unwrap (n.+ diff)))
+ random.nat)
+ decrease (\ ! map (function (_ diff)
+ (|>> _//unwrap(n.- diff)))
+ random.nat)
#let [start (injection sample)
== (comparison n.=)]]
(_.test "Associativity."
diff --git a/stdlib/source/spec/lux/abstract/functor.lux b/stdlib/source/spec/lux/abstract/functor.lux
index b237a388e..70206e9bb 100644
--- a/stdlib/source/spec/lux/abstract/functor.lux
+++ b/stdlib/source/spec/lux/abstract/functor.lux
@@ -25,7 +25,7 @@
(def: (identity injection comparison (^open "@//."))
(All [f] (-> (Injection f) (Comparison f) (Functor f) Test))
(do {! random.monad}
- [sample (:: ! map injection random.nat)]
+ [sample (\ ! map injection random.nat)]
(_.test "Identity."
((comparison n.=)
(@//map function.identity sample)
@@ -35,7 +35,7 @@
(All [f] (-> (Injection f) (Comparison f) (Functor f) Test))
(do {! random.monad}
[sample random.nat
- increase (:: ! map n.+ random.nat)]
+ increase (\ ! map n.+ random.nat)]
(_.test "Homomorphism."
((comparison n.=)
(@//map increase (injection sample))
@@ -44,9 +44,9 @@
(def: (composition injection comparison (^open "@//."))
(All [f] (-> (Injection f) (Comparison f) (Functor f) Test))
(do {! random.monad}
- [sample (:: ! map injection random.nat)
- increase (:: ! map n.+ random.nat)
- decrease (:: ! map n.- random.nat)]
+ [sample (\ ! map injection random.nat)
+ increase (\ ! map n.+ random.nat)
+ decrease (\ ! map n.- random.nat)]
(_.test "Composition."
((comparison n.=)
(|> sample (@//map increase) (@//map decrease))
diff --git a/stdlib/source/spec/lux/abstract/monad.lux b/stdlib/source/spec/lux/abstract/monad.lux
index 21ccafe75..8c1cf7f76 100644
--- a/stdlib/source/spec/lux/abstract/monad.lux
+++ b/stdlib/source/spec/lux/abstract/monad.lux
@@ -15,9 +15,9 @@
(All [f] (-> (Injection f) (Comparison f) (Monad f) Test))
(do {! random.monad}
[sample random.nat
- morphism (:: ! map (function (_ diff)
- (|>> (n.+ diff) _//wrap))
- random.nat)]
+ morphism (\ ! map (function (_ diff)
+ (|>> (n.+ diff) _//wrap))
+ random.nat)]
(_.test "Left identity."
((comparison n.=)
(|> (injection sample) (_//map morphism) _//join)
@@ -36,12 +36,12 @@
(All [f] (-> (Injection f) (Comparison f) (Monad f) Test))
(do {! random.monad}
[sample random.nat
- increase (:: ! map (function (_ diff)
- (|>> (n.+ diff) _//wrap))
- random.nat)
- decrease (:: ! map (function (_ diff)
- (|>> (n.- diff) _//wrap))
- random.nat)]
+ increase (\ ! map (function (_ diff)
+ (|>> (n.+ diff) _//wrap))
+ random.nat)
+ decrease (\ ! map (function (_ diff)
+ (|>> (n.- diff) _//wrap))
+ random.nat)]
(_.test "Associativity."
((comparison n.=)
(|> (injection sample) (_//map increase) _//join (_//map decrease) _//join)
diff --git a/stdlib/source/spec/lux/world/console.lux b/stdlib/source/spec/lux/world/console.lux
index 5257785f0..761376526 100644
--- a/stdlib/source/spec/lux/world/console.lux
+++ b/stdlib/source/spec/lux/world/console.lux
@@ -22,11 +22,11 @@
[message (random.ascii/alpha 10)]
(wrap (do promise.monad
[console (promise.future console)
- ?read (!.use (:: console read) [])
- ?read-line (!.use (:: console read-line) [])
- ?write (!.use (:: console write) [message])
- ?close/good (!.use (:: console close) [])
- ?close/bad (!.use (:: console close) [])]
+ ?read (!.use (\ console read) [])
+ ?read-line (!.use (\ console read-line) [])
+ ?write (!.use (\ console write) [message])
+ ?close/good (!.use (\ console close) [])
+ ?close/bad (!.use (\ console close) [])]
($_ _.and'
(_.cover' [/.Can-Read]
(case [?read ?read-line]
diff --git a/stdlib/source/spec/lux/world/shell.lux b/stdlib/source/spec/lux/world/shell.lux
index badc674b6..27ccf321c 100644
--- a/stdlib/source/spec/lux/world/shell.lux
+++ b/stdlib/source/spec/lux/world/shell.lux
@@ -38,8 +38,8 @@
(def: (read-test expected process)
(-> Text (/.Process Promise) _.Assertion)
(do promise.monad
- [?read (!.use (:: process read) [])
- ?await (!.use (:: process await) [])]
+ [?read (!.use (\ process read) [])
+ ?await (!.use (\ process await) [])]
($_ _.and'
(_.cover' [/.Can-Read]
(case ?read
@@ -60,8 +60,8 @@
(def: (destroy-test process)
(-> (/.Process Promise) _.Assertion)
(do promise.monad
- [?destroy (!.use (:: process destroy) [])
- ?await (!.use (:: process await) [])]
+ [?destroy (!.use (\ process destroy) [])
+ ?await (!.use (\ process await) [])]
(_.cover' [/.Can-Destroy]
(and (case ?destroy
(#try.Success _)
@@ -82,10 +82,10 @@
(<| (_.with-cover [/.Shell /.Process])
(do {! random.monad}
[message (random.ascii/alpha 10)
- seconds (:: ! map (|>> (n.% 5) (n.+ 5)) random.nat)]
+ seconds (\ ! map (|>> (n.% 5) (n.+ 5)) random.nat)]
(wrap (do promise.monad
- [?echo (!.use (:: shell execute) (..echo! message))
- ?sleep (!.use (:: shell execute) (..sleep! seconds))]
+ [?echo (!.use (\ shell execute) (..echo! message))
+ ?sleep (!.use (\ shell execute) (..sleep! seconds))]
(case [?echo ?sleep]
[(#try.Success echo) (#try.Success sleep)]
($_ _.and'