diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/math.lux | 24 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/logic/fuzzy.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/modular.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/modulus.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/complex.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/frac.lux | 14 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/i16.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/i32.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/i64.lux | 18 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/i8.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/int.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/nat.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/ratio.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/lux/math/number/rev.lux | 18 |
14 files changed, 69 insertions, 69 deletions
diff --git a/stdlib/source/test/lux/math.lux b/stdlib/source/test/lux/math.lux index 8aeb528f5..da5cfd057 100644 --- a/stdlib/source/test/lux/math.lux +++ b/stdlib/source/test/lux/math.lux @@ -37,7 +37,7 @@ ($_ _.and (do {! random.monad} [.let [~= (f.approximately? ..margin_of_error)] - angle (|> random.safe_frac (\ ! map (f.* /.tau)))] + angle (|> random.safe_frac (\ ! each (f.* /.tau)))] ($_ _.and (_.cover [/.sin /.asin] (trigonometric_symmetry /.sin /.asin angle)) @@ -61,7 +61,7 @@ (~= (f./ +2.0 /.tau) /.pi)) )) (do {! random.monad} - [sample (|> random.safe_frac (\ ! map (f.* +1000.0)))] + [sample (|> random.safe_frac (\ ! each (f.* +1000.0)))] ($_ _.and (_.cover [/.ceil] (let [ceil'd (/.ceil sample)] @@ -91,8 +91,8 @@ )) (do {! random.monad} [.let [~= (f.approximately? ..margin_of_error)] - sample (\ ! map (f.* +10.0) random.safe_frac) - power (\ ! map (|>> (n.% 10) ++ n.frac) random.nat)] + sample (\ ! each (f.* +10.0) random.safe_frac) + power (\ ! each (|>> (n.% 10) ++ n.frac) random.nat)] ($_ _.and (_.cover [/.exp /.log] (|> sample /.exp /.log (f.approximately? +0.000000000000001 sample))) @@ -107,9 +107,9 @@ )) (do {! random.monad} [.let [~= (f.approximately? ..margin_of_error)] - angle (\ ! map (f.* /.tau) random.safe_frac) - sample (\ ! map f.abs random.safe_frac) - big (\ ! map (f.* +1,000,000,000.00) random.safe_frac)] + angle (\ ! each (f.* /.tau) random.safe_frac) + sample (\ ! each f.abs random.safe_frac) + big (\ ! each (f.* +1,000,000,000.00) random.safe_frac)] (template.let [(odd! <function>) [(_.cover [<function>] (~= (f.opposite (<function> angle)) @@ -137,8 +137,8 @@ (inverse! /.atanh /.acoth big) ))) (do {! random.monad} - [x (\ ! map (|>> (f.* +10.0) f.abs) random.safe_frac) - y (\ ! map (|>> (f.* +10.0) f.abs) random.safe_frac)] + [x (\ ! each (|>> (f.* +10.0) f.abs) random.safe_frac) + y (\ ! each (|>> (f.* +10.0) f.abs) random.safe_frac)] (_.cover [/.hypotenuse] (let [h (/.hypotenuse x y)] (and (f.>= x h) @@ -146,8 +146,8 @@ (do {! random.monad} [.let [~= (f.approximately? ..margin_of_error) tau/4 (f./ +4.0 /.tau)] - x (\ ! map (f.* tau/4) random.safe_frac) - y (\ ! map (f.* tau/4) random.safe_frac)] + x (\ ! each (f.* tau/4) random.safe_frac) + y (\ ! each (f.* tau/4) random.safe_frac)] (_.cover [/.atan/2] (let [expected (/.atan/2 x y) actual (if (f.> +0.0 x) @@ -160,7 +160,7 @@ (~= (f.opposite tau/4) (/.atan/2 +0.0 (f.opposite (f.abs y)))) (f.not_a_number? (/.atan/2 +0.0 +0.0)))))) (do {! random.monad} - [of (\ ! map (|>> (n.% 10) ++) random.nat)] + [of (\ ! each (|>> (n.% 10) ++) random.nat)] (_.cover [/.factorial] (and (n.= 1 (/.factorial 0)) (|> (/.factorial of) (n.% of) (n.= 0))))) diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux index 4b1a6919a..d8198d026 100644 --- a/stdlib/source/test/lux/math/logic/fuzzy.lux +++ b/stdlib/source/test/lux/math/logic/fuzzy.lux @@ -39,9 +39,9 @@ (do {! random.monad} [sample random.rev - threshold_0 (\ ! map (r.% .5) + threshold_0 (\ ! each (r.% .5) random.rev) - threshold_1 (\ ! map (|>> (r.% .5) (r.+ .5)) + threshold_1 (\ ! each (|>> (r.% .5) (r.+ .5)) random.rev) .let [bottom (r.min threshold_0 threshold_1) @@ -89,7 +89,7 @@ [bottom middle_bottom middle_top top] (|> random.rev (random.set r.hash 4) - (\ ! map (|>> set.list (list.sorted r.<))) + (\ ! each (|>> set.list (list.sorted r.<))) (random.one (function (_ thresholds) (case thresholds (^ (list threshold_0 threshold_1 threshold_2 threshold_3)) @@ -173,7 +173,7 @@ [bottom middle_bottom middle_top top] (|> random.rev (random.set r.hash 4) - (\ ! map (|>> set.list (list.sorted r.<))) + (\ ! each (|>> set.list (list.sorted r.<))) (random.one (function (_ thresholds) (case thresholds (^ (list threshold_0 threshold_1 threshold_2 threshold_3)) diff --git a/stdlib/source/test/lux/math/modular.lux b/stdlib/source/test/lux/math/modular.lux index ce10c6ca2..8d4e69ab7 100644 --- a/stdlib/source/test/lux/math/modular.lux +++ b/stdlib/source/test/lux/math/modular.lux @@ -30,7 +30,7 @@ (def: .public (random modulus) (All [%] (-> (//.Modulus %) (Random (/.Mod %)))) - (\ random.monad map + (\ random.monad each (/.modular modulus) random.int)) @@ -52,8 +52,8 @@ ($equivalence.spec /.equivalence (..random subject\\%))) (_.for [/.order /.<] ($order.spec /.order (..random subject\\%))) - (~~ (template [<compose> <monoid>] - [(_.for [<monoid> <compose>] + (~~ (template [<composite> <monoid>] + [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence (<monoid> subject\\%) (..random subject\\%)))] [/.+ /.addition] diff --git a/stdlib/source/test/lux/math/modulus.lux b/stdlib/source/test/lux/math/modulus.lux index ae3bbb8e1..54ceeac1d 100644 --- a/stdlib/source/test/lux/math/modulus.lux +++ b/stdlib/source/test/lux/math/modulus.lux @@ -28,7 +28,7 @@ (def: .public (random range) (Ex [%] (-> Int (Random (/.Modulus %)))) (|> random.int - (\ random.monad map (i.% range)) + (\ random.monad each (i.% range)) (random.one (|>> /.modulus try.maybe)))) (def: .public test diff --git a/stdlib/source/test/lux/math/number/complex.lux b/stdlib/source/test/lux/math/number/complex.lux index 70706538d..e73c363ba 100644 --- a/stdlib/source/test/lux/math/number/complex.lux +++ b/stdlib/source/test/lux/math/number/complex.lux @@ -28,7 +28,7 @@ (def: dimension (Random Frac) (do {! random.monad} - [factor (|> random.nat (\ ! map (|>> (n.% 1000) (n.max 1)))) + [factor (|> random.nat (\ ! each (|>> (n.% 1000) (n.max 1)))) measure (|> random.safe_frac (random.only (f.> +0.0)))] (in (f.* (|> factor .int int.frac) measure)))) @@ -42,7 +42,7 @@ (def: angle (Random /.Complex) - (\ random.monad map + (\ random.monad each (|>> (revised@ #/.real (f.% +1.0)) (revised@ #/.imaginary (f.% +1.0))) ..random)) @@ -260,11 +260,11 @@ Test (do {! random.monad} [sample ..random - degree (|> random.nat (\ ! map (|>> (n.max 1) (n.% 5))))] + degree (|> random.nat (\ ! each (|>> (n.max 1) (n.% 5))))] (_.cover [/.roots] (|> sample (/.roots degree) - (list\map (/.pow' (|> degree .int int.frac))) + (list\each (/.pow' (|> degree .int int.frac))) (list.every? (/.approximately? ..margin_of_error sample)))))) (def: .public test diff --git a/stdlib/source/test/lux/math/number/frac.lux b/stdlib/source/test/lux/math/number/frac.lux index 91f44f41b..7b11df2cb 100644 --- a/stdlib/source/test/lux/math/number/frac.lux +++ b/stdlib/source/test/lux/math/number/frac.lux @@ -26,7 +26,7 @@ (def: random (Random Frac) - (\ random.monad map (|>> (i.% +1,000,000) i.frac) random.int)) + (\ random.monad each (|>> (i.% +1,000,000) i.frac) random.int)) (def: constant Test @@ -52,7 +52,7 @@ Test (do {! random.monad} [sample ..random - shift (\ ! map /.abs ..random)] + shift (\ ! each /.abs ..random)] ($_ _.and (_.cover [/.negative?] (bit\= (/.negative? sample) @@ -77,15 +77,15 @@ Test ($_ _.and (do {! random.monad} - [expected (\ ! map (n.% 1,000,000) random.nat)] + [expected (\ ! each (n.% 1,000,000) random.nat)] (_.cover [/.nat] (|> expected n.frac /.nat (n.= expected)))) (do {! random.monad} - [expected (\ ! map (i.% +1,000,000) random.int)] + [expected (\ ! each (i.% +1,000,000) random.int)] (_.cover [/.int] (|> expected i.frac /.int (i.= expected)))) (do {! random.monad} - [expected (\ ! map (|>> (i64.left_shifted 52) .rev) + [expected (\ ! each (|>> (i64.left_shifted 52) .rev) random.nat)] (_.cover [/.rev] (|> expected r.frac /.rev (r.= expected)))) @@ -100,8 +100,8 @@ ($hash.spec /.hash random.frac)) (_.for [/.order /.<] ($order.spec /.order random.safe_frac)) - (~~ (template [<compose> <monoid>] - [(_.for [<monoid> <compose>] + (~~ (template [<composite> <monoid>] + [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence <monoid> ..random))] [/.+ /.addition] diff --git a/stdlib/source/test/lux/math/number/i16.lux b/stdlib/source/test/lux/math/number/i16.lux index 807a58886..fbb0b62b7 100644 --- a/stdlib/source/test/lux/math/number/i16.lux +++ b/stdlib/source/test/lux/math/number/i16.lux @@ -16,7 +16,7 @@ (def: .public random (Random /.I16) - (\ random.functor map /.i16 random.i64)) + (\ random.functor each /.i16 random.i64)) (def: .public test Test @@ -27,7 +27,7 @@ //i64.mask .int ++)] - expected (\ ! map (i.% limit) random.int)] + expected (\ ! each (i.% limit) random.int)] ($_ _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) diff --git a/stdlib/source/test/lux/math/number/i32.lux b/stdlib/source/test/lux/math/number/i32.lux index 06b2458e9..00a5daee6 100644 --- a/stdlib/source/test/lux/math/number/i32.lux +++ b/stdlib/source/test/lux/math/number/i32.lux @@ -16,7 +16,7 @@ (def: .public random (Random /.I32) - (\ random.functor map /.i32 random.i64)) + (\ random.functor each /.i32 random.i64)) (def: .public test Test @@ -27,7 +27,7 @@ //i64.mask .int ++)] - expected (\ ! map (i.% limit) random.int)] + expected (\ ! each (i.% limit) random.int)] ($_ _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) diff --git a/stdlib/source/test/lux/math/number/i64.lux b/stdlib/source/test/lux/math/number/i64.lux index 4692a646c..851da2db3 100644 --- a/stdlib/source/test/lux/math/number/i64.lux +++ b/stdlib/source/test/lux/math/number/i64.lux @@ -22,7 +22,7 @@ Test (do {! random.monad} [pattern random.nat - idx (\ ! map (n.% /.width) random.nat)] + idx (\ ! each (n.% /.width) random.nat)] ($_ _.and (_.cover [/.one? /.one] (if (/.one? idx pattern) @@ -48,7 +48,7 @@ [pattern random.nat] ($_ _.and (do ! - [idx (\ ! map (|>> (n.% (-- /.width)) ++) random.nat)] + [idx (\ ! each (|>> (n.% (-- /.width)) ++) random.nat)] (_.cover [/.left_shifted /.right_shifted] (let [nullity! (and (\= pattern (/.left_shifted 0 pattern)) @@ -74,7 +74,7 @@ (<| (_.for [/.Mask]) (do {! random.monad} [pattern random.nat - idx (\ ! map (n.% /.width) random.nat) + idx (\ ! each (n.% /.width) random.nat) signed random.int] ($_ _.and (_.cover [/.sign] @@ -98,9 +98,9 @@ empty! full!))) (do ! - [size (\ ! map (n.% /.width) random.nat) + [size (\ ! each (n.% /.width) random.nat) .let [spare (n.- size /.width)] - offset (\ ! map (n.% spare) random.nat)] + offset (\ ! each (n.% spare) random.nat)] (_.cover [/.region] (case size 0 (\= /.false (/.region offset size)) @@ -122,7 +122,7 @@ Test (_.for [/.Sub] (do {! random.monad} - [size (\ ! map (n.% /.width) random.nat)] + [size (\ ! each (n.% /.width) random.nat)] (case (/.sub size) #.None (_.cover [/.sub] @@ -134,11 +134,11 @@ /.mask .int ++)] - expected (\ ! map (i.% limit) random.int) + expected (\ ! each (i.% limit) random.int) .let [random (: (All [size] (-> (-> I64 (I64 size)) (Random (I64 size)))) (function (_ narrow) - (\ random.functor map narrow random.i64)))]] + (\ random.functor each narrow random.i64)))]] ($_ _.and ($equivalence.spec (\ sub &equivalence) (random (\ sub narrow))) (_.cover [/.sub] @@ -165,7 +165,7 @@ (_.for [.I64]) (do {! random.monad} [pattern random.nat - idx (\ ! map (n.% /.width) random.nat)] + idx (\ ! each (n.% /.width) random.nat)] ($_ _.and (_.cover [/.width /.bits_per_byte /.bytes_per_i64] (and (n.= /.bytes_per_i64 diff --git a/stdlib/source/test/lux/math/number/i8.lux b/stdlib/source/test/lux/math/number/i8.lux index 7d753733d..8a8e7f0f6 100644 --- a/stdlib/source/test/lux/math/number/i8.lux +++ b/stdlib/source/test/lux/math/number/i8.lux @@ -16,7 +16,7 @@ (def: .public random (Random /.I8) - (\ random.functor map /.i8 random.i64)) + (\ random.functor each /.i8 random.i64)) (def: .public test Test @@ -27,7 +27,7 @@ //i64.mask .int ++)] - expected (\ ! map (i.% limit) random.int)] + expected (\ ! each (i.% limit) random.int)] ($_ _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) diff --git a/stdlib/source/test/lux/math/number/int.lux b/stdlib/source/test/lux/math/number/int.lux index 3c7cb47be..be091eb18 100644 --- a/stdlib/source/test/lux/math/number/int.lux +++ b/stdlib/source/test/lux/math/number/int.lux @@ -36,8 +36,8 @@ ($enum.spec /.enum random.int)) (_.for [/.interval] ($interval.spec /.interval random.int)) - (~~ (template [<compose> <monoid>] - [(_.for [<monoid> <compose>] + (~~ (template [<composite> <monoid>] + [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence <monoid> random.int))] [/.+ /.addition] @@ -136,7 +136,7 @@ )) (do {! random.monad} [.let [random (|> random.int - (\ ! map (/.% +1,000)) + (\ ! each (/.% +1,000)) (random.only (|>> (/.= +0) not)))] left random right random] @@ -177,14 +177,14 @@ (and subtraction! inverse!)))) (do {! random.monad} - [expected (\ ! map (/.% +1,000,000) random.int) + [expected (\ ! each (/.% +1,000,000) random.int) sample random.int] (_.cover [/.frac] (and (|> expected /.frac f.int (/.= expected)) (f.number? (/.frac sample))))) (do {! random.monad} [pattern random.int - idx (\ ! map (n.% i64.width) random.nat)] + idx (\ ! each (n.% i64.width) random.nat)] (_.cover [/.right_shifted] (let [nullity! (/.= pattern (/.right_shifted 0 pattern)) diff --git a/stdlib/source/test/lux/math/number/nat.lux b/stdlib/source/test/lux/math/number/nat.lux index bf4a7eb40..d01260c09 100644 --- a/stdlib/source/test/lux/math/number/nat.lux +++ b/stdlib/source/test/lux/math/number/nat.lux @@ -34,8 +34,8 @@ ($enum.spec /.enum random.nat)) (_.for [/.interval] ($interval.spec /.interval random.nat)) - (~~ (template [<compose> <monoid>] - [(_.for [<monoid> <compose>] + (~~ (template [<composite> <monoid>] + [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence <monoid> random.nat))] [/.+ /.addition] @@ -104,7 +104,7 @@ (/.= rem (/.% left right))))) )) (do {! random.monad} - [.let [random (\ ! map (|>> (/.% 1,000) ++) random.nat)] + [.let [random (\ ! each (|>> (/.% 1,000) ++) random.nat)] left random right random] ($_ _.and @@ -121,7 +121,7 @@ (/.= 0 (/.% right lcm))))) )) (do {! random.monad} - [expected (\ ! map (/.% 1,000,000) random.nat) + [expected (\ ! each (/.% 1,000,000) random.nat) sample random.nat] (_.cover [/.frac] (and (|> expected /.frac f.nat (/.= expected)) diff --git a/stdlib/source/test/lux/math/number/ratio.lux b/stdlib/source/test/lux/math/number/ratio.lux index 27da768f8..916cb5197 100644 --- a/stdlib/source/test/lux/math/number/ratio.lux +++ b/stdlib/source/test/lux/math/number/ratio.lux @@ -22,7 +22,7 @@ (def: part (Random Nat) - (\ random.monad map + (\ random.monad each (|>> (n.% 1,000,000) (n.max 1)) random.nat)) @@ -43,8 +43,8 @@ ($equivalence.spec /.equivalence ..random)) (_.for [/.order /.<] ($order.spec /.order ..random)) - (~~ (template [<compose> <monoid>] - [(_.for [<monoid> <compose>] + (~~ (template [<composite> <monoid>] + [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence <monoid> ..random))] [/.+ /.addition] @@ -68,13 +68,13 @@ (let [only_numerator! (|> (/.ratio numerator) /.nat - (maybe\map (n\= numerator)) + (maybe\each (n\= numerator)) (maybe.else false)) denominator_1! (|> (/.ratio numerator 1) /.nat - (maybe\map (n\= numerator)) + (maybe\each (n\= numerator)) (maybe.else false)) with_denominator! diff --git a/stdlib/source/test/lux/math/number/rev.lux b/stdlib/source/test/lux/math/number/rev.lux index fdb68b72c..cde50ec02 100644 --- a/stdlib/source/test/lux/math/number/rev.lux +++ b/stdlib/source/test/lux/math/number/rev.lux @@ -36,8 +36,8 @@ ($enum.spec /.enum random.rev)) (_.for [/.interval] ($interval.spec /.interval random.rev)) - (~~ (template [<compose> <monoid>] - [(_.for [<monoid> <compose>] + (~~ (template [<composite> <monoid>] + [(_.for [<monoid> <composite>] ($monoid.spec /.equivalence <monoid> random.rev))] [/.+ /.addition] @@ -88,18 +88,18 @@ (and (/.< left (/.* left right)) (/.< right (/.* left right))))) (do {! random.monad} - [.let [dividend (\ ! map (i64.and (hex "FFFF")) + [.let [dividend (\ ! each (i64.and (hex "FFFF")) random.rev) - divisor (\ ! map (|>> (i64.and (hex "F")) - (i64.or (hex "1")) - (i64.right_rotated 8) - .rev) + divisor (\ ! each (|>> (i64.and (hex "F")) + (i64.or (hex "1")) + (i64.right_rotated 8) + .rev) random.nat)] dividend (random.only (/.> .0) dividend) divisor/0 divisor divisor/1 (random.only (|>> (/.= divisor/0) not) divisor) - scale (\ ! map (|>> (n.% 10) ++) + scale (\ ! each (|>> (n.% 10) ++) random.nat)] ($_ _.and (_.cover [/./] @@ -155,7 +155,7 @@ (/.= (/.reciprocal sample) (|> sample /.reciprocal .nat /.reciprocal .nat /.reciprocal)))) (do {! random.monad} - [expected (\ ! map (|>> f.abs (f.% +1.0)) + [expected (\ ! each (|>> f.abs (f.% +1.0)) random.safe_frac) sample random.rev] (_.cover [/.frac] |