aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/specification/lux/abstract/apply.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-08-23 02:30:53 -0400
committerEduardo Julian2021-08-23 02:30:53 -0400
commitec1f31b5a1492d5e0ab260397291d4449483bbd9 (patch)
treec730b4ca89af366779b0ad0f46fae705b5c2bcbc /stdlib/source/specification/lux/abstract/apply.lux
parent1ea83ecadccc5adee1bdb35bd11527c3982c015e (diff)
The Python compiler can now be compiled by the new JVM compiler.
Diffstat (limited to '')
-rw-r--r--stdlib/source/specification/lux/abstract/apply.lux25
1 files changed, 12 insertions, 13 deletions
diff --git a/stdlib/source/specification/lux/abstract/apply.lux b/stdlib/source/specification/lux/abstract/apply.lux
index 71df69a83..e857c81e5 100644
--- a/stdlib/source/specification/lux/abstract/apply.lux
+++ b/stdlib/source/specification/lux/abstract/apply.lux
@@ -21,7 +21,7 @@
[sample (\ ! map injection random.nat)]
(_.test "Identity."
((comparison n.=)
- (\apply (injection function.identity) sample)
+ (\on sample (injection function.identity))
sample))))
(def: (homomorphism injection comparison (^open "\."))
@@ -31,7 +31,7 @@
increase (\ ! map n.+ random.nat)]
(_.test "Homomorphism."
((comparison n.=)
- (\apply (injection increase) (injection sample))
+ (\on (injection sample) (injection increase))
(injection (increase sample))))))
(def: (interchange injection comparison (^open "\."))
@@ -41,8 +41,9 @@
increase (\ ! map n.+ random.nat)]
(_.test "Interchange."
((comparison n.=)
- (\apply (injection increase) (injection sample))
- (\apply (injection (function (_ f) (f sample))) (injection increase))))))
+ (\on (injection sample) (injection increase))
+ (\on (injection increase) (injection (: (-> (-> Nat Nat) Nat)
+ (function (_ f) (f sample)))))))))
(def: (composition injection comparison (^open "\."))
(All [f] (-> (Injection f) (Comparison f) (Apply f) Test))
@@ -52,15 +53,13 @@
decrease (\ ! map n.- random.nat)]
(_.test "Composition."
((comparison n.=)
- (_$ \apply
- (injection function.composite)
- (injection increase)
- (injection decrease)
- (injection sample))
- ($_ \apply
- (injection increase)
- (injection decrease)
- (injection sample))))))
+ (|> (injection function.composite)
+ (\on (injection increase))
+ (\on (injection decrease))
+ (\on (injection sample)))
+ (\on (\on (injection sample)
+ (injection increase))
+ (injection decrease))))))
(def: .public (spec injection comparison apply)
(All [f] (-> (Injection f) (Comparison f) (Apply f) Test))