aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/specification
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/specification')
-rw-r--r--stdlib/source/specification/compositor/generation/case.lux10
-rw-r--r--stdlib/source/specification/lux/abstract/apply.lux25
-rw-r--r--stdlib/source/specification/lux/abstract/codec.lux2
-rw-r--r--stdlib/source/specification/lux/abstract/mix.lux (renamed from stdlib/source/specification/lux/abstract/fold.lux)6
-rw-r--r--stdlib/source/specification/lux/world/file.lux6
5 files changed, 24 insertions, 25 deletions
diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux
index 8508220ed..87fc1a5fc 100644
--- a/stdlib/source/specification/compositor/generation/case.lux
+++ b/stdlib/source/specification/compositor/generation/case.lux
@@ -13,7 +13,7 @@
["n" nat]
["f" frac]]
[collection
- ["." list ("#\." fold)]]]
+ ["." list ("#\." mix)]]]
[math
["r" random (#+ Random)]]
[tool
@@ -152,7 +152,7 @@
(function (_ head tail)
(synthesis.variant [0 #1 (synthesis.tuple (list head tail))])))
_list_ (: (-> (List Synthesis) Synthesis)
- (list\fold _item_ _end_))]
+ (list\mix _item_ _end_))]
(let [__tuple__ (: (-> (List Synthesis) Synthesis)
(|>> list.reversed _list_ [9 #0] synthesis.variant _code_))
__form__ (: (-> (List Synthesis) Synthesis)
@@ -169,9 +169,9 @@
(_code_ (synthesis.variant [7 #0 (synthesis.tuple (list (synthesis.text module)
(synthesis.text short)))]))))
__list__ (: (-> (List Synthesis) Synthesis)
- (list\fold (function (_ head tail)
- (__form__ (list (__tag__ ["" "Item"]) head tail)))
- (__tag__ ["" "End"])))
+ (list\mix (function (_ head tail)
+ (__form__ (list (__tag__ ["" "Item"]) head tail)))
+ (__tag__ ["" "End"])))
__apply__ (: (-> Synthesis Synthesis Synthesis)
(function (_ func arg)
(__form__ (list func arg))))]
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)))))
diff --git a/stdlib/source/specification/lux/world/file.lux b/stdlib/source/specification/lux/world/file.lux
index 0b5414dea..504990ea4 100644
--- a/stdlib/source/specification/lux/world/file.lux
+++ b/stdlib/source/specification/lux/world/file.lux
@@ -260,8 +260,8 @@
in
(do {! async.monad}
[fs (async.future fs)
- make_file!/0 (/.make_file ! fs (utf8\encode file/0) file/0)
- make_file!/1 (/.make_file ! fs (utf8\encode file/0) file/0)])
+ make_file!/0 (/.make_file ! fs (utf8\encoded file/0) file/0)
+ make_file!/1 (/.make_file ! fs (utf8\encoded file/0) file/0)])
($_ _.and'
(_.cover' [/.make_file]
(case make_file!/0
@@ -298,7 +298,7 @@
pre_dir/0 (\ fs directory? dir)
pre_dir/1 (/.exists? ! fs dir)
- made_file? (/.make_file ! fs (utf8\encode file) file)
+ made_file? (/.make_file ! fs (utf8\encoded file) file)
made_dir? (\ fs make_directory dir)
post_file/0 (\ fs file? file)