diff options
author | Eduardo Julian | 2021-08-23 02:30:53 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-23 02:30:53 -0400 |
commit | ec1f31b5a1492d5e0ab260397291d4449483bbd9 (patch) | |
tree | c730b4ca89af366779b0ad0f46fae705b5c2bcbc /stdlib/source/specification/lux/abstract | |
parent | 1ea83ecadccc5adee1bdb35bd11527c3982c015e (diff) |
The Python compiler can now be compiled by the new JVM compiler.
Diffstat (limited to 'stdlib/source/specification/lux/abstract')
-rw-r--r-- | stdlib/source/specification/lux/abstract/apply.lux | 25 | ||||
-rw-r--r-- | stdlib/source/specification/lux/abstract/codec.lux | 2 | ||||
-rw-r--r-- | stdlib/source/specification/lux/abstract/mix.lux (renamed from stdlib/source/specification/lux/abstract/fold.lux) | 6 |
3 files changed, 16 insertions, 17 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)) diff --git a/stdlib/source/specification/lux/abstract/codec.lux b/stdlib/source/specification/lux/abstract/codec.lux index 3cbb712d2..1725bbc92 100644 --- a/stdlib/source/specification/lux/abstract/codec.lux +++ b/stdlib/source/specification/lux/abstract/codec.lux @@ -19,7 +19,7 @@ [expected generator] (_.for [/.Codec] (_.test "Isomorphism." - (case (|> expected @//encode @//decode) + (case (|> expected @//encoded @//decoded) (#try.Success actual) (@//= expected actual) diff --git a/stdlib/source/specification/lux/abstract/fold.lux b/stdlib/source/specification/lux/abstract/mix.lux index 6d3ad1f7e..1097ac37f 100644 --- a/stdlib/source/specification/lux/abstract/fold.lux +++ b/stdlib/source/specification/lux/abstract/mix.lux @@ -14,10 +14,10 @@ ["." /]]) (def: .public (spec injection comparison (^open "@//.")) - (All [f] (-> (Injection f) (Comparison f) (/.Fold f) Test)) + (All [f] (-> (Injection f) (Comparison f) (/.Mix f) Test)) (do random.monad [subject random.nat parameter random.nat] - (_.cover [/.Fold] - (n.= (@//fold n.+ parameter (injection subject)) + (_.cover [/.Mix] + (n.= (@//mix n.+ parameter (injection subject)) (n.+ parameter subject))))) |