diff options
Diffstat (limited to 'stdlib/source/test')
141 files changed, 482 insertions, 482 deletions
diff --git a/stdlib/source/test/aedifex/cache.lux b/stdlib/source/test/aedifex/cache.lux index 748af575a..7bd36499b 100644 --- a/stdlib/source/test/aedifex/cache.lux +++ b/stdlib/source/test/aedifex/cache.lux @@ -63,13 +63,13 @@ (def: content (Random Binary) - (do {! random.monad} + (do [! random.monad] [content_size (\ ! each (n.% 100) random.nat)] (_binary.random content_size))) (def: package (Random [Dependency Package]) - (do {! random.monad} + (do [! random.monad] [[identity profile pom] ..profile type ..type content ..content] @@ -79,7 +79,7 @@ (def: resolution (Random Resolution) - (do {! random.monad} + (do [! random.monad] [[main_dependency main_package] ..package dependencies (|> (//package.dependencies main_package) (\ try.monad each set.list) @@ -100,7 +100,7 @@ (def: singular Test - (do {! random.monad} + (do [! random.monad] [[dependency expected_package] ..package home (random.ascii/alpha 5) working_directory (random.ascii/alpha 5) @@ -121,7 +121,7 @@ (def: plural Test - (do {! random.monad} + (do [! random.monad] [expected ..resolution home (random.ascii/alpha 5) working_directory (random.ascii/alpha 5) diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux index 894e647be..71608e83d 100644 --- a/stdlib/source/test/aedifex/command/auto.lux +++ b/stdlib/source/test/aedifex/command/auto.lux @@ -52,7 +52,7 @@ (atom.atom 0))] [@runs (function (_ console program fs shell resolution profile) - (do {! async.monad} + (do [! async.monad] [[_ actual_runs] (async.future (atom.update! ++ @runs))] (if (n.= expected_runs actual_runs) (in (#try.Failure end_signal)) @@ -66,7 +66,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [end_signal (random.ascii/alpha 5) .let [/ (\ file.default separator) [fs watcher] (watch.mock /)] @@ -101,7 +101,7 @@ _ (\ fs write (binary.empty 0) dummy_path) .let [[@runs command] (..command expected_runs end_signal fs dummy_path)] _ (\ watcher poll [])] - (do {! async.monad} + (do [! async.monad] [no_dangling_process! (|> profile (with@ #///.compiler compiler) ((/.do! 1 watcher command) diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux index 3009e5011..cbdfdc929 100644 --- a/stdlib/source/test/aedifex/command/build.lux +++ b/stdlib/source/test/aedifex/command/build.lux @@ -139,7 +139,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [last_read (random.ascii/alpha 5) last_error (random.ascii/alpha 5) .let [fs (file.mock (\ file.default separator)) @@ -224,7 +224,7 @@ shell (|> (list expected/0 expected/1 expected/2) (..reader_shell <error?>) shell.async)] - (in (do {! async.monad} + (in (do [! async.monad] [verdict (do ///action.monad [process (shell [environment.empty working_directory "" (list "")]) _ (<log!> console process) diff --git a/stdlib/source/test/aedifex/command/clean.lux b/stdlib/source/test/aedifex/command/clean.lux index 7d7e613fe..c59b75719 100644 --- a/stdlib/source/test/aedifex/command/clean.lux +++ b/stdlib/source/test/aedifex/command/clean.lux @@ -42,7 +42,7 @@ (def: (files prefix) (-> Path (Random (List [Path Binary]))) - (do {! random.monad} + (do [! random.monad] [count (\ ! each (n.% 10) random.nat) names (random.set text.hash count ..node_name) contents (random.list count ($binary.random 100))] @@ -55,7 +55,7 @@ (def: (create_directory! fs path files) (-> (file.System Async) Path (List [Path Binary]) (Async (Try Any))) - (do {! (try.with async.monad)} + (do [! (try.with async.monad)] [_ (: (Async (Try Any)) (file.make_directories async.monad fs path)) _ (monad.each ! (..create_file! fs) files)] @@ -71,7 +71,7 @@ (def: (assets_exist? fs directory_path files) (-> (file.System Async) Path (List [Path Binary]) (Async (Try Bit))) - (do {! (try.with async.monad)} + (do [! (try.with async.monad)] [directory_exists? (..directory_exists? fs directory_path) files_exist? (: (Action (List Bit)) (|> files @@ -83,7 +83,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [context ..node_name target ..node_name sub ..node_name @@ -97,7 +97,7 @@ dummy @profile.random] (in (do async.monad [.let [console (@version.echo "")] - verdict (do {! (try.with async.monad)} + verdict (do [! (try.with async.monad)] [_ (..create_directory! fs target_path direct_files) _ (..create_directory! fs sub_path sub_files) context_exists!/pre (..directory_exists? fs context) diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux index 77af48126..93bf3de79 100644 --- a/stdlib/source/test/aedifex/command/deploy.lux +++ b/stdlib/source/test/aedifex/command/deploy.lux @@ -62,7 +62,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [[artifact expected_pom profile] (random.one (function (_ profile) (do maybe.monad @@ -77,8 +77,8 @@ $repository.empty) fs (file.mock (\ file.default separator)) program (program.async (program.mock environment.empty home working_directory))]] - (in (do {! async.monad} - [verdict (do {! ///action.monad} + (in (do [! async.monad] + [verdict (do [! ///action.monad] [logging (..execute! program repository fs artifact profile) expected_library (|> profile (value@ #///.sources) diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux index 76f8cf768..3fe787e35 100644 --- a/stdlib/source/test/aedifex/command/install.lux +++ b/stdlib/source/test/aedifex/command/install.lux @@ -63,7 +63,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [identity $artifact.random sample (\ ! each (with@ #///.identity (#.Some identity)) $profile.random) @@ -71,14 +71,14 @@ working_directory (random.ascii/alpha 5) .let [/ (\ file.default separator)]] ($_ _.and - (in (do {! async.monad} + (in (do [! async.monad] [.let [fs (file.mock /) program (program.async (program.mock environment.empty home working_directory)) artifact_path (///local.uri (value@ #///artifact.version identity) identity) library_path (format artifact_path ///artifact/extension.lux_library) pom_path (format artifact_path ///artifact/extension.pom)] - verdict (do {! ///action.monad} + verdict (do [! ///action.monad] [succeeded! (\ ! each (text\= /.success) (..execute! program fs sample)) library_exists! (|> library_path @@ -94,7 +94,7 @@ pom_exists!)))] (_.cover' [/.do! /.success] (try.else false verdict)))) - (in (do {! async.monad} + (in (do [! async.monad] [.let [fs (file.mock /) program (program.async (program.mock environment.empty home working_directory))] logging (..execute! program fs (with@ #///.identity #.None sample))] diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux index 1bac5cf69..be5c60598 100644 --- a/stdlib/source/test/aedifex/command/pom.lux +++ b/stdlib/source/test/aedifex/command/pom.lux @@ -36,7 +36,7 @@ (do random.monad [sample @profile.random .let [fs (file.mock (\ file.default separator))]] - (in (do {! async.monad} + (in (do [! async.monad] [.let [console (@version.echo "")] outcome (/.do! console fs sample)] (case outcome diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux index 0496428a6..6f04ef653 100644 --- a/stdlib/source/test/aedifex/command/test.lux +++ b/stdlib/source/test/aedifex/command/test.lux @@ -42,7 +42,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [test (random.ascii/alpha 5) target (random.ascii/alpha 5) home (random.ascii/alpha 5) diff --git a/stdlib/source/test/aedifex/dependency/deployment.lux b/stdlib/source/test/aedifex/dependency/deployment.lux index e9bcc67a4..8dfa5a853 100644 --- a/stdlib/source/test/aedifex/dependency/deployment.lux +++ b/stdlib/source/test/aedifex/dependency/deployment.lux @@ -146,11 +146,11 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [address (\ ! each (text.suffix uri.separator) (random.ascii/upper 10))] ($_ _.and - (do {! random.monad} + (do [! random.monad] [[dependency expected_artifact package] ..bundle .let [cache (: Cache (atom.atom (dictionary.empty text.hash))) @@ -163,7 +163,7 @@ (|> ?outcome (try\each (verify_one 1 address package cache expected_artifact)) (try.else false)))))) - (do {! random.monad} + (do [! random.monad] [.let [hash (: (Hash [Dependency Artifact Package]) (\ hash.functor each (|>> product.right product.left product.left) text.hash))] diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux index 79e0bde5b..7297b99ee 100644 --- a/stdlib/source/test/aedifex/dependency/resolution.lux +++ b/stdlib/source/test/aedifex/dependency/resolution.lux @@ -50,7 +50,7 @@ (def: random (Random /.Resolution) - (do {! random.monad} + (do [! random.monad] [artifact $///artifact.random [_ package] $///package.random] (in (dictionary.has [#///dependency.artifact artifact @@ -246,7 +246,7 @@ (def: one Test - (do {! random.monad} + (do [! random.monad] [expected_artifact $///artifact.random [_ expected_package] $///package.random [_ dummy_package] (random.only (|>> product.right @@ -291,7 +291,7 @@ (def: any Test - (do {! random.monad} + (do [! random.monad] [expected_artifact $///artifact.random [_ expected_package] $///package.random [_ dummy_package] (random.only (|>> product.right @@ -399,7 +399,7 @@ (def: all Test - (do {! random.monad} + (do [! random.monad] [[dependee_artifact depender_artifact ignored_artifact] ..artifacts [[dependee depender ignored] diff --git a/stdlib/source/test/aedifex/hash.lux b/stdlib/source/test/aedifex/hash.lux index 45e693c07..94608cf7b 100644 --- a/stdlib/source/test/aedifex/hash.lux +++ b/stdlib/source/test/aedifex/hash.lux @@ -29,7 +29,7 @@ (All (_ h) (-> (-> Binary (/.Hash h)) (Random (/.Hash h)))) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 100) random.nat)] (\ ! each hash (_binary.random size)))) diff --git a/stdlib/source/test/aedifex/input.lux b/stdlib/source/test/aedifex/input.lux index eef2673f8..b725272e9 100644 --- a/stdlib/source/test/aedifex/input.lux +++ b/stdlib/source/test/aedifex/input.lux @@ -44,7 +44,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (with@ #//.parents (list)) $profile.random) .let [fs (: (file.System Async) (file.mock (\ file.default separator)))]] diff --git a/stdlib/source/test/aedifex/local.lux b/stdlib/source/test/aedifex/local.lux index 33c27fba7..8a6de8dcd 100644 --- a/stdlib/source/test/aedifex/local.lux +++ b/stdlib/source/test/aedifex/local.lux @@ -18,7 +18,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [sample @artifact.random] ($_ _.and (_.cover [/.repository /.uri] diff --git a/stdlib/source/test/aedifex/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux index 1d6aae530..544da4d3c 100644 --- a/stdlib/source/test/aedifex/metadata/artifact.lux +++ b/stdlib/source/test/aedifex/metadata/artifact.lux @@ -47,7 +47,7 @@ (random.ascii/alpha 5) (random.ascii/alpha 5) (random.list 5 (random.ascii/alpha 5)) - (do {! random.monad} + (do [! random.monad] [year (\ ! each (|>> (n.% 9,000) (n.+ 1,000) .int) random.nat) month (\ ! each (|>> (n.% 12) (n.+ 1)) random.nat) day_of_month (\ ! each (|>> (n.% 28) (n.+ 1)) random.nat) diff --git a/stdlib/source/test/aedifex/metadata/snapshot.lux b/stdlib/source/test/aedifex/metadata/snapshot.lux index a8d518aac..2c4866c2c 100644 --- a/stdlib/source/test/aedifex/metadata/snapshot.lux +++ b/stdlib/source/test/aedifex/metadata/snapshot.lux @@ -51,7 +51,7 @@ (def: random_instant (Random Instant) - (do {! random.monad} + (do [! random.monad] [year (\ ! each (|>> (n.% 9,000) (n.+ 1,000) .int) random.nat) month (\ ! each (|>> (n.% 12) (n.+ 1)) random.nat) day_of_month (\ ! each (|>> (n.% 28) (n.+ 1)) random.nat) diff --git a/stdlib/source/test/aedifex/package.lux b/stdlib/source/test/aedifex/package.lux index 8bd1d6fde..a7bc7d00a 100644 --- a/stdlib/source/test/aedifex/package.lux +++ b/stdlib/source/test/aedifex/package.lux @@ -42,7 +42,7 @@ (def: .public random (Random [//.Profile /.Package]) - (do {! random.monad} + (do [! random.monad] [content_size (\ ! each (n.% 100) random.nat) content ($binary.random content_size) [profile pom] (random.one (function (_ profile) @@ -57,7 +57,7 @@ Test (<| (_.covering /._) (_.for [/.Package]) - (do {! random.monad} + (do [! random.monad] [[profile package] ..random] ($_ _.and (_.for [/.equivalence] diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux index cb72c3726..1d8c6c1b4 100644 --- a/stdlib/source/test/aedifex/parser.lux +++ b/stdlib/source/test/aedifex/parser.lux @@ -39,7 +39,7 @@ (def: (list_of random) (All (_ a) (-> (Random a) (Random (List a)))) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 5) random.nat)] (random.list size random))) diff --git a/stdlib/source/test/aedifex/profile.lux b/stdlib/source/test/aedifex/profile.lux index 48f28903e..728971bbf 100644 --- a/stdlib/source/test/aedifex/profile.lux +++ b/stdlib/source/test/aedifex/profile.lux @@ -73,7 +73,7 @@ (def: (list_of random) (All (_ a) (-> (Random a) (Random (List a)))) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 5) random.nat)] (random.list size random))) diff --git a/stdlib/source/test/aedifex/repository/local.lux b/stdlib/source/test/aedifex/repository/local.lux index eb7b9777d..135e10867 100644 --- a/stdlib/source/test/aedifex/repository/local.lux +++ b/stdlib/source/test/aedifex/repository/local.lux @@ -26,7 +26,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [/ (random.ascii/upper 1) home (random.ascii/lower 10) working_directory (random.ascii/lower 10) diff --git a/stdlib/source/test/aedifex/repository/remote.lux b/stdlib/source/test/aedifex/repository/remote.lux index a38e68104..dfdbe03c5 100644 --- a/stdlib/source/test/aedifex/repository/remote.lux +++ b/stdlib/source/test/aedifex/repository/remote.lux @@ -83,7 +83,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [address (random.ascii/upper 10) uri (random.ascii/lower 10) diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 25e19caa8..9e353a1c3 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -478,7 +478,7 @@ (def: for_type Test - (do {! random.monad} + (do [! random.monad] [expected random.nat expected_left random.nat @@ -631,7 +631,7 @@ (_.cover [/.template:] (n.= (n.+ left right) (!n/+ left right)))) - (do {! random.monad} + (do [! random.monad] [sample (\ ! each (n.% 5) random.nat)] (_.cover [/.^template] (case sample @@ -912,7 +912,7 @@ (def: for_case Test - (do {! random.monad} + (do [! random.monad] [expected_nat (\ ! each (n.% 1) random.nat) expected_int (\ ! each (i.% +1) random.int) expected_rev (random.either (in .5) diff --git a/stdlib/source/test/lux/abstract/interval.lux b/stdlib/source/test/lux/abstract/interval.lux index d38bcac05..1891be079 100644 --- a/stdlib/source/test/lux/abstract/interval.lux +++ b/stdlib/source/test/lux/abstract/interval.lux @@ -137,7 +137,7 @@ (def: location Test - (do {! random.monad} + (do [! random.monad] [[l m r] (|> (random.set n.hash 3 random.nat) (\ ! each (|>> set.list (list.sorted n.<) @@ -159,7 +159,7 @@ (def: touch Test - (do {! random.monad} + (do [! random.monad] [[b t1 t2] (|> (random.set n.hash 3 random.nat) (\ ! each (|>> set.list (list.sorted n.<) @@ -185,7 +185,7 @@ (def: nested Test - (do {! random.monad} + (do [! random.monad] [some_interval ..interval [x0 x1 x2 x3] (|> (random.set n.hash 4 random.nat) (\ ! each (|>> set.list @@ -218,7 +218,7 @@ (def: overlap Test - (do {! random.monad} + (do [! random.monad] [some_interval ..interval [x0 x1 x2 x3] (|> (random.set n.hash 4 random.nat) (\ ! each (|>> set.list diff --git a/stdlib/source/test/lux/abstract/predicate.lux b/stdlib/source/test/lux/abstract/predicate.lux index 4f313cd44..55801fb84 100644 --- a/stdlib/source/test/lux/abstract/predicate.lux +++ b/stdlib/source/test/lux/abstract/predicate.lux @@ -31,7 +31,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [sample random.nat samples (random.list 10 random.nat) .let [equivalence (: (Equivalence (/.Predicate Nat)) diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux index d7b0bec38..a33bc598b 100644 --- a/stdlib/source/test/lux/control/concurrency/actor.lux +++ b/stdlib/source/test/lux/control/concurrency/actor.lux @@ -49,7 +49,7 @@ (def: .public test Test - (do {! random.monad} + (do [! random.monad] [initial_state random.nat .let [as_mail (: (All (_ a) (-> (-> a a) (/.Mail a))) (function (_ transform) @@ -91,7 +91,7 @@ [actor (/.spawn! (: (/.Behavior Any Any) [#/.on_init (|>>) #/.on_mail (function (_ message state self) - (do {! async.monad} + (do [! async.monad] [outcome (message state self)] (case outcome (#try.Failure cause) @@ -208,7 +208,7 @@ (atom.atom row.empty))]] (in (do async.monad [agent (async.future - (do {! io.monad} + (do [! io.monad] [agent (/.actor {Nat 0}) _ (/.observe! (function (_ event stop) (function (_ events_seen self) diff --git a/stdlib/source/test/lux/control/concurrency/async.lux b/stdlib/source/test/lux/control/concurrency/async.lux index 5ea37b8be..ad1297161 100644 --- a/stdlib/source/test/lux/control/concurrency/async.lux +++ b/stdlib/source/test/lux/control/concurrency/async.lux @@ -53,7 +53,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [waiting_time (|> random.nat (\ ! each (|>> (n.% ..delay) (n.+ ..delay)))) expected random.nat dummy random.nat diff --git a/stdlib/source/test/lux/control/concurrency/frp.lux b/stdlib/source/test/lux/control/concurrency/frp.lux index 2d111453c..40c490233 100644 --- a/stdlib/source/test/lux/control/concurrency/frp.lux +++ b/stdlib/source/test/lux/control/concurrency/frp.lux @@ -52,7 +52,7 @@ 0 (do async.monad [_ (async.future (\ sink close))] (in #.End)) - _ (do {! async.monad} + _ (do [! async.monad] [event channel] (case event #.None @@ -66,7 +66,7 @@ Test (<| (_.covering /._) (let [(^open "list\.") (list.equivalence n.equivalence)] - (do {! random.monad} + (do [! random.monad] [inputs (random.list 5 random.nat) sample random.nat distint/0 random.nat @@ -137,13 +137,13 @@ (_.cover' [/.only] (list\= (list.only n.even? inputs) output)))) - (in (do {! async.monad} + (in (do [! async.monad] [.let [[?signal !signal] (: [(async.Async Any) (async.Resolver Any)] (async.async [])) sink (: (Atom (Row Nat)) (atom.atom row.empty))] _ (async.future (/.subscribe! (function (_ value) - (do {! io.monad} + (do [! io.monad] [current (atom.read! sink) _ (atom.update! (row.suffix value) sink)] (if (n.< (list.size inputs) @@ -192,7 +192,7 @@ [polling_delay (\ ! each (|>> (n.% 10) ++) random.nat) amount_of_polls (\ ! each (|>> (n.% 10) ++) random.nat)] ($_ _.and - (in (do {! async.monad} + (in (do [! async.monad] [actual (..take_amount amount_of_polls (/.poll polling_delay (: (IO Nat) (io.io sample)))) .let [correct_values! (list.every? (n.= sample) actual) @@ -202,7 +202,7 @@ (_.cover' [/.poll] (and correct_values! enough_polls!)))) - (in (do {! async.monad} + (in (do [! async.monad] [actual (..take_amount amount_of_polls (/.periodic polling_delay))] (_.cover' [/.periodic] (n.= amount_of_polls (list.size actual))))))) diff --git a/stdlib/source/test/lux/control/concurrency/semaphore.lux b/stdlib/source/test/lux/control/concurrency/semaphore.lux index 3ccf611a3..c93b51358 100644 --- a/stdlib/source/test/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/test/lux/control/concurrency/semaphore.lux @@ -38,7 +38,7 @@ Test (_.for [/.Semaphore] ($_ _.and - (do {! random.monad} + (do [! random.monad] [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1)))) .let [semaphore (/.semaphore initial_open_positions)]] (in (do async.monad @@ -50,10 +50,10 @@ #.None false))))) - (do {! random.monad} + (do [! random.monad] [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1)))) .let [semaphore (/.semaphore initial_open_positions)]] - (in (do {! async.monad} + (in (do [! async.monad] [_ (monad.each ! /.wait! (list.repeated initial_open_positions semaphore)) result (async.within ..delay (/.wait! semaphore))] (_.cover' [/.wait!] @@ -63,10 +63,10 @@ #.None true))))) - (do {! random.monad} + (do [! random.monad] [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1)))) .let [semaphore (/.semaphore initial_open_positions)]] - (in (do {! async.monad} + (in (do [! async.monad] [_ (monad.each ! /.wait! (list.repeated initial_open_positions semaphore)) .let [block (/.wait! semaphore)] result/0 (async.within ..delay block) @@ -79,7 +79,7 @@ _ false))))) - (do {! random.monad} + (do [! random.monad] [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1)))) .let [semaphore (/.semaphore initial_open_positions)]] (in (do async.monad @@ -97,7 +97,7 @@ Test (_.for [/.Mutex] ($_ _.and - (do {! random.monad} + (do [! random.monad] [repetitions (|> random.nat (\ ! each (|>> (n.% 100) (n.max 10)))) .let [resource (atom.atom "") expected_As (text.together (list.repeated repetitions "A")) @@ -106,7 +106,7 @@ processA (<| (/.synchronize! mutex) io.io async.future - (do {! io.monad} + (do [! io.monad] [_ (<| (monad.all !) (list.repeated repetitions) (atom.update! (|>> (format "A")) resource))] @@ -114,7 +114,7 @@ processB (<| (/.synchronize! mutex) io.io async.future - (do {! io.monad} + (do [! io.monad] [_ (<| (monad.all !) (list.repeated repetitions) (atom.update! (|>> (format "B")) resource))] @@ -154,11 +154,11 @@ _ false))) - (do {! random.monad} + (do [! random.monad] [limit (\ ! each (|>> (n.% 9) ++) random.nat) .let [barrier (/.barrier (maybe.trusted (/.limit limit))) resource (atom.atom "")]] - (in (do {! async.monad} + (in (do [! async.monad] [.let [suffix "_" expected_ending (|> suffix (list.repeated limit) diff --git a/stdlib/source/test/lux/control/concurrency/stm.lux b/stdlib/source/test/lux/control/concurrency/stm.lux index 5dee493c0..c2251e302 100644 --- a/stdlib/source/test/lux/control/concurrency/stm.lux +++ b/stdlib/source/test/lux/control/concurrency/stm.lux @@ -38,7 +38,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [dummy random.nat expected random.nat iterations_per_process (|> random.nat (\ ! each (n.% 100)))] @@ -92,7 +92,7 @@ (list expected (n.* 2 expected)) changes)))) (in (let [var (/.var 0)] - (do {! async.monad} + (do [! async.monad] [_ (|> (list.repeated iterations_per_process []) (list\each (function (_ _) (/.commit! (/.update ++ var)))) (monad.all !)) diff --git a/stdlib/source/test/lux/control/concurrency/thread.lux b/stdlib/source/test/lux/control/concurrency/thread.lux index 7d3fa5f26..50adc9255 100644 --- a/stdlib/source/test/lux/control/concurrency/thread.lux +++ b/stdlib/source/test/lux/control/concurrency/thread.lux @@ -23,7 +23,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [dummy random.nat expected random.nat delay (\ ! each (|>> (n.% 5) (n.+ 5)) diff --git a/stdlib/source/test/lux/control/continuation.lux b/stdlib/source/test/lux/control/continuation.lux index 9ad0d8445..ac433a867 100644 --- a/stdlib/source/test/lux/control/continuation.lux +++ b/stdlib/source/test/lux/control/continuation.lux @@ -48,7 +48,7 @@ (n.= sample (/.result (_\in sample)))) (_.cover [/.with_current] (n.= (n.* 2 sample) - (/.result (do {! /.monad} + (/.result (do [! /.monad] [value (/.with_current (function (_ k) (do ! @@ -76,7 +76,7 @@ (_\in #.End) (#.Item x xs') - (do {! /.monad} + (do [! /.monad] [output (/.shift (function (_ k) (do ! [tail (k xs')] diff --git a/stdlib/source/test/lux/control/exception.lux b/stdlib/source/test/lux/control/exception.lux index 6eb5052a7..234e4bf6c 100644 --- a/stdlib/source/test/lux/control/exception.lux +++ b/stdlib/source/test/lux/control/exception.lux @@ -25,7 +25,7 @@ (def: .public test Test - (do {! random.monad} + (do [! random.monad] [expected random.nat wrong (|> random.nat (random.only (|>> (n.= expected) not))) assertion_succeeded? random.bit diff --git a/stdlib/source/test/lux/control/function.lux b/stdlib/source/test/lux/control/function.lux index b522b3c67..ab003daf6 100644 --- a/stdlib/source/test/lux/control/function.lux +++ b/stdlib/source/test/lux/control/function.lux @@ -23,7 +23,7 @@ (def: .public test Test - (do {! random.monad} + (do [! random.monad] [expected random.nat f0 (\ ! each n.+ random.nat) f1 (\ ! each n.* random.nat) diff --git a/stdlib/source/test/lux/control/function/contract.lux b/stdlib/source/test/lux/control/function/contract.lux index c2352cb3d..c73abbcb1 100644 --- a/stdlib/source/test/lux/control/function/contract.lux +++ b/stdlib/source/test/lux/control/function/contract.lux @@ -19,7 +19,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [expected random.nat]) ($_ _.and (_.cover [/.pre /.pre_condition_failed] diff --git a/stdlib/source/test/lux/control/function/memo.lux b/stdlib/source/test/lux/control/function/memo.lux index ed8fdf167..71d9de075 100644 --- a/stdlib/source/test/lux/control/function/memo.lux +++ b/stdlib/source/test/lux/control/function/memo.lux @@ -57,7 +57,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [input (|> random.nat (\ ! each (|>> (n.% 5) (n.+ 21))))]) (_.for [/.Memo]) ($_ _.and diff --git a/stdlib/source/test/lux/control/function/mixin.lux b/stdlib/source/test/lux/control/function/mixin.lux index 7f6d5d2ca..ec52f3d55 100644 --- a/stdlib/source/test/lux/control/function/mixin.lux +++ b/stdlib/source/test/lux/control/function/mixin.lux @@ -24,7 +24,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [input (|> random.nat (\ ! each (|>> (n.% 6) (n.+ 20)))) dummy random.nat shift (|> random.nat (random.only (|>> (n.= dummy) not))) diff --git a/stdlib/source/test/lux/control/function/mutual.lux b/stdlib/source/test/lux/control/function/mutual.lux index 875c7eee5..549cb46b9 100644 --- a/stdlib/source/test/lux/control/function/mutual.lux +++ b/stdlib/source/test/lux/control/function/mutual.lux @@ -17,7 +17,7 @@ (def: test_let Test - (do {! random.monad} + (do [! random.monad] [sample (\ ! each (n.% 10) random.nat) .let [expected (n.even? sample)]] (<| (_.cover [/.let]) @@ -50,7 +50,7 @@ (def: test_def Test - (do {! random.monad} + (do [! random.monad] [sample (\ ! each (n.% 10) random.nat) .let [expected (n.even? sample)]] (<| (_.cover [/.def:]) diff --git a/stdlib/source/test/lux/control/parser.lux b/stdlib/source/test/lux/control/parser.lux index e62ad68c9..13f1e2c02 100644 --- a/stdlib/source/test/lux/control/parser.lux +++ b/stdlib/source/test/lux/control/parser.lux @@ -88,7 +88,7 @@ (def: combinators_0 Test - (do {! random.monad} + (do [! random.monad] [expected0 random.nat variadic (\ ! each (|>> (n.max 1) (n.min 20)) random.nat) expected+ (random.list variadic random.nat) @@ -179,7 +179,7 @@ (def: combinators_1 Test - (do {! random.monad} + (do [! random.monad] [variadic (\ ! each (|>> (n.max 1) (n.min 20)) random.nat) times (\ ! each (n.% variadic) random.nat) expected random.nat diff --git a/stdlib/source/test/lux/control/parser/analysis.lux b/stdlib/source/test/lux/control/parser/analysis.lux index 2dd5dac5d..a3c722851 100644 --- a/stdlib/source/test/lux/control/parser/analysis.lux +++ b/stdlib/source/test/lux/control/parser/analysis.lux @@ -49,10 +49,10 @@ Test (<| (_.covering /._) (_.for [/.Parser]) - (do {! random.monad} + (do [! random.monad] [] (`` ($_ _.and - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> analysis.bit) random.bit)] (_.cover [/.result /.any] (|> (list expected) @@ -63,7 +63,7 @@ (#try.Failure _) false)))) (~~ (template [<query> <check> <random> <analysis> <=>] - [(do {! random.monad} + [(do [! random.monad] [expected <random>] (_.cover [<query>] (|> (list (<analysis> expected)) @@ -73,7 +73,7 @@ (#try.Failure _) false)))) - (do {! random.monad} + (do [! random.monad] [expected <random>] (_.cover [<check>] (|> (list (<analysis> expected)) @@ -90,7 +90,7 @@ [/.foreign /.foreign! random.nat analysis.variable/foreign n.=] [/.constant /.constant! ..constant analysis.constant name\=] )) - (do {! random.monad} + (do [! random.monad] [expected random.bit] (_.cover [/.tuple] (|> (list (analysis.tuple (list (analysis.bit expected)))) @@ -100,7 +100,7 @@ (#try.Failure _) false)))) - (do {! random.monad} + (do [! random.monad] [dummy random.bit] (_.cover [/.end?] (and (|> (/.result /.end? (list)) @@ -111,14 +111,14 @@ (in verdict)) (list (analysis.bit dummy))) (!expect (#try.Success #0)))))) - (do {! random.monad} + (do [! random.monad] [dummy random.bit] (_.cover [/.end!] (and (|> (/.result /.end! (list)) (!expect (#try.Success _))) (|> (/.result /.end! (list (analysis.bit dummy))) (!expect (#try.Failure _)))))) - (do {! random.monad} + (do [! random.monad] [expected random.bit] (_.cover [/.cannot_parse] (and (|> (list (analysis.bit expected)) @@ -135,7 +135,7 @@ (#try.Failure error) (exception.match? /.cannot_parse error)))))) - (do {! random.monad} + (do [! random.monad] [expected random.bit] (_.cover [/.unconsumed_input] (|> (list (analysis.bit expected) (analysis.bit expected)) diff --git a/stdlib/source/test/lux/control/parser/binary.lux b/stdlib/source/test/lux/control/parser/binary.lux index 38a89eed6..965c9abad 100644 --- a/stdlib/source/test/lux/control/parser/binary.lux +++ b/stdlib/source/test/lux/control/parser/binary.lux @@ -91,7 +91,7 @@ (Random Code) (random.rec (function (_ recur) - (let [random_sequence (do {! random.monad} + (let [random_sequence (do [! random.monad] [size (\ ! each (n.% 2) random.nat)] (random.list size recur))] ($_ random.and @@ -108,7 +108,7 @@ ..random_name random_sequence random_sequence - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 2) random.nat)] (random.list size (random.and recur recur))) ))))))) @@ -127,7 +127,7 @@ (<| (_.for [/.Size]) (`` ($_ _.and (~~ (template [<size> <parser> <format>] - [(do {! random.monad} + [(do [! random.monad] [expected (\ ! each (i64.and (i64.mask <size>)) random.nat)] (_.cover [<size> <parser> <format>] @@ -147,7 +147,7 @@ Test (`` ($_ _.and (~~ (template [<parser> <format>] - [(do {! random.monad} + [(do [! random.monad] [expected (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [<parser> <format>] (|> (format.result <format> expected) @@ -165,7 +165,7 @@ Test (`` ($_ _.and (~~ (template [<parser> <format>] - [(do {! random.monad} + [(do [! random.monad] [expected (random.ascii ..segment_size)] (_.cover [<parser> <format>] (|> (format.result <format> expected) @@ -184,7 +184,7 @@ Test (`` ($_ _.and (~~ (template [<parser> <format>] - [(do {! random.monad} + [(do [! random.monad] [expected (random.row ..segment_size random.nat)] (_.cover [<parser> <format>] (|> expected @@ -203,7 +203,7 @@ Test (`` ($_ _.and (~~ (template [<parser> <format> <random> <equivalence>] - [(do {! random.monad} + [(do [! random.monad] [expected <random>] (_.cover [<parser> <format>] (|> expected @@ -216,7 +216,7 @@ [/.nat format.nat random.nat n.equivalence] [/.int format.int random.int int.equivalence] [/.rev format.rev random.rev rev.equivalence])) - (do {! random.monad} + (do [! random.monad] [expected random.frac] (_.cover [/.frac format.frac] (|> expected @@ -226,7 +226,7 @@ (or (\ frac.equivalence = expected actual) (and (frac.not_a_number? expected) (frac.not_a_number? actual)))))))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> (i64.and (i64.mask /.size/8)) (n.max 2)) random.nat)] @@ -242,7 +242,7 @@ Test (`` ($_ _.and (~~ (template [<parser> <format> <random> <equivalence>] - [(do {! random.monad} + [(do [! random.monad] [expected <random>] (_.cover [<parser> <format>] (|> expected @@ -256,7 +256,7 @@ [/.type format.type random_type type.equivalence] )) (~~ (template [<parser_coverage> <parser> <coverage_format> <format> <random> <equivalence>] - [(do {! random.monad} + [(do [! random.monad] [expected <random>] (_.cover [<parser_coverage> <coverage_format>] (|> expected @@ -269,7 +269,7 @@ [/.list (/.list /.nat) format.list (format.list format.nat) (random.list ..segment_size random.nat) (list.equivalence n.equivalence)] [/.set (/.set n.hash /.nat) format.set (format.set format.nat) (random.set n.hash ..segment_size random.nat) set.equivalence] [/.name /.name format.name format.name ..random_name name.equivalence])) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (list.repeated ..segment_size) random.nat)] (_.cover [/.set_elements_are_not_unique] (|> expected @@ -277,7 +277,7 @@ (/.result (/.set n.hash /.nat)) (!expect (^multi (#try.Failure error) (exception.match? /.set_elements_are_not_unique error)))))) - (do {! random.monad} + (do [! random.monad] [expected (random.or random.bit random.nat)] (_.cover [/.or format.or] (|> expected @@ -288,7 +288,7 @@ (\ (sum.equivalence bit.equivalence n.equivalence) = expected actual)))))) - (do {! random.monad} + (do [! random.monad] [tag (\ ! each (|>> (i64.and (i64.mask /.size/8)) (n.max 2)) random.nat) @@ -300,7 +300,7 @@ (/.or /.bit /.nat))) (!expect (^multi (#try.Failure error) (exception.match? /.invalid_tag error)))))) - (do {! random.monad} + (do [! random.monad] [expected (random.list ..segment_size random.nat)] (_.cover [/.rec format.rec format.and format.any] (|> expected @@ -328,14 +328,14 @@ (|> (format.instance format.no_op) (/.result /.any) (!expect (#try.Success _)))) - (do {! random.monad} + (do [! random.monad] [data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.binary_was_not_fully_read] (|> data (/.result /.any) (!expect (^multi (#try.Failure error) (exception.match? /.binary_was_not_fully_read error)))))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.segment format.segment format.result] (|> expected @@ -343,7 +343,7 @@ (/.result (/.segment ..segment_size)) (!expect (^multi (#try.Success actual) (\ binary.equivalence = expected actual)))))) - (do {! random.monad} + (do [! random.monad] [data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.end?] (|> data @@ -354,7 +354,7 @@ (in (and (not pre) post)))) (!expect (#try.Success #1))))) - (do {! random.monad} + (do [! random.monad] [to_read (\ ! each (n.% (++ ..segment_size)) random.nat) data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.Offset /.offset] @@ -369,7 +369,7 @@ (n.= to_read offset) (n.= ..segment_size nothing_left))))) (!expect (#try.Success #1))))) - (do {! random.monad} + (do [! random.monad] [to_read (\ ! each (n.% (++ ..segment_size)) random.nat) data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.remaining] diff --git a/stdlib/source/test/lux/control/parser/cli.lux b/stdlib/source/test/lux/control/parser/cli.lux index df24f43ed..64b0d4425 100644 --- a/stdlib/source/test/lux/control/parser/cli.lux +++ b/stdlib/source/test/lux/control/parser/cli.lux @@ -30,7 +30,7 @@ Test (<| (_.covering /._) (_.for [/.Parser]) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each n\encoded random.nat) .let [random_dummy (random.only (|>> (text\= expected) not) (random.unicode 5))] diff --git a/stdlib/source/test/lux/control/parser/code.lux b/stdlib/source/test/lux/control/parser/code.lux index a30535def..b40394152 100644 --- a/stdlib/source/test/lux/control/parser/code.lux +++ b/stdlib/source/test/lux/control/parser/code.lux @@ -44,7 +44,7 @@ (<| (_.covering /._) (_.for [/.Parser]) (`` ($_ _.and - (do {! random.monad} + (do [! random.monad] [expected (\ ! each code.bit random.bit)] (_.cover [/.result] (and (|> (/.result /.any (list expected)) @@ -52,7 +52,7 @@ (|> (/.result /.any (list)) (!expect (#try.Failure _)))))) (~~ (template [<query> <check> <random> <code> <equivalence>] - [(do {! random.monad} + [(do [! random.monad] [expected <random> dummy (|> <random> (random.only (|>> (\ <equivalence> = expected) not)))] ($_ _.and @@ -80,7 +80,7 @@ [/.local_tag /.local_tag! (random.unicode 1) code.local_tag text.equivalence] )) (~~ (template [<query> <code>] - [(do {! random.monad} + [(do [! random.monad] [expected_left random.nat expected_right random.int] (_.cover [<query>] @@ -94,7 +94,7 @@ [/.form code.form] [/.tuple code.tuple] )) - (do {! random.monad} + (do [! random.monad] [expected_left random.nat expected_right random.int] (_.cover [/.record] @@ -104,7 +104,7 @@ (!expect (^multi (#try.Success [actual_left actual_right]) (and (\ nat.equivalence = expected_left actual_left) (\ int.equivalence = expected_right actual_right))))))) - (do {! random.monad} + (do [! random.monad] [expected_local random.nat expected_global random.int] (_.cover [/.local] @@ -114,7 +114,7 @@ (!expect (^multi (#try.Success [actual_local actual_global]) (and (\ nat.equivalence = expected_local actual_local) (\ int.equivalence = expected_global actual_global))))))) - (do {! random.monad} + (do [! random.monad] [dummy (\ ! each code.bit random.bit)] (_.cover [/.end?] (|> (/.result (do <>.monad @@ -126,14 +126,14 @@ (list dummy)) (!expect (^multi (#try.Success verdict) verdict))))) - (do {! random.monad} + (do [! random.monad] [dummy (\ ! each code.bit random.bit)] (_.cover [/.end!] (and (|> (/.result /.end! (list)) (!expect (#try.Success []))) (|> (/.result /.end! (list dummy)) (!expect (#try.Failure _)))))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each code.bit random.bit)] (_.cover [/.next] (|> (/.result (do <>.monad @@ -143,7 +143,7 @@ (same? pre post)))) (list expected)) (!expect (#try.Success _))))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each code.bit random.bit)] (_.cover [/.not] (and (|> (/.result (/.not /.nat) (list expected)) diff --git a/stdlib/source/test/lux/control/parser/json.lux b/stdlib/source/test/lux/control/parser/json.lux index 6710713bd..a2951dc23 100644 --- a/stdlib/source/test/lux/control/parser/json.lux +++ b/stdlib/source/test/lux/control/parser/json.lux @@ -45,7 +45,7 @@ (<| (_.covering /._) (_.for [/.Parser]) (`` ($_ _.and - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> #json.String) (random.unicode 1))] (_.cover [/.result /.any] (|> (/.result /.any expected) @@ -55,7 +55,7 @@ (|> (/.result /.null #json.Null) (!expect (#try.Success _)))) (~~ (template [<query> <test> <check> <random> <json> <equivalence>] - [(do {! random.monad} + [(do [! random.monad] [expected <random> dummy (|> <random> (random.only (|>> (\ <equivalence> = expected) not)))] ($_ _.and @@ -78,21 +78,21 @@ [/.number /.number? /.number! ..safe_frac #json.Number frac.equivalence] [/.string /.string? /.string! (random.unicode 1) #json.String text.equivalence] )) - (do {! random.monad} + (do [! random.monad] [expected (random.unicode 1) dummy random.bit] (_.cover [/.unexpected_value] (|> (/.result /.string (#json.Boolean dummy)) (!expect (^multi (#try.Failure error) (exception.match? /.unexpected_value error)))))) - (do {! random.monad} + (do [! random.monad] [expected (random.unicode 1) dummy (|> (random.unicode 1) (random.only (|>> (\ text.equivalence = expected) not)))] (_.cover [/.value_mismatch] (|> (/.result (/.string! expected) (#json.String dummy)) (!expect (^multi (#try.Failure error) (exception.match? /.value_mismatch error)))))) - (do {! random.monad} + (do [! random.monad] [expected (random.unicode 1)] (_.cover [/.nullable] (and (|> (/.result (/.nullable /.string) #json.Null) @@ -101,7 +101,7 @@ (|> (/.result (/.nullable /.string) (#json.String expected)) (!expect (^multi (#try.Success actual) (\ (maybe.equivalence text.equivalence) = (#.Some expected) actual))))))) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 10) random.nat) expected (|> (random.unicode 1) (random.list size) @@ -111,7 +111,7 @@ (#json.Array (row\each (|>> #json.String) expected))) (!expect (^multi (#try.Success actual) (\ (row.equivalence text.equivalence) = expected (row.of_list actual))))))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> #json.String) (random.unicode 1))] (_.cover [/.unconsumed_input] (|> (/.result (/.array /.any) (#json.Array (row expected expected))) @@ -121,7 +121,7 @@ (|> (/.result (/.array /.any) (#json.Array (row))) (!expect (^multi (#try.Failure error) (exception.match? /.empty_input error))))) - (do {! random.monad} + (do [! random.monad] [expected_boolean random.bit expected_number ..safe_frac expected_string (random.unicode 1) @@ -146,7 +146,7 @@ (and (\ bit.equivalence = expected_boolean actual_boolean) (\ frac.equivalence = expected_number actual_number) (\ text.equivalence = expected_string actual_string))))))) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 10) random.nat) keys (random.list size (random.unicode 1)) values (random.list size (random.unicode 1)) diff --git a/stdlib/source/test/lux/control/parser/synthesis.lux b/stdlib/source/test/lux/control/parser/synthesis.lux index e47523481..ca405d495 100644 --- a/stdlib/source/test/lux/control/parser/synthesis.lux +++ b/stdlib/source/test/lux/control/parser/synthesis.lux @@ -52,7 +52,7 @@ (def: random_environment (Random (Environment Synthesis)) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 5) random.nat)] (|> ..random_variable (\ ! each (|>> synthesis.variable)) @@ -62,7 +62,7 @@ Test (`` ($_ _.and (~~ (template [<query> <check> <random> <synthesis> <equivalence>] - [(do {! random.monad} + [(do [! random.monad] [expected <random> dummy (|> <random> (random.only (|>> (\ <equivalence> = expected) not)))] ($_ _.and @@ -91,7 +91,7 @@ (def: complex Test ($_ _.and - (do {! random.monad} + (do [! random.monad] [expected_bit random.bit expected_i64 (\ ! each .i64 random.nat) expected_f64 random.safe_frac @@ -111,7 +111,7 @@ (list (synthesis.text expected_text))) (!expect (^multi (#try.Failure error) (exception.match? /.cannot_parse error))))))) - (do {! random.monad} + (do [! random.monad] [arity random.nat expected_environment ..random_environment expected_body (random.unicode 1)] @@ -127,7 +127,7 @@ (list (synthesis.text expected_body))) (!expect (^multi (#try.Failure error) (exception.match? /.cannot_parse error))))))) - (do {! random.monad} + (do [! random.monad] [arity random.nat expected_environment ..random_environment expected_body (random.unicode 1)] @@ -136,7 +136,7 @@ (list (synthesis.function/abstraction [expected_environment arity (synthesis.text expected_body)]))) (!expect (^multi (#try.Failure error) (exception.match? /.wrong_arity error)))))) - (do {! random.monad} + (do [! random.monad] [arity (\ ! each (|>> (n.% 10) ++) random.nat) expected_offset random.nat expected_inits (random.list arity random.bit) @@ -163,7 +163,7 @@ (<| (_.covering /._) (_.for [/.Parser]) ($_ _.and - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> synthesis.i64) random.nat)] (_.cover [/.result /.any] (|> (/.result /.any (list expected)) @@ -173,13 +173,13 @@ (|> (/.result /.any (list)) (!expect (^multi (#try.Failure error) (exception.match? /.empty_input error))))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> synthesis.i64) random.nat)] (_.cover [/.unconsumed_input] (|> (/.result /.any (list expected expected)) (!expect (^multi (#try.Failure error) (exception.match? /.unconsumed_input error)))))) - (do {! random.monad} + (do [! random.monad] [dummy (\ ! each (|>> synthesis.i64) random.nat)] (_.cover [/.end! /.expected_empty_input] (and (|> (/.result /.end! (list)) @@ -187,7 +187,7 @@ (|> (/.result /.end! (list dummy)) (!expect (^multi (#try.Failure error) (exception.match? /.expected_empty_input error))))))) - (do {! random.monad} + (do [! random.monad] [dummy (\ ! each (|>> synthesis.i64) random.nat)] (_.cover [/.end?] (and (|> (/.result /.end? (list)) diff --git a/stdlib/source/test/lux/control/parser/text.lux b/stdlib/source/test/lux/control/parser/text.lux index c3155c182..7207e4477 100644 --- a/stdlib/source/test/lux/control/parser/text.lux +++ b/stdlib/source/test/lux/control/parser/text.lux @@ -71,7 +71,7 @@ (def: character_classes Test ($_ _.and - (do {! random.monad} + (do [! random.monad] [offset (\ ! each (n.% 50) random.nat) range (\ ! each (|>> (n.% 50) (n.+ 10)) random.nat) .let [limit (n.+ offset range)] @@ -82,39 +82,39 @@ (_.cover [/.range] (and (..should_pass expected (/.range offset limit)) (..should_fail out_of_range (/.range offset limit))))) - (do {! random.monad} + (do [! random.monad] [expected (random.char unicode.ascii/upper) invalid (random.only (|>> (unicode/block.within? unicode/block.basic_latin/upper) not) (random.char unicode.character))] (_.cover [/.upper] (and (..should_pass (text.of_char expected) /.upper) (..should_fail (text.of_char invalid) /.upper)))) - (do {! random.monad} + (do [! random.monad] [expected (random.char unicode.ascii/lower) invalid (random.only (|>> (unicode/block.within? unicode/block.basic_latin/lower) not) (random.char unicode.character))] (_.cover [/.lower] (and (..should_pass (text.of_char expected) /.lower) (..should_fail (text.of_char invalid) /.lower)))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (n.% 10) random.nat) invalid (random.char (unicode.set [unicode/block.number_forms (list)]))] (_.cover [/.decimal] (and (..should_pass (\ n.decimal encoded expected) /.decimal) (..should_fail (text.of_char invalid) /.decimal)))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (n.% 8) random.nat) invalid (random.char (unicode.set [unicode/block.number_forms (list)]))] (_.cover [/.octal] (and (..should_pass (\ n.octal encoded expected) /.octal) (..should_fail (text.of_char invalid) /.octal)))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (n.% 16) random.nat) invalid (random.char (unicode.set [unicode/block.number_forms (list)]))] (_.cover [/.hexadecimal] (and (..should_pass (\ n.hex encoded expected) /.hexadecimal) (..should_fail (text.of_char invalid) /.hexadecimal)))) - (do {! random.monad} + (do [! random.monad] [expected (random.char unicode.ascii/alpha) invalid (random.only (function (_ char) (not (or (unicode/block.within? unicode/block.basic_latin/upper char) @@ -123,7 +123,7 @@ (_.cover [/.alpha] (and (..should_pass (text.of_char expected) /.alpha) (..should_fail (text.of_char invalid) /.alpha)))) - (do {! random.monad} + (do [! random.monad] [expected (random.char unicode.ascii/alpha_num) invalid (random.only (function (_ char) (not (or (unicode/block.within? unicode/block.basic_latin/upper char) @@ -133,7 +133,7 @@ (_.cover [/.alpha_num] (and (..should_pass (text.of_char expected) /.alpha_num) (..should_fail (text.of_char invalid) /.alpha_num)))) - (do {! random.monad} + (do [! random.monad] [expected ($_ random.either (in text.tab) (in text.vertical_tab) @@ -151,7 +151,7 @@ (_.cover [/.space] (and (..should_pass expected /.space) (..should_fail invalid /.space)))) - (do {! random.monad} + (do [! random.monad] [.let [num_options 3] options (|> (random.char unicode.character) (random.set n.hash num_options) @@ -177,7 +177,7 @@ (..should_fail' (text.of_char invalid) (/.one_of! options) /.character_should_be) ))) - (do {! random.monad} + (do [! random.monad] [.let [num_options 3] options (|> (random.char unicode.character) (random.set n.hash num_options) @@ -209,7 +209,7 @@ Test (let [octal! (/.one_of! "01234567")] ($_ _.and - (do {! random.monad} + (do [! random.monad] [left (\ ! each (|>> (n.% 8) (\ n.octal encoded)) random.nat) right (\ ! each (|>> (n.% 8) (\ n.octal encoded)) random.nat) .let [expected (format left right)] @@ -222,7 +222,7 @@ (..should_fail invalid (/.many /.octal)) (..should_pass! expected (/.many! octal!))))) - (do {! random.monad} + (do [! random.monad] [left (\ ! each (|>> (n.% 8) (\ n.octal encoded)) random.nat) right (\ ! each (|>> (n.% 8) (\ n.octal encoded)) random.nat) .let [expected (format left right)] @@ -237,7 +237,7 @@ (..should_pass! expected (/.some! octal!)) (..should_pass! "" (/.some! octal!))))) - (do {! random.monad} + (do [! random.monad] [.let [octal (\ ! each (|>> (n.% 8) (\ n.octal encoded)) random.nat)] first octal second octal @@ -250,7 +250,7 @@ (..should_pass! (format first second) (/.exactly! 2 octal!)) (..should_fail (format first second third) (/.exactly! 2 octal!)) (..should_fail (format first) (/.exactly! 2 octal!))))) - (do {! random.monad} + (do [! random.monad] [.let [octal (\ ! each (|>> (n.% 8) (\ n.octal encoded)) random.nat)] first octal second octal @@ -263,7 +263,7 @@ (..should_pass! (format first second) (/.at_most! 2 octal!)) (..should_pass! (format first) (/.at_most! 2 octal!)) (..should_fail (format first second third) (/.at_most! 2 octal!))))) - (do {! random.monad} + (do [! random.monad] [.let [octal (\ ! each (|>> (n.% 8) (\ n.octal encoded)) random.nat)] first octal second octal @@ -276,7 +276,7 @@ (..should_pass! (format first second) (/.at_least! 2 octal!)) (..should_pass! (format first second third) (/.at_least! 2 octal!)) (..should_fail (format first) (/.at_least! 2 octal!))))) - (do {! random.monad} + (do [! random.monad] [.let [octal (\ ! each (|>> (n.% 8) (\ n.octal encoded)) random.nat)] first octal second octal @@ -296,7 +296,7 @@ (<| (_.covering /._) (_.for [/.Parser]) ($_ _.and - (do {! random.monad} + (do [! random.monad] [sample (random.unicode 1)] (_.cover [/.result /.end!] (and (|> (/.result /.end! @@ -305,7 +305,7 @@ (|> (/.result /.end! sample) (!expect (#try.Failure _)))))) - (do {! random.monad} + (do [! random.monad] [.let [size 10] expected (random.unicode size) dummy (|> (random.unicode size) @@ -323,7 +323,7 @@ (/.result (/.slice /.any!)) (!expect (^multi (#try.Failure error) (exception.match? /.cannot_slice error))))) - (do {! random.monad} + (do [! random.monad] [expected (random.unicode 1)] (_.cover [/.any /.any!] (and (..should_pass expected /.any) @@ -331,7 +331,7 @@ (..should_pass! expected /.any!) (..should_fail "" /.any!)))) - (do {! random.monad} + (do [! random.monad] [expected (random.unicode 1)] (_.cover [/.next /.cannot_parse] (and (..should_pass expected (<>.before /.any /.next)) @@ -339,14 +339,14 @@ (/.result (<>.before /.any /.next)) (!expect (^multi (#try.Failure error) (exception.match? /.cannot_parse error))))))) - (do {! random.monad} + (do [! random.monad] [dummy (random.unicode 1)] (_.cover [/.unconsumed_input] (|> (format dummy dummy) (/.result /.any) (!expect (^multi (#try.Failure error) (exception.match? /.unconsumed_input error)))))) - (do {! random.monad} + (do [! random.monad] [sample (random.unicode 1)] (_.cover [/.Offset /.offset] (|> sample @@ -356,7 +356,7 @@ post /.offset] (in [pre post]))) (!expect (#try.Success [0 1]))))) - (do {! random.monad} + (do [! random.monad] [left (random.unicode 1) right (random.unicode 1) .let [input (format left right)]] @@ -370,7 +370,7 @@ (in (and (text\= input pre) (text\= right post))))) (!expect (#try.Success #1))))) - (do {! random.monad} + (do [! random.monad] [left (random.unicode 1) right (random.unicode 1) expected (random.only (|>> (text\= right) not) @@ -379,7 +379,7 @@ (|> (format left expected right) (/.result (/.enclosed [left right] (/.this expected))) (!expect (#try.Success _))))) - (do {! random.monad} + (do [! random.monad] [input (random.unicode 1) output (random.unicode 1)] (_.cover [/.local] @@ -388,14 +388,14 @@ [_ (/.local input (/.this input))] (/.this output))) (!expect (#try.Success _))))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> (n.% 8) (\ n.octal encoded)) random.nat)] (_.cover [/.then] (|> (list (code.text expected)) (<c>.result (/.then /.octal <c>.text)) (!expect (^multi (#try.Success actual) (text\= expected actual)))))) - (do {! random.monad} + (do [! random.monad] [invalid (random.ascii/upper 1) expected (random.only (|>> (unicode/block.within? unicode/block.basic_latin/upper) not) @@ -413,7 +413,7 @@ (/.result (/.not! upper!)) (!expect (^multi (#try.Failure error) (exception.match? /.expected_to_fail error))))))) - (do {! random.monad} + (do [! random.monad] [upper (random.ascii/upper 1) lower (random.ascii/lower 1) invalid (random.only (function (_ char) @@ -430,7 +430,7 @@ (..should_pass! (format upper lower) (/.and! upper! lower!)) (..should_fail (format (text.of_char invalid) lower) (/.and! upper! lower!)) (..should_fail (format upper (text.of_char invalid)) (/.and! upper! lower!))))) - (do {! random.monad} + (do [! random.monad] [expected (random.unicode 1) invalid (random.unicode 1)] (_.cover [/.satisfies /.character_does_not_satisfy_predicate] diff --git a/stdlib/source/test/lux/control/parser/tree.lux b/stdlib/source/test/lux/control/parser/tree.lux index 4c13753c8..21f048ffa 100644 --- a/stdlib/source/test/lux/control/parser/tree.lux +++ b/stdlib/source/test/lux/control/parser/tree.lux @@ -28,7 +28,7 @@ false)]) (template: (!cover <coverage> <parser> <sample>) - [(do {! random.monad} + [(do [! random.monad] [dummy random.nat expected (|> random.nat (random.only (|>> (n.= dummy) not)))] (_.cover <coverage> @@ -38,7 +38,7 @@ (n.= expected actual))))))]) (template: (!cover/2 <coverage> <parser> <sample0> <sample1>) - [(do {! random.monad} + [(do [! random.monad] [dummy random.nat expected (|> random.nat (random.only (|>> (n.= dummy) not)))] (_.cover <coverage> @@ -57,7 +57,7 @@ (!cover [/.result /.value] /.value (tree.leaf expected)) - (do {! random.monad} + (do [! random.monad] [expected random.nat] (_.cover [/.result'] (|> (/.result' /.value @@ -157,7 +157,7 @@ (tree.branch expected (list (tree.leaf dummy) (tree.leaf dummy)))) - (do {! random.monad} + (do [! random.monad] [dummy random.nat] (_.cover [/.cannot_move_further] (`` (and (~~ (template [<parser>] diff --git a/stdlib/source/test/lux/control/parser/type.lux b/stdlib/source/test/lux/control/parser/type.lux index 7d7d57b0c..af74b5851 100644 --- a/stdlib/source/test/lux/control/parser/type.lux +++ b/stdlib/source/test/lux/control/parser/type.lux @@ -37,7 +37,7 @@ (def: matches Test (<| (_.for [/.types_do_not_match]) - (do {! random.monad} + (do [! random.monad] [expected ..primitive dummy (random.only (|>> (type\= expected) not) ..primitive)]) @@ -72,7 +72,7 @@ (def: aggregate Test - (do {! random.monad} + (do [! random.monad] [expected_left ..primitive expected_middle ..primitive expected_right ..primitive] @@ -164,7 +164,7 @@ (def: polymorphic Test - (do {! random.monad} + (do [! random.monad] [not_polymorphic ..primitive expected_inputs (\ ! each (|>> (n.% 10) ++) random.nat)] ($_ _.and @@ -190,13 +190,13 @@ (<| (_.covering /._) (_.for [/.Parser]) ($_ _.and - (do {! random.monad} + (do [! random.monad] [expected ..primitive] (_.cover [/.result /.any] (|> (/.result /.any expected) (!expect (^multi (#try.Success actual) (type\= expected actual)))))) - (do {! random.monad} + (do [! random.monad] [expected ..primitive] (_.cover [/.next /.unconsumed_input] (and (|> (/.result (do //.monad @@ -209,7 +209,7 @@ (|> (/.result /.next expected) (!expect (^multi (#try.Failure error) (exception.match? /.unconsumed_input error))))))) - (do {! random.monad} + (do [! random.monad] [expected ..primitive] (_.cover [/.empty_input] (`` (and (~~ (template [<parser>] @@ -223,7 +223,7 @@ [/.any] [/.next] )))))) - (do {! random.monad} + (do [! random.monad] [expected ..primitive] (_.cover [/.Env /.env /.fresh] (|> (/.result (do //.monad @@ -233,7 +233,7 @@ expected) (!expect (^multi (#try.Success environment) (same? /.fresh environment)))))) - (do {! random.monad} + (do [! random.monad] [expected ..primitive dummy (random.only (|>> (type\= expected) not) ..primitive)] @@ -245,14 +245,14 @@ dummy) (!expect (^multi (#try.Success actual) (type\= expected actual)))))) - (do {! random.monad} + (do [! random.monad] [expected random.nat] (_.cover [/.existential /.not_existential] (|> (/.result /.existential (#.Ex expected)) (!expect (^multi (#try.Success actual) (n.= expected actual)))))) - (do {! random.monad} + (do [! random.monad] [expected_name (random.and (random.ascii/alpha_num 1) (random.ascii/alpha_num 1)) expected_type ..primitive] diff --git a/stdlib/source/test/lux/control/parser/xml.lux b/stdlib/source/test/lux/control/parser/xml.lux index 82e9a8a1b..4d357320e 100644 --- a/stdlib/source/test/lux/control/parser/xml.lux +++ b/stdlib/source/test/lux/control/parser/xml.lux @@ -36,7 +36,7 @@ (template: (!failure <exception> <cases>) [(with_expansions [<<cases>> (template.spliced <cases>)] - (do {! random.monad} + (do [! random.monad] [expected (random.ascii/alpha 1)] (_.cover [<exception>] (`` (and (~~ (template [<parser> <input>] @@ -59,7 +59,7 @@ (<| (_.covering /._) (_.for [/.Parser]) ($_ _.and - (do {! random.monad} + (do [! random.monad] [expected (random.ascii/alpha 1)] (_.cover [/.result /.text] (|> (/.result /.text (list (#xml.Text expected))) @@ -68,13 +68,13 @@ (!failure /.unconsumed_inputs [[(//\in expected) (#xml.Text expected)]]) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> #xml.Text) (random.ascii/alpha 1))] (_.cover [/.any] (|> (/.result /.any (list expected)) (try\each (xml\= expected)) (try.else false)))) - (do {! random.monad} + (do [! random.monad] [expected ..random_tag] (_.cover [/.tag] (|> (/.result (do //.monad @@ -83,7 +83,7 @@ (in (name\= expected actual))) (list (#xml.Node expected (dictionary.empty name.hash) (list)))) (!expect (#try.Success #1))))) - (do {! random.monad} + (do [! random.monad] [expected ..random_tag] (_.cover [/.node] (|> (/.result (/.node expected (//\in [])) @@ -92,7 +92,7 @@ (!failure /.wrong_tag [[(/.node ["" expected] (//\in [])) (#xml.Node [expected ""] (dictionary.empty name.hash) (list))]]) - (do {! random.monad} + (do [! random.monad] [expected_tag ..random_tag expected_attribute ..random_attribute expected_value (random.ascii/alpha 1)] @@ -144,7 +144,7 @@ [(/.node [expected expected] (/.attribute [expected expected])) (#xml.Text expected)]]) - (do {! random.monad} + (do [! random.monad] [.let [node (: (-> xml.Tag (List xml.XML) xml.XML) (function (_ tag children) (#xml.Node tag (dictionary.empty name.hash) children)))] diff --git a/stdlib/source/test/lux/control/pipe.lux b/stdlib/source/test/lux/control/pipe.lux index baa9d51c5..a61671c97 100644 --- a/stdlib/source/test/lux/control/pipe.lux +++ b/stdlib/source/test/lux/control/pipe.lux @@ -19,7 +19,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [sample random.nat] ($_ _.and (do ! diff --git a/stdlib/source/test/lux/control/region.lux b/stdlib/source/test/lux/control/region.lux index 1a2491a56..2e6af0ef9 100644 --- a/stdlib/source/test/lux/control/region.lux +++ b/stdlib/source/test/lux/control/region.lux @@ -80,7 +80,7 @@ Test (<| (_.covering /._) (_.for [/.Region]) - (do {! random.monad} + (do [! random.monad] [expected_clean_ups (|> random.nat (\ ! each (|>> (n.% 100) (n.max 1))))] ($_ _.and (_.for [/.functor] @@ -98,7 +98,7 @@ (_.cover [/.run!] (thread.result - (do {! thread.monad} + (do [! thread.monad] [clean_up_counter (thread.box 0) .let [//@ ! count_clean_up (function (_ value) @@ -106,7 +106,7 @@ [_ (thread.update! ++ clean_up_counter)] (in (#try.Success []))))] outcome (/.run! ! - (do {! (/.monad !)} + (do [! (/.monad !)] [_ (monad.each ! (/.acquire! //@ count_clean_up) (enum.range n.enum 1 expected_clean_ups))] (in []))) @@ -116,7 +116,7 @@ actual_clean_ups)))))) (_.cover [/.failure] (thread.result - (do {! thread.monad} + (do [! thread.monad] [clean_up_counter (thread.box 0) .let [//@ ! count_clean_up (function (_ value) @@ -124,7 +124,7 @@ [_ (thread.update! ++ clean_up_counter)] (in (#try.Success []))))] outcome (/.run! ! - (do {! (/.monad !)} + (do [! (/.monad !)] [_ (monad.each ! (/.acquire! //@ count_clean_up) (enum.range n.enum 1 expected_clean_ups)) _ (/.failure //@ (exception.error ..oops []))] @@ -135,7 +135,7 @@ actual_clean_ups)))))) (_.cover [/.except] (thread.result - (do {! thread.monad} + (do [! thread.monad] [clean_up_counter (thread.box 0) .let [//@ ! count_clean_up (function (_ value) @@ -143,7 +143,7 @@ [_ (thread.update! ++ clean_up_counter)] (in (#try.Success []))))] outcome (/.run! ! - (do {! (/.monad !)} + (do [! (/.monad !)] [_ (monad.each ! (/.acquire! //@ count_clean_up) (enum.range n.enum 1 expected_clean_ups)) _ (/.except //@ ..oops [])] @@ -154,7 +154,7 @@ actual_clean_ups)))))) (_.cover [/.acquire! /.clean_up_error] (thread.result - (do {! thread.monad} + (do [! thread.monad] [clean_up_counter (thread.box 0) .let [//@ ! count_clean_up (function (_ value) @@ -163,7 +163,7 @@ (in (: (Try Any) (exception.except ..oops [])))))] outcome (/.run! ! - (do {! (/.monad !)} + (do [! (/.monad !)] [_ (monad.each ! (/.acquire! //@ count_clean_up) (enum.range n.enum 1 expected_clean_ups))] (in []))) @@ -174,7 +174,7 @@ actual_clean_ups)))))) (_.cover [/.lifted] (thread.result - (do {! thread.monad} + (do [! thread.monad] [clean_up_counter (thread.box 0) .let [//@ !] outcome (/.run! ! diff --git a/stdlib/source/test/lux/control/state.lux b/stdlib/source/test/lux/control/state.lux index ecc2ee1b4..e96247575 100644 --- a/stdlib/source/test/lux/control/state.lux +++ b/stdlib/source/test/lux/control/state.lux @@ -81,7 +81,7 @@ (def: loops Test - (do {! random.monad} + (do [! random.monad] [limit (|> random.nat (\ ! each (n.% 10))) .let [condition (do /.monad [state /.get] diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index cc168c8a5..a9dbaca2e 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -78,7 +78,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [.let [gen_size (|> random.nat (\ ! each (|>> (n.% 100) (n.max 8))))] size gen_size sample (..random size) diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux index d2d44d635..102a7a2a5 100644 --- a/stdlib/source/test/lux/data/collection/array.lux +++ b/stdlib/source/test/lux/data/collection/array.lux @@ -34,7 +34,7 @@ (def: structures Test - (do {! random.monad} + (do [! random.monad] [size ..bounded_size] ($_ _.and (_.for [/.equivalence] @@ -49,7 +49,7 @@ (def: search Test - (do {! random.monad} + (do [! random.monad] [size ..bounded_size base random.nat shift random.nat @@ -93,7 +93,7 @@ Test (<| (_.covering /._) (_.for [/.Array]) - (do {! random.monad} + (do [! random.monad] [size ..bounded_size base random.nat shift random.nat diff --git a/stdlib/source/test/lux/data/collection/bits.lux b/stdlib/source/test/lux/data/collection/bits.lux index d3d7d1d05..a3f877cb1 100644 --- a/stdlib/source/test/lux/data/collection/bits.lux +++ b/stdlib/source/test/lux/data/collection/bits.lux @@ -21,11 +21,11 @@ (def: .public random (Random Bits) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 1,000) random.nat)] (case size 0 (in /.empty) - _ (do {! random.monad} + _ (do [! random.monad] [idx (|> random.nat (\ ! each (n.% size)))] (in (/.one idx /.empty)))))) @@ -46,7 +46,7 @@ (_.cover [/.empty] (/.empty? /.empty)) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (|>> (n.% 1,000) ++) random.nat) idx (\ ! each (n.% size) random.nat) sample ..random] diff --git a/stdlib/source/test/lux/data/collection/dictionary.lux b/stdlib/source/test/lux/data/collection/dictionary.lux index 4004b8ca9..60314ca82 100644 --- a/stdlib/source/test/lux/data/collection/dictionary.lux +++ b/stdlib/source/test/lux/data/collection/dictionary.lux @@ -30,7 +30,7 @@ (def: for_dictionaries Test - (do {! random.monad} + (do [! random.monad] [.let [capped_nat (\ random.monad each (n.% 100) random.nat)] size capped_nat dict (random.dictionary n.hash size random.nat capped_nat) diff --git a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux index 78d0afcc1..9759aa3d4 100644 --- a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux @@ -42,7 +42,7 @@ Test (<| (_.covering /._) (_.for [/.Dictionary]) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 100) random.nat) keys (random.set n.hash size random.nat) values (random.set n.hash size random.nat) diff --git a/stdlib/source/test/lux/data/collection/dictionary/plist.lux b/stdlib/source/test/lux/data/collection/dictionary/plist.lux index 18ca96820..56d376740 100644 --- a/stdlib/source/test/lux/data/collection/dictionary/plist.lux +++ b/stdlib/source/test/lux/data/collection/dictionary/plist.lux @@ -33,7 +33,7 @@ Test (<| (_.covering /._) (_.for [/.PList]) - (do {! random.monad} + (do [! random.monad] [.let [gen_key (random.ascii/alpha 10)] size (\ ! each (n.% 100) random.nat) sample (..random size gen_key random.nat) diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index ab2809406..639e69400 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -39,7 +39,7 @@ (def: random (Random (List Nat)) - (do {! random.monad} + (do [! random.monad] [size ..bounded_size] (|> random.nat (random.set n.hash size) @@ -65,7 +65,7 @@ (_.for [/.monad] ($monad.spec /\in /.equivalence /.monad)) - (do {! random.monad} + (do [! random.monad] [parameter random.nat subject random.nat] (let [lifted (/.lifted io.monad) @@ -85,7 +85,7 @@ (def: whole Test - (do {! random.monad} + (do [! random.monad] [size ..bounded_size .let [(^open "/\.") (/.equivalence n.equivalence)] sample (\ ! each set.list (random.set n.hash size random.nat))] @@ -131,7 +131,7 @@ Test (let [(^open "/\.") (/.equivalence n.equivalence) (^open "/\.") /.functor] - (do {! random.monad} + (do [! random.monad] [sample ..random .let [size (/.size sample)]] ($_ _.and @@ -180,7 +180,7 @@ Test (let [(^open "/\.") (/.equivalence n.equivalence) (^open "/\.") /.monoid] - (do {! random.monad} + (do [! random.monad] [sample (random.only (|>> /.size (n.> 0)) ..random) .let [size (/.size sample)] @@ -228,7 +228,7 @@ (def: member Test (let [(^open "/\.") (/.equivalence n.equivalence)] - (do {! random.monad} + (do [! random.monad] [sample ..random] (`` ($_ _.and (_.cover [/.member?] @@ -275,7 +275,7 @@ +/3 (: (-> Nat Nat Nat Nat) (function (_ left mid right) ($_ n.+ left mid right)))] - (do {! random.monad} + (do [! random.monad] [sample/0 ..random sample/1 ..random sample/2 ..random] @@ -357,7 +357,7 @@ (if (n.even? value) (#.Some (\ n.decimal encoded value)) #.None)))] - (do {! random.monad} + (do [! random.monad] [sample ..random] ($_ _.and (_.cover [/.one] @@ -395,7 +395,7 @@ (_.for [.List]) (let [(^open "/\.") (/.equivalence n.equivalence) (^open "/\.") /.functor] - (do {! random.monad} + (do [! random.monad] [sample ..random separator random.nat] ($_ _.and diff --git a/stdlib/source/test/lux/data/collection/queue.lux b/stdlib/source/test/lux/data/collection/queue.lux index 52de12d28..7a24ad89d 100644 --- a/stdlib/source/test/lux/data/collection/queue.lux +++ b/stdlib/source/test/lux/data/collection/queue.lux @@ -27,7 +27,7 @@ Test (<| (_.covering /._) (_.for [/.Queue]) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 100) random.nat) members (random.set n.hash size random.nat) non_member (random.only (|>> (set.member? members) not) diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux index 7b1335d77..2f61d3e57 100644 --- a/stdlib/source/test/lux/data/collection/queue/priority.lux +++ b/stdlib/source/test/lux/data/collection/queue/priority.lux @@ -17,7 +17,7 @@ (def: .public (random size) (-> Nat (Random (Queue Nat))) - (do {! random.monad} + (do [! random.monad] [inputs (random.list size random.nat)] (monad.mix ! (function (_ head tail) (do ! @@ -30,7 +30,7 @@ Test (<| (_.covering /._) (_.for [/.Queue]) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 100) random.nat) sample (..random size) non_member_priority random.nat diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux index ca06073df..af3acdb18 100644 --- a/stdlib/source/test/lux/data/collection/row.lux +++ b/stdlib/source/test/lux/data/collection/row.lux @@ -28,7 +28,7 @@ (def: signatures Test - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 100) random.nat)] ($_ _.and (_.for [/.equivalence] @@ -47,7 +47,7 @@ (def: whole Test - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 100) random.nat) sample (random.set n.hash size random.nat) .let [sample (|> sample set.list /.of_list)] @@ -80,7 +80,7 @@ (def: index_based Test - (do {! random.monad} + (do [! random.monad] [size (\ ! each (|>> (n.% 100) ++) random.nat)] ($_ _.and (do ! @@ -133,7 +133,7 @@ Test (<| (_.covering /._) (_.for [/.Row]) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (|>> (n.% 100) ++) random.nat)] ($_ _.and ..signatures diff --git a/stdlib/source/test/lux/data/collection/sequence.lux b/stdlib/source/test/lux/data/collection/sequence.lux index f3a3f604c..cd5427b16 100644 --- a/stdlib/source/test/lux/data/collection/sequence.lux +++ b/stdlib/source/test/lux/data/collection/sequence.lux @@ -43,7 +43,7 @@ (<| (_.covering /._) (_.for [/.Sequence]) (let [(^open "list\.") (list.equivalence n.equivalence)]) - (do {! random.monad} + (do [! random.monad] [repeated random.nat index (\ ! each (n.% 100) random.nat) size (\ ! each (|>> (n.% 10) ++) random.nat) diff --git a/stdlib/source/test/lux/data/collection/set.lux b/stdlib/source/test/lux/data/collection/set.lux index c425492d8..ec572c03c 100644 --- a/stdlib/source/test/lux/data/collection/set.lux +++ b/stdlib/source/test/lux/data/collection/set.lux @@ -29,7 +29,7 @@ Test (<| (_.covering /._) (_.for [/.Set]) - (do {! random.monad} + (do [! random.monad] [size ..gen_nat] ($_ _.and (_.for [/.equivalence] diff --git a/stdlib/source/test/lux/data/collection/set/multi.lux b/stdlib/source/test/lux/data/collection/set/multi.lux index 1037b0ed6..c1a5d6fa5 100644 --- a/stdlib/source/test/lux/data/collection/set/multi.lux +++ b/stdlib/source/test/lux/data/collection/set/multi.lux @@ -27,7 +27,7 @@ (def: .public (random size hash count element) (All (_ a) (-> Nat (Hash a) (Random Nat) (Random a) (Random (/.Set a)))) - (do {! random.monad} + (do [! random.monad] [elements (random.set hash size element) element_counts (random.list size ..count)] (in (list\mix (function (_ [count element] set) @@ -38,7 +38,7 @@ (def: signature Test - (do {! random.monad} + (do [! random.monad] [diversity (\ ! each (n.% 10) random.nat)] ($_ _.and (_.for [/.equivalence] @@ -52,7 +52,7 @@ (def: composition Test - (do {! random.monad} + (do [! random.monad] [diversity (\ ! each (n.% 10) random.nat) sample (..random diversity n.hash ..count random.nat) another (..random diversity n.hash ..count random.nat)] @@ -112,7 +112,7 @@ Test (<| (_.covering /._) (_.for [/.Set]) - (do {! random.monad} + (do [! random.monad] [diversity (\ ! each (n.% 10) random.nat) sample (..random diversity n.hash ..count random.nat) non_member (random.only (predicate.complement (set.member? (/.support sample))) diff --git a/stdlib/source/test/lux/data/collection/set/ordered.lux b/stdlib/source/test/lux/data/collection/set/ordered.lux index 2b3074039..c2133dd11 100644 --- a/stdlib/source/test/lux/data/collection/set/ordered.lux +++ b/stdlib/source/test/lux/data/collection/set/ordered.lux @@ -40,7 +40,7 @@ Test (<| (_.covering /._) (_.for [/.Set]) - (do {! random.monad} + (do [! random.monad] [sizeL ..size sizeR ..size usetL (random.set n.hash sizeL random.nat) diff --git a/stdlib/source/test/lux/data/collection/tree.lux b/stdlib/source/test/lux/data/collection/tree.lux index 66607cc37..0aba27125 100644 --- a/stdlib/source/test/lux/data/collection/tree.lux +++ b/stdlib/source/test/lux/data/collection/tree.lux @@ -21,7 +21,7 @@ (def: .public (tree gen_value) (All (_ a) (-> (Random a) (Random [Nat (Tree a)]))) - (do {! random.monad} + (do [! random.monad] [value gen_value num_children (\ ! each (n.% 2) random.nat) children (random.list num_children (tree gen_value))] @@ -56,7 +56,7 @@ (\ (list.equivalence n.equivalence) = (list expected) (/.flat (/.leaf expected))))) - (do {! random.monad} + (do [! random.monad] [value random.nat num_children (\ ! each (n.% 3) random.nat) children (random.list num_children random.nat)] diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux index 754d1b20b..09c9af569 100644 --- a/stdlib/source/test/lux/data/collection/tree/finger.lux +++ b/stdlib/source/test/lux/data/collection/tree/finger.lux @@ -32,7 +32,7 @@ Test (<| (_.covering /._) (_.for [/.Tree]) - (do {! random.monad} + (do [! random.monad] [tag_left (random.ascii/alpha_num 1) tag_right (random.only (|>> (text\= tag_left) not) (random.ascii/alpha_num 1)) diff --git a/stdlib/source/test/lux/data/collection/tree/zipper.lux b/stdlib/source/test/lux/data/collection/tree/zipper.lux index 8e3d064bc..9f780415c 100644 --- a/stdlib/source/test/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/test/lux/data/collection/tree/zipper.lux @@ -155,7 +155,7 @@ Test (<| (_.covering /._) (_.for [/.Zipper]) - (do {! random.monad} + (do [! random.monad] [[size sample] (//.tree random.nat) expected random.nat dummy (random.only (|>> (n.= expected) not) random.nat) diff --git a/stdlib/source/test/lux/data/color.lux b/stdlib/source/test/lux/data/color.lux index 25d103c12..0628543f6 100644 --- a/stdlib/source/test/lux/data/color.lux +++ b/stdlib/source/test/lux/data/color.lux @@ -130,7 +130,7 @@ (def: palette Test (_.for [/.Spread /.Palette] - (do {! random.monad} + (do [! random.monad] [eH (\ ! each (|>> f.abs (f.% +0.9) (f.+ +0.05)) random.safe_frac) .let [eS +0.5] @@ -180,7 +180,7 @@ Test (<| (_.covering /._) (_.for [/.Color]) - (do {! random.monad} + (do [! random.monad] [expected ..random] ($_ _.and (_.for [/.equivalence] diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 1da99c230..6f9722350 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -35,7 +35,7 @@ (Random /.JSON) (random.rec (function (_ recur) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 2) random.nat)] ($_ random.or (\ ! in []) diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index 2550c8836..5c0fe2659 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -39,7 +39,7 @@ (def: path Test (_.for [/.Path] - (do {! random.monad} + (do [! random.monad] [expected (random.ascii/lower /.path_size) invalid (random.ascii/lower (++ /.path_size)) not_ascii (random.text (random.char (unicode.set [unicode/block.katakana (list)])) @@ -74,7 +74,7 @@ (def: name Test (_.for [/.Name] - (do {! random.monad} + (do [! random.monad] [expected (random.ascii/lower /.name_size) invalid (random.ascii/lower (++ /.name_size)) not_ascii (random.text (random.char (unicode.set [unicode/block.katakana (list)])) @@ -107,7 +107,7 @@ (def: small Test (_.for [/.Small] - (do {! random.monad} + (do [! random.monad] [expected (|> random.nat (\ ! each (n.% /.small_limit))) invalid (|> random.nat (\ ! each (n.max /.small_limit)))] (`` ($_ _.and @@ -131,7 +131,7 @@ (def: big Test (_.for [/.Big] - (do {! random.monad} + (do [! random.monad] [expected (|> random.nat (\ ! each (n.% /.big_limit))) invalid (|> random.nat (\ ! each (n.max /.big_limit)))] (`` ($_ _.and @@ -156,7 +156,7 @@ (def: entry Test - (do {! random.monad} + (do [! random.monad] [expected_path (random.ascii/lower (-- /.path_size)) expected_moment (\ ! each (|>> (n.% 1,0,00,00,00,00,000) .int instant.of_millis) random.nat) @@ -224,7 +224,7 @@ (def: random_mode (Random /.Mode) - (do {! random.monad} + (do [! random.monad] [] (random.either (random.either (random.either (in /.execute_by_other) (in /.write_by_other)) @@ -242,7 +242,7 @@ (def: mode Test (_.for [/.Mode /.mode] - (do {! random.monad} + (do [! random.monad] [path (random.ascii/lower 10) modes (random.list 4 ..random_mode) .let [expected_mode (list\mix /.and /.none modes)]] @@ -314,7 +314,7 @@ (def: ownership Test - (do {! random.monad} + (do [! random.monad] [path (random.ascii/lower /.path_size) expected (random.ascii/lower /.name_size) invalid (random.ascii/lower (++ /.name_size)) diff --git a/stdlib/source/test/lux/data/format/xml.lux b/stdlib/source/test/lux/data/format/xml.lux index 8ef920a57..b81ea46ff 100644 --- a/stdlib/source/test/lux/data/format/xml.lux +++ b/stdlib/source/test/lux/data/format/xml.lux @@ -35,7 +35,7 @@ (def: char (Random Nat) - (do {! random.monad} + (do [! random.monad] [idx (|> random.nat (\ ! each (n.% (text.size char_range))))] (in (maybe.trusted (text.char idx char_range))))) @@ -76,7 +76,7 @@ (_.for [/.codec] ($codec.spec /.equivalence /.codec ..random)) - (do {! random.monad} + (do [! random.monad] [(^@ identifier [namespace name]) ..identifier] (`` ($_ _.and (~~ (template [<type> <format>] diff --git a/stdlib/source/test/lux/data/name.lux b/stdlib/source/test/lux/data/name.lux index 538645e61..b772c8e5d 100644 --- a/stdlib/source/test/lux/data/name.lux +++ b/stdlib/source/test/lux/data/name.lux @@ -28,7 +28,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [... First Name sizeM1 (|> random.nat (\ ! each (n.% 100))) sizeS1 (|> random.nat (\ ! each (|>> (n.% 100) (n.max 1)))) diff --git a/stdlib/source/test/lux/data/sum.lux b/stdlib/source/test/lux/data/sum.lux index 8fd3fa194..d0be3fd0e 100644 --- a/stdlib/source/test/lux/data/sum.lux +++ b/stdlib/source/test/lux/data/sum.lux @@ -24,7 +24,7 @@ Test (<| (_.covering /._) (_.for [.Union .Or]) - (do {! random.monad} + (do [! random.monad] [expected random.nat shift random.nat] ($_ _.and diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index 509cb5769..b5d8b740e 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -38,7 +38,7 @@ (def: size Test - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 10) random.nat) sample (random.unicode size)] ($_ _.and @@ -50,7 +50,7 @@ (def: affix Test - (do {! random.monad} + (do [! random.monad] [inner (random.unicode 1) outer (random.only (|>> (\ /.equivalence = inner) not) (random.unicode 1)) @@ -79,7 +79,7 @@ (def: index Test - (do {! random.monad} + (do [! random.monad] [inner (random.unicode 1) outer (random.only (|>> (\ /.equivalence = inner) not) (random.unicode 1)) @@ -145,7 +145,7 @@ (_.cover [/.line_feed] (\ /.equivalence = /.new_line /.line_feed)) ))) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (|>> (n.% 10) ++) random.nat) characters (random.set /.hash size (random.ascii/alpha 1)) .let [sample (|> characters set.list /.together)] @@ -177,7 +177,7 @@ (def: manipulation Test - (do {! random.monad} + (do [! random.monad] [size (\ ! each (|>> (n.% 10) (n.+ 2)) random.nat) characters (random.set /.hash size (random.ascii/alpha 1)) separator (random.only (|>> (set.member? characters) not) @@ -311,7 +311,7 @@ _ #0))) )) - (do {! random.monad} + (do [! random.monad] [sizeP bounded_size sizeL bounded_size .let [... The wider unicode charset includes control characters that diff --git a/stdlib/source/test/lux/data/text/buffer.lux b/stdlib/source/test/lux/data/text/buffer.lux index 28e82be88..ad98c2f75 100644 --- a/stdlib/source/test/lux/data/text/buffer.lux +++ b/stdlib/source/test/lux/data/text/buffer.lux @@ -16,7 +16,7 @@ (def: part (Random Text) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (|>> (n.% 10) ++) random.nat)] (random.ascii/alpha size))) diff --git a/stdlib/source/test/lux/data/text/encoding.lux b/stdlib/source/test/lux/data/text/encoding.lux index 8ebeb97f6..927375cb3 100644 --- a/stdlib/source/test/lux/data/text/encoding.lux +++ b/stdlib/source/test/lux/data/text/encoding.lux @@ -213,7 +213,7 @@ (def: .public random (Random /.Encoding) (let [options (list.size ..all_encodings)] - (do {! random.monad} + (do [! random.monad] [choice (\ ! each (n.% options) random.nat)] (in (maybe.trusted (list.item choice ..all_encodings)))))) diff --git a/stdlib/source/test/lux/data/text/escape.lux b/stdlib/source/test/lux/data/text/escape.lux index 18c60e2f3..4f1b8ed75 100644 --- a/stdlib/source/test/lux/data/text/escape.lux +++ b/stdlib/source/test/lux/data/text/escape.lux @@ -112,7 +112,7 @@ (#try.Failure error) false)) (text\= expected (/.escaped expected)))))) - (do {! random.monad} + (do [! random.monad] [dummy (|> (random.char unicode.character) (\ ! each text.of_char))] (_.cover [/.dangling_escape] @@ -122,7 +122,7 @@ (#try.Failure error) (exception.match? /.dangling_escape error)))) - (do {! random.monad} + (do [! random.monad] [dummy (|> (random.char unicode.character) (random.only (|>> (set.member? ..valid_sigils) not)) (\ ! each text.of_char))] @@ -133,7 +133,7 @@ (#try.Failure error) (exception.match? /.invalid_escape error)))) - (do {! random.monad} + (do [! random.monad] [too_short (|> (random.char unicode.character) (\ ! each (n.% (hex "1000")))) code (|> (random.unicode 4) diff --git a/stdlib/source/test/lux/data/text/format.lux b/stdlib/source/test/lux/data/text/format.lux index e5b6968e0..e5f13ad69 100644 --- a/stdlib/source/test/lux/data/text/format.lux +++ b/stdlib/source/test/lux/data/text/format.lux @@ -173,7 +173,7 @@ (#.Some value) (text.contains? (/.nat value) (/.maybe /.nat sample))))) - (do {! random.monad} + (do [! random.monad] [modulus (random.one (|>> modulus.modulus try.maybe) random.int) diff --git a/stdlib/source/test/lux/data/text/unicode/block.lux b/stdlib/source/test/lux/data/text/unicode/block.lux index 4f9f27295..d127651e7 100644 --- a/stdlib/source/test/lux/data/text/unicode/block.lux +++ b/stdlib/source/test/lux/data/text/unicode/block.lux @@ -24,7 +24,7 @@ (def: .public random (Random /.Block) - (do {! random.monad} + (do [! random.monad] [start (\ ! each (n.% 1,000,000) random.nat) additional (\ ! each (n.% 1,000,000) random.nat)] (in (/.block start additional)))) @@ -169,7 +169,7 @@ Test (<| (_.covering /._) (_.for [/.Block]) - (do {! random.monad} + (do [! random.monad] [.let [top_start (hex "AC00") top_end (hex "D7AF") end_range (n.- top_start top_end)] diff --git a/stdlib/source/test/lux/data/text/unicode/set.lux b/stdlib/source/test/lux/data/text/unicode/set.lux index db18d9b7d..ef5b66720 100644 --- a/stdlib/source/test/lux/data/text/unicode/set.lux +++ b/stdlib/source/test/lux/data/text/unicode/set.lux @@ -25,7 +25,7 @@ (def: .public random (Random /.Set) - (do {! random.monad} + (do [! random.monad] [left //block.random right //block.random] (in (/.set [left (list right)])))) @@ -34,7 +34,7 @@ Test (<| (_.covering /._) (_.for [/.Set]) - (do {! random.monad} + (do [! random.monad] [block //block.random inside (\ ! each (|>> (n.% (block.size block)) diff --git a/stdlib/source/test/lux/ffi.js.lux b/stdlib/source/test/lux/ffi.js.lux index d21ed1a6c..e193e6df8 100644 --- a/stdlib/source/test/lux/ffi.js.lux +++ b/stdlib/source/test/lux/ffi.js.lux @@ -44,7 +44,7 @@ (def: .public test Test - (do {! random.monad} + (do [! random.monad] [boolean random.bit number (\ ! each (|>> (nat.% 100) nat.frac) random.nat) string (random.ascii 5) diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 071e43a3c..5a16902a7 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -70,7 +70,7 @@ (def: for_conversions Test - (do {! random.monad} + (do [! random.monad] [long (\ ! each (|>> (:as /.Long)) random.int) integer (\ ! each (|>> (:as /.Long) /.long_to_int) random.int) byte (\ ! each (|>> (:as /.Long) /.long_to_byte) random.int) @@ -105,7 +105,7 @@ (def: for_arrays Test - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (|>> (n.% 100) (n.max 1)))) idx (|> random.nat (\ ! each (n.% size))) value (\ ! each (|>> (:as java/lang/Long)) random.int)] @@ -131,7 +131,7 @@ (def: for_miscellaneous Test - (`` (do {! random.monad} + (`` (do [! random.monad] [sample (\ ! each (|>> (:as java/lang/Object)) (random.ascii 1)) boolean (\ ! each (|>> (:as /.Boolean)) random.bit) @@ -488,7 +488,7 @@ (def: for_class Test - (do {! random.monad} + (do [! random.monad] [expected random.nat left random.int right random.int diff --git a/stdlib/source/test/lux/ffi.lua.lux b/stdlib/source/test/lux/ffi.lua.lux index 88442df22..de067a372 100644 --- a/stdlib/source/test/lux/ffi.lua.lux +++ b/stdlib/source/test/lux/ffi.lua.lux @@ -15,7 +15,7 @@ (def: .public test Test - (do {! random.monad} + (do [! random.monad] [boolean random.bit integer random.int float random.frac diff --git a/stdlib/source/test/lux/ffi.old.lux b/stdlib/source/test/lux/ffi.old.lux index 32c7ea085..fe1fdef65 100644 --- a/stdlib/source/test/lux/ffi.old.lux +++ b/stdlib/source/test/lux/ffi.old.lux @@ -87,7 +87,7 @@ (def: conversions Test - (do {! random.monad} + (do [! random.monad] [long random.int int (\ ! each (|>> /.long_to_int) random.int) char (\ ! each (|>> /.long_to_int /.int_to_char) random.int) @@ -155,7 +155,7 @@ (def: arrays Test - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (|>> (n.% 100) (n.max 1)))) idx (|> random.nat (\ ! each (n.% size))) value random.int] diff --git a/stdlib/source/test/lux/ffi.php.lux b/stdlib/source/test/lux/ffi.php.lux index d974b7ec2..4db2d70c0 100644 --- a/stdlib/source/test/lux/ffi.php.lux +++ b/stdlib/source/test/lux/ffi.php.lux @@ -18,7 +18,7 @@ (def: .public test Test - (do {! random.monad} + (do [! random.monad] [] (<| (_.covering /._) (_.test "TBD" diff --git a/stdlib/source/test/lux/ffi.py.lux b/stdlib/source/test/lux/ffi.py.lux index 2a5e7cffa..024220863 100644 --- a/stdlib/source/test/lux/ffi.py.lux +++ b/stdlib/source/test/lux/ffi.py.lux @@ -18,7 +18,7 @@ (def: .public test Test - (do {! random.monad} + (do [! random.monad] [boolean random.bit integer random.int float random.frac diff --git a/stdlib/source/test/lux/ffi.rb.lux b/stdlib/source/test/lux/ffi.rb.lux index 623532196..82423fe92 100644 --- a/stdlib/source/test/lux/ffi.rb.lux +++ b/stdlib/source/test/lux/ffi.rb.lux @@ -15,7 +15,7 @@ (def: .public test Test - (do {! random.monad} + (do [! random.monad] [boolean random.bit integer random.int float random.frac diff --git a/stdlib/source/test/lux/ffi.scm.lux b/stdlib/source/test/lux/ffi.scm.lux index d974b7ec2..4db2d70c0 100644 --- a/stdlib/source/test/lux/ffi.scm.lux +++ b/stdlib/source/test/lux/ffi.scm.lux @@ -18,7 +18,7 @@ (def: .public test Test - (do {! random.monad} + (do [! random.monad] [] (<| (_.covering /._) (_.test "TBD" diff --git a/stdlib/source/test/lux/locale.lux b/stdlib/source/test/lux/locale.lux index 90959d401..3066230f4 100644 --- a/stdlib/source/test/lux/locale.lux +++ b/stdlib/source/test/lux/locale.lux @@ -53,7 +53,7 @@ (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random_locale)) (_.for [/.hash] - (do {! random.monad} + (do [! random.monad] [fixed_language ..random_language fixed_territory ..random_territory fixed_encoding ..random_encoding] diff --git a/stdlib/source/test/lux/locale/language.lux b/stdlib/source/test/lux/locale/language.lux index 0b48c7330..4abf74207 100644 --- a/stdlib/source/test/lux/locale/language.lux +++ b/stdlib/source/test/lux/locale/language.lux @@ -281,7 +281,7 @@ (let [options (|> ..languages (list\each (|>> (value@ #languages) set.list)) list.together)] - (do {! random.monad} + (do [! random.monad] [choice (\ ! each (n.% (list.size options)) random.nat)] (in (maybe.trusted (list.item choice options)))))) diff --git a/stdlib/source/test/lux/locale/territory.lux b/stdlib/source/test/lux/locale/territory.lux index 394b2f5d6..50b282e10 100644 --- a/stdlib/source/test/lux/locale/territory.lux +++ b/stdlib/source/test/lux/locale/territory.lux @@ -207,7 +207,7 @@ (let [options (|> ..territories (list\each (|>> (value@ #territories) set.list)) list.together)] - (do {! random.monad} + (do [! random.monad] [choice (\ ! each (n.% (list.size options)) random.nat)] (in (maybe.trusted (list.item choice options)))))) diff --git a/stdlib/source/test/lux/macro.lux b/stdlib/source/test/lux/macro.lux index 93b4f40a7..96d1c2b18 100644 --- a/stdlib/source/test/lux/macro.lux +++ b/stdlib/source/test/lux/macro.lux @@ -58,7 +58,7 @@ (def: random_lux (Random [Nat Text .Lux]) - (do {! random.monad} + (do [! random.monad] [seed random.nat identifier_prefix (random.ascii/upper 1) .let [macro_module (name.module (name_of /._)) @@ -104,7 +104,7 @@ (def: expander Test - (do {! random.monad} + (do [! random.monad] [[seed identifier_prefix lux] ..random_lux pow/1 (\ ! each code.nat random.nat) @@ -149,7 +149,7 @@ Test (<| (_.covering /._) ($_ _.and - (do {! random.monad} + (do [! random.monad] [[seed identifier_prefix lux] ..random_lux] ($_ _.and (_.cover [/.identifier] diff --git a/stdlib/source/test/lux/macro/code.lux b/stdlib/source/test/lux/macro/code.lux index 050a33c16..76af72b41 100644 --- a/stdlib/source/test/lux/macro/code.lux +++ b/stdlib/source/test/lux/macro/code.lux @@ -37,13 +37,13 @@ (def: (random_sequence random) (All (_ a) (-> (Random a) (Random (List a)))) - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (n.% 3)))] (random.list size random))) (def: (random_record random) (All (_ a) (-> (Random a) (Random (List [a a])))) - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (n.% 3)))] (random.list size (random.and random random)))) @@ -85,13 +85,13 @@ (function (_ replacement_simulation) (let [for_sequence (: (-> (-> (List Code) Code) (Random [Code Code])) (function (_ to_code) - (do {! random.monad} + (do [! random.monad] [parts (..random_sequence replacement_simulation)] (in [(to_code (list\each product.left parts)) (to_code (list\each product.right parts))]))))] ($_ random.either (random\in [original substitute]) - (do {! random.monad} + (do [! random.monad] [sample (random.only (|>> (\ /.equivalence = original) not) ($_ random.either (random\each /.bit random.bit) @@ -105,7 +105,7 @@ (in [sample sample])) (for_sequence /.form) (for_sequence /.tuple) - (do {! random.monad} + (do [! random.monad] [parts (..random_sequence replacement_simulation)] (in [(/.record (let [parts' (list\each product.left parts)] (list.zipped/2 parts' parts'))) @@ -117,7 +117,7 @@ Test (`` ($_ _.and (~~ (template [<coverage> <random> <tag>] - [(do {! random.monad} + [(do [! random.monad] [expected <random>] (_.cover [<coverage>] (and (case (..read (/.format (<coverage> expected))) @@ -144,7 +144,7 @@ [/.tuple (..random_sequence ..random) #.Tuple] [/.record (..random_record ..random) #.Record])) (~~ (template [<coverage> <random> <tag>] - [(do {! random.monad} + [(do [! random.monad] [expected <random>] (_.cover [<coverage>] (and (case (..read (/.format (<coverage> expected))) @@ -174,7 +174,7 @@ (_.for [/.format] ..for_format) - (do {! random.monad} + (do [! random.monad] [[original substitute] (random.only (function (_ [original substitute]) (not (\ /.equivalence = original substitute))) (random.and ..random ..random)) diff --git a/stdlib/source/test/lux/macro/local.lux b/stdlib/source/test/lux/macro/local.lux index 726c99d81..305256e5b 100644 --- a/stdlib/source/test/lux/macro/local.lux +++ b/stdlib/source/test/lux/macro/local.lux @@ -67,7 +67,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [expected random.nat] ($_ _.and (_.cover [/.push] diff --git a/stdlib/source/test/lux/macro/syntax/annotations.lux b/stdlib/source/test/lux/macro/syntax/annotations.lux index b79d7dbea..34293515e 100644 --- a/stdlib/source/test/lux/macro/syntax/annotations.lux +++ b/stdlib/source/test/lux/macro/syntax/annotations.lux @@ -26,7 +26,7 @@ (Random /.Annotations) (let [word (random.ascii/alpha 10) tag (random.and word word)] - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 10) random.nat)] (random.list size (random.and tag $///code.random))))) diff --git a/stdlib/source/test/lux/macro/syntax/declaration.lux b/stdlib/source/test/lux/macro/syntax/declaration.lux index 9e3faff22..81d2529a5 100644 --- a/stdlib/source/test/lux/macro/syntax/declaration.lux +++ b/stdlib/source/test/lux/macro/syntax/declaration.lux @@ -22,7 +22,7 @@ (let [word (random.ascii/alpha 10)] ($_ random.and word - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 10) random.nat)] (random.list size word)) ))) diff --git a/stdlib/source/test/lux/macro/template.lux b/stdlib/source/test/lux/macro/template.lux index dccc983f5..e86b8a702 100644 --- a/stdlib/source/test/lux/macro/template.lux +++ b/stdlib/source/test/lux/macro/template.lux @@ -40,7 +40,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [left random.nat mid random.nat right random.nat] diff --git a/stdlib/source/test/lux/math.lux b/stdlib/source/test/lux/math.lux index db7bf302d..b83d89d4e 100644 --- a/stdlib/source/test/lux/math.lux +++ b/stdlib/source/test/lux/math.lux @@ -35,7 +35,7 @@ Test (<| (_.covering /._) ($_ _.and - (do {! random.monad} + (do [! random.monad] [.let [~= (f.approximately? ..margin_of_error)] angle (|> random.safe_frac (\ ! each (f.* /.tau)))] ($_ _.and @@ -60,7 +60,7 @@ (_.cover [/.pi] (~= (f./ +2.0 /.tau) /.pi)) )) - (do {! random.monad} + (do [! random.monad] [sample (|> random.safe_frac (\ ! each (f.* +1000.0)))] ($_ _.and (_.cover [/.ceil] @@ -89,7 +89,7 @@ (/.pow +3.0) (f.approximately? ..margin_of_error sample))) )) - (do {! random.monad} + (do [! random.monad] [.let [~= (f.approximately? ..margin_of_error)] sample (\ ! each (f.* +10.0) random.safe_frac) power (\ ! each (|>> (n.% 10) ++ n.frac) random.nat)] @@ -105,7 +105,7 @@ (/.log_by sample) (~= power)))) )) - (do {! random.monad} + (do [! random.monad] [.let [~= (f.approximately? ..margin_of_error)] angle (\ ! each (f.* /.tau) random.safe_frac) sample (\ ! each f.abs random.safe_frac) @@ -136,14 +136,14 @@ (inverse! /.asinh /.acsch sample) (inverse! /.atanh /.acoth big) ))) - (do {! random.monad} + (do [! random.monad] [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) (f.>= y h))))) - (do {! random.monad} + (do [! random.monad] [.let [~= (f.approximately? ..margin_of_error) tau/4 (f./ +4.0 /.tau)] x (\ ! each (f.* tau/4) random.safe_frac) @@ -159,7 +159,7 @@ (~= tau/4 (/.atan/2 +0.0 (f.abs y))) (~= (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} + (do [! random.monad] [of (\ ! each (|>> (n.% 10) ++) random.nat)] (_.cover [/.factorial] (and (n.= 1 (/.factorial 0)) diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux index a84a3e186..1fbf47636 100644 --- a/stdlib/source/test/lux/math/logic/fuzzy.lux +++ b/stdlib/source/test/lux/math/logic/fuzzy.lux @@ -36,7 +36,7 @@ (def: simple Test - (do {! random.monad} + (do [! random.monad] [sample random.rev threshold_0 (\ ! each (r.% .5) @@ -83,7 +83,7 @@ (def: composition Test - (do {! random.monad} + (do [! random.monad] [sample random.rev [bottom middle_bottom middle_top top] @@ -167,7 +167,7 @@ Test (<| (_.covering /._) (_.for [/.Fuzzy]) - (do {! random.monad} + (do [! random.monad] [sample random.rev [bottom middle_bottom middle_top top] diff --git a/stdlib/source/test/lux/math/number/complex.lux b/stdlib/source/test/lux/math/number/complex.lux index c2b28e5ee..94a903f79 100644 --- a/stdlib/source/test/lux/math/number/complex.lux +++ b/stdlib/source/test/lux/math/number/complex.lux @@ -27,7 +27,7 @@ (def: dimension (Random Frac) - (do {! random.monad} + (do [! random.monad] [factor (|> random.nat (\ ! each (|>> (n.% 1000) (n.max 1)))) measure (|> random.safe_frac (random.only (f.> +0.0)))] (in (f.* (|> factor .int int.frac) @@ -214,7 +214,7 @@ (def: trigonometry Test - (do {! random.monad} + (do [! random.monad] [angle ..angle] ($_ _.and (_.cover [/.sin /.asin] @@ -226,7 +226,7 @@ (def: hyperbolic Test - (do {! random.monad} + (do [! random.monad] [angle ..angle] ($_ _.and (_.cover [/.sinh] @@ -258,7 +258,7 @@ (def: root Test - (do {! random.monad} + (do [! random.monad] [sample ..random degree (|> random.nat (\ ! each (|>> (n.max 1) (n.% 5))))] (_.cover [/.roots] diff --git a/stdlib/source/test/lux/math/number/frac.lux b/stdlib/source/test/lux/math/number/frac.lux index 6a6e6eb4f..baedf891a 100644 --- a/stdlib/source/test/lux/math/number/frac.lux +++ b/stdlib/source/test/lux/math/number/frac.lux @@ -50,7 +50,7 @@ (def: predicate Test - (do {! random.monad} + (do [! random.monad] [sample ..random shift (\ ! each /.abs ..random)] ($_ _.and @@ -76,15 +76,15 @@ (def: conversion Test ($_ _.and - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (n.% 1,000,000) random.nat)] (_.cover [/.nat] (|> expected n.frac /.nat (n.= expected)))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (i.% +1,000,000) random.int)] (_.cover [/.int] (|> expected i.frac /.int (i.= expected)))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> (i64.left_shifted 52) .rev) random.nat)] (_.cover [/.rev] diff --git a/stdlib/source/test/lux/math/number/i16.lux b/stdlib/source/test/lux/math/number/i16.lux index 83e09233d..6f35f015c 100644 --- a/stdlib/source/test/lux/math/number/i16.lux +++ b/stdlib/source/test/lux/math/number/i16.lux @@ -22,7 +22,7 @@ Test (<| (_.covering /._) (_.for [/.I16]) - (do {! random.monad} + (do [! random.monad] [.let [limit (|> (-- /.width) //i64.mask .int diff --git a/stdlib/source/test/lux/math/number/i32.lux b/stdlib/source/test/lux/math/number/i32.lux index cfb0e3993..0548c3c86 100644 --- a/stdlib/source/test/lux/math/number/i32.lux +++ b/stdlib/source/test/lux/math/number/i32.lux @@ -22,7 +22,7 @@ Test (<| (_.covering /._) (_.for [/.I32]) - (do {! random.monad} + (do [! random.monad] [.let [limit (|> (-- /.width) //i64.mask .int diff --git a/stdlib/source/test/lux/math/number/i64.lux b/stdlib/source/test/lux/math/number/i64.lux index 959cd7930..3a32cdd3b 100644 --- a/stdlib/source/test/lux/math/number/i64.lux +++ b/stdlib/source/test/lux/math/number/i64.lux @@ -20,7 +20,7 @@ (def: bit Test - (do {! random.monad} + (do [! random.monad] [pattern random.nat idx (\ ! each (n.% /.width) random.nat)] ($_ _.and @@ -44,7 +44,7 @@ (def: shift Test - (do {! random.monad} + (do [! random.monad] [pattern random.nat] ($_ _.and (do ! @@ -72,7 +72,7 @@ (def: mask Test (<| (_.for [/.Mask]) - (do {! random.monad} + (do [! random.monad] [pattern random.nat idx (\ ! each (n.% /.width) random.nat) signed random.int] @@ -121,7 +121,7 @@ (def: sub Test (_.for [/.Sub] - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% /.width) random.nat)] (case (/.sub size) #.None @@ -129,7 +129,7 @@ (n.= 0 size)) (#.Some sub) - (do {! random.monad} + (do [! random.monad] [.let [limit (|> (-- (\ sub width)) /.mask .int @@ -163,7 +163,7 @@ Test (<| (_.covering /._) (_.for [.I64]) - (do {! random.monad} + (do [! random.monad] [pattern random.nat idx (\ ! each (n.% /.width) random.nat)] ($_ _.and diff --git a/stdlib/source/test/lux/math/number/i8.lux b/stdlib/source/test/lux/math/number/i8.lux index fc2562dd2..8eb7517f1 100644 --- a/stdlib/source/test/lux/math/number/i8.lux +++ b/stdlib/source/test/lux/math/number/i8.lux @@ -22,7 +22,7 @@ Test (<| (_.covering /._) (_.for [/.I8]) - (do {! random.monad} + (do [! random.monad] [.let [limit (|> (-- /.width) //i64.mask .int diff --git a/stdlib/source/test/lux/math/number/int.lux b/stdlib/source/test/lux/math/number/int.lux index b2200f456..3313c5c0a 100644 --- a/stdlib/source/test/lux/math/number/int.lux +++ b/stdlib/source/test/lux/math/number/int.lux @@ -56,7 +56,7 @@ (def: predicate Test - (do {! random.monad} + (do [! random.monad] [sample random.int] ($_ _.and (_.cover [/.negative?] @@ -134,7 +134,7 @@ (/.= (/.+ left (/.% left right)) (/.mod left right)))))) )) - (do {! random.monad} + (do [! random.monad] [.let [random (|> random.int (\ ! each (/.% +1,000)) (random.only (|>> (/.= +0) not)))] @@ -176,13 +176,13 @@ (|> expected /.opposite /.opposite (/.= expected))] (and subtraction! inverse!)))) - (do {! random.monad} + (do [! random.monad] [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} + (do [! random.monad] [pattern random.int idx (\ ! each (n.% i64.width) random.nat)] (_.cover [/.right_shifted] diff --git a/stdlib/source/test/lux/math/number/nat.lux b/stdlib/source/test/lux/math/number/nat.lux index 912b16bd4..2084821f7 100644 --- a/stdlib/source/test/lux/math/number/nat.lux +++ b/stdlib/source/test/lux/math/number/nat.lux @@ -54,7 +54,7 @@ (def: predicate Test - (do {! random.monad} + (do [! random.monad] [sample random.nat] ($_ _.and (_.cover [/.even? /.odd?] @@ -103,7 +103,7 @@ (and (/.= div (/./ left right)) (/.= rem (/.% left right))))) )) - (do {! random.monad} + (do [! random.monad] [.let [random (\ ! each (|>> (/.% 1,000) ++) random.nat)] left random right random] @@ -120,7 +120,7 @@ (and (/.= 0 (/.% left lcm)) (/.= 0 (/.% right lcm))))) )) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (/.% 1,000,000) random.nat) sample random.nat] (_.cover [/.frac] diff --git a/stdlib/source/test/lux/math/number/rev.lux b/stdlib/source/test/lux/math/number/rev.lux index 0398a55a2..bb379d597 100644 --- a/stdlib/source/test/lux/math/number/rev.lux +++ b/stdlib/source/test/lux/math/number/rev.lux @@ -82,13 +82,13 @@ (_.cover [/.-] (and (/.= .0 (/.- sample sample)) (/.= sample (/.- .0 sample))))) - (do {! random.monad} + (do [! random.monad] [left random.rev right random.rev] (_.cover [/.*] (and (/.< left (/.* left right)) (/.< right (/.* left right))))) - (do {! random.monad} + (do [! random.monad] [.let [dividend (\ ! each (i64.and (hex "FFFF")) random.rev) divisor (\ ! each (|>> (i64.and (hex "F")) @@ -131,7 +131,7 @@ (/.ratio dividend) (n.= scale))) )) - (do {! random.monad} + (do [! random.monad] [dividend random.rev divisor (random.only (|>> (/.= .0) not) random.rev)] @@ -155,7 +155,7 @@ (_.cover [/.reciprocal] (/.= (/.reciprocal sample) (|> sample /.reciprocal .nat /.reciprocal .nat /.reciprocal)))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> f.abs (f.% +1.0)) random.safe_frac) sample random.rev] diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index 44cf528c9..5dac54f18 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -281,7 +281,7 @@ random.nat)) (def: context_related - (do {! random.monad} + (do [! random.monad] [target (random.ascii/upper 1) version (random.ascii/upper 1) source_code (random.ascii/upper 1) @@ -340,7 +340,7 @@ (def: definition_related Test - (do {! random.monad} + (do [! random.monad] [expected_current_module (random.ascii/upper 1) expected_macro_module (random.only (|>> (text\= expected_current_module) not) (random.ascii/upper 1)) @@ -456,7 +456,7 @@ (def: search_related Test - (do {! random.monad} + (do [! random.monad] [expected_exported? random.bit expected_current_module (random.ascii/upper 1) expected_macro_module (random.only (|>> (text\= expected_current_module) not) @@ -633,7 +633,7 @@ (def: tags_related Test - (do {! random.monad} + (do [! random.monad] [current_module (random.ascii/upper 1) tag_module (random.only (|>> (text\= current_module) not) (random.ascii/upper 1)) @@ -745,7 +745,7 @@ (def: locals_related Test - (do {! random.monad} + (do [! random.monad] [current_module (random.ascii/upper 1) [name_0 name_1 name_2 name_3 name_4] (|> (random.ascii/upper 1) (random.set text.hash 5) @@ -889,7 +889,7 @@ (<| (_.covering /._) (_.for [.Meta .Lux]) ($_ _.and - (do {! random.monad} + (do [! random.monad] [target (random.ascii/upper 1) version (random.ascii/upper 1) source_code (random.ascii/upper 1) diff --git a/stdlib/source/test/lux/meta/annotation.lux b/stdlib/source/test/lux/meta/annotation.lux index 011cf788c..362fe1102 100644 --- a/stdlib/source/test/lux/meta/annotation.lux +++ b/stdlib/source/test/lux/meta/annotation.lux @@ -35,13 +35,13 @@ (def: (random_sequence random) (All (_ a) (-> (Random a) (Random (List a)))) - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (nat.% 3)))] (random.list size random))) (def: (random_record random) (All (_ a) (-> (Random a) (Random (List [a a])))) - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (nat.% 3)))] (random.list size (random.and random random)))) @@ -57,11 +57,11 @@ (def: typed_value Test - (do {! random.monad} + (do [! random.monad] [key ..random_key] (`` ($_ _.and (~~ (template [<definition> <random> <constructor> <equivalence>] - [(do {! random.monad} + [(do [! random.monad] [expected <random>] (_.cover [<definition>] (|> expected <constructor> @@ -86,7 +86,7 @@ (def: flag Test - (do {! random.monad} + (do [! random.monad] [key ..random_key] (`` ($_ _.and (do ! @@ -117,7 +117,7 @@ Test (<| (_.covering /._) (_.for [/.Annotation]) - (do {! random.monad} + (do [! random.monad] [key ..random_key] ($_ _.and (do ! diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index 66b20350a..82ae1e665 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -305,7 +305,7 @@ (template [<name> <bits> <type> <push> <wrap> <message> <to_long> <signed>] [(def: <name> Test - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (i64.and (i64.mask <bits>)) random.nat)] (<| (_.lifted <message>) (..bytecode (for {@.old @@ -383,7 +383,7 @@ instruction))))) shift (: (-> (-> java/lang/Integer java/lang/Integer java/lang/Integer) (Bytecode Any) (Random Bit)) (function (_ reference instruction) - (do {! random.monad} + (do [! random.monad] [parameter (\ ! each (|>> (n.% 32) .int (:as java/lang/Long) ffi.long_to_int) random.nat) subject ..$Integer::random] (int (reference parameter subject) @@ -462,7 +462,7 @@ instruction))))) shift (: (-> (-> java/lang/Integer java/lang/Long java/lang/Long) (Bytecode Any) (Random Bit)) (function (_ reference instruction) - (do {! random.monad} + (do [! random.monad] [parameter (\ ! each (|>> (n.% 64) (:as java/lang/Long)) random.nat) subject ..$Long::random] (long (reference (ffi.long_to_int parameter) subject) @@ -943,7 +943,7 @@ (-> a Any Bit) Test)) (function (_ constructor random literal [*store *load *wrap] test) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (|>> (n.% 1024) (n.max 1)) random.nat) value random] ($_ _.and @@ -1015,7 +1015,7 @@ (array (/.anewarray ..$String) $String::random $String::literal [/.aastore /.aaload /.nop] (function (_ expected) (|>> (:as Text) (text\= (:as Text expected)))))) (<| (_.context "multi") - (do {! random.monad} + (do [! random.monad] [.let [size (\ ! each (|>> (n.% 5) (n.+ 1)) random.nat)] dimensions size @@ -1029,7 +1029,7 @@ _ (recur (-- dimensions) (/type.array type))))]] (<| (_.lifted "MULTIANEWARRAY") (..bytecode (|>> (:as Nat) (n.= sizesH))) - (do {! /.monad} + (do [! /.monad] [_ (monad.each ! (|>> (:as java/lang/Long) ffi.long_to_int ..$Integer::literal) (#.Item sizesH sizesT)) _ (/.multianewarray type (|> dimensions /unsigned.u1 try.trusted)) @@ -1127,7 +1127,7 @@ (-> a (-> Any Bit)) (Random Bit))) (function (_ random_value literal *wrap [store load] test) - (do {! random.monad} + (do [! random.monad] [expected random_value register (\ ! each (n.% 128) random.nat)] (<| (..bytecode (test expected)) @@ -1151,7 +1151,7 @@ (_.lifted "ISTORE/ILOAD" (store_and_load ..$Integer::random ..$Integer::literal ..$Integer::wrap [/.istore /.iload] test)) (_.lifted "IINC" - (do {! random.monad} + (do [! random.monad] [base ..$Byte::random increment (\ ! each (|>> (n.% 100) /unsigned.u1 try.trusted) random.nat) @@ -1474,7 +1474,7 @@ Test ($_ _.and (<| (_.lifted "TABLESWITCH") - (do {! random.monad} + (do [! random.monad] [expected ..$Long::random dummy ..$Long::random minimum (\ ! each (|>> (n.% 100) .int /signed.s4 try.trusted) @@ -1495,7 +1495,7 @@ _ (/.set_label @return)] ..$Long::wrap)) (<| (_.lifted "LOOKUPSWITCH") - (do {! random.monad} + (do [! random.monad] [options (\ ! each (|>> (n.% 10) (n.+ 1)) random.nat) choice (\ ! each (n.% options) random.nat) diff --git a/stdlib/source/test/lux/test.lux b/stdlib/source/test/lux/test.lux index a28c37cf7..f4f9477eb 100644 --- a/stdlib/source/test/lux/test.lux +++ b/stdlib/source/test/lux/test.lux @@ -30,7 +30,7 @@ (def: assertion /.Test - (do {! random.monad} + (do [! random.monad] [expected_message/0 (random.ascii/lower 5) expected_message/1 (random.only (|>> (text\= expected_message/0) not) (random.ascii/lower 5))] @@ -63,7 +63,7 @@ (def: seed /.Test - (do {! random.monad} + (do [! random.monad] [seed random.nat .let [[read write] (: [(async.Async Nat) (async.Resolver Nat)] (async.async []))] @@ -90,7 +90,7 @@ (def: times /.Test ($_ /.and - (do {! random.monad} + (do [! random.monad] [times_assertion (/.times 0 (/.test "" true))] (in (do async.monad [[tally error] times_assertion] @@ -98,7 +98,7 @@ (and (text.contains? (value@ #exception.label /.must_try_test_at_least_once) error) (n.= 0 (value@ #/.successes tally)) (n.= 1 (value@ #/.failures tally))))))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> (n.% 10) ++) random.nat) .let [counter (: (Atom Nat) (atom.atom 0))] @@ -119,7 +119,7 @@ (def: in_parallel /.Test ($_ /.and - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> (n.% 10) ++) random.nat) .let [counter (: (Atom Nat) (atom.atom 0))] @@ -137,7 +137,7 @@ (and (n.= expected actual) (n.= expected (value@ #/.successes tally)) (n.= 0 (value@ #/.failures tally))))))) - (do {! random.monad} + (do [! random.monad] [expected (\ ! each (|>> (n.% 10) ++) random.nat) .let [counter (: (Atom Nat) (atom.atom 0))] @@ -219,7 +219,7 @@ /.Test (<| (/.covering /._) (/.for [/.Test]) - (do {! random.monad} + (do [! random.monad] [expected_context (random.ascii/lower 5) expected_message/0 (random.only (|>> (text\= expected_context) not) (random.ascii/lower 5)) diff --git a/stdlib/source/test/lux/time.lux b/stdlib/source/test/lux/time.lux index 50d0a82b8..70e3204e6 100644 --- a/stdlib/source/test/lux/time.lux +++ b/stdlib/source/test/lux/time.lux @@ -47,7 +47,7 @@ (def: for_clock Test - (do {! random.monad} + (do [! random.monad] [expected random.time] (_.cover [/.clock /.time] (|> expected @@ -58,7 +58,7 @@ (def: for_ranges Test - (do {! random.monad} + (do [! random.monad] [valid_hour (\ ! each (|>> (n.% /.hours) (n.max 10)) random.nat) valid_minute (\ ! each (|>> (n.% /.minutes) (n.max 10)) random.nat) valid_second (\ ! each (|>> (n.% /.seconds) (n.max 10)) random.nat) @@ -110,7 +110,7 @@ Test (<| (_.covering /._) (_.for [/.Time]) - (do {! random.monad} + (do [! random.monad] [.let [day (.nat (duration.millis duration.day))] expected random.time diff --git a/stdlib/source/test/lux/time/date.lux b/stdlib/source/test/lux/time/date.lux index 83eafabf9..3cf3750e7 100644 --- a/stdlib/source/test/lux/time/date.lux +++ b/stdlib/source/test/lux/time/date.lux @@ -76,7 +76,7 @@ (<text>.result /.parser) (try\each (\ /.equivalence = expected)) (try.else false)))) - (do {! random.monad} + (do [! random.monad] [year (\ ! each (|>> (n.% 10,000) ++) random.nat) month (\ ! each (|>> (n.% 10) (n.+ 13)) diff --git a/stdlib/source/test/lux/time/duration.lux b/stdlib/source/test/lux/time/duration.lux index 72bf426fc..f0caba5e0 100644 --- a/stdlib/source/test/lux/time/duration.lux +++ b/stdlib/source/test/lux/time/duration.lux @@ -63,7 +63,7 @@ factor random.nat] (_.cover [/.up /.down] (|> /.milli_second (/.up factor) (/.down factor) (\= /.milli_second)))) - (do {! random.monad} + (do [! random.monad] [.let [(^open "\.") /.order positive (|> random.duration (random.only (|>> (\= /.empty) not)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux index 9f9a5f000..64aa4c58f 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux @@ -62,7 +62,7 @@ (^template [<tag> <gen> <wrapper>] [[_ (<tag> _)] (if allow_literals? - (do {! r.monad} + (do [! r.monad] [?sample (r.maybe <gen>)] (case ?sample (#.Some sample) @@ -83,7 +83,7 @@ (r\in (list (' []))) [_ (#.Tuple members)] - (do {! r.monad} + (do [! r.monad] [member_wise_patterns (monad.each ! (exhaustive_branches allow_literals? variantTC) members)] (in (|> member_wise_patterns exhaustive_weaving @@ -93,7 +93,7 @@ (r\in (list (' {}))) [_ (#.Record kvs)] - (do {! r.monad} + (do [! r.monad] [.let [ks (list\each product.left kvs) vs (list\each product.right kvs)] member_wise_patterns (monad.each ! (exhaustive_branches allow_literals? variantTC) vs)] @@ -102,7 +102,7 @@ (list\each (|>> (list.zipped/2 ks) code.record))))) (^ [_ (#.Form (list [_ (#.Tag _)] _))]) - (do {! r.monad} + (do [! r.monad] [bundles (monad.each ! (function (_ [_tag _code]) (do ! @@ -122,12 +122,12 @@ (function (_ input) ($_ r.either (r\each product.right _primitive.primitive) - (do {! r.monad} + (do [! r.monad] [choice (|> r.nat (\ ! each (n.% (list.size variant_tags)))) .let [choiceT (maybe.trusted (list.item choice variant_tags)) choiceC (maybe.trusted (list.item choice primitivesC))]] (in (` ((~ choiceT) (~ choiceC))))) - (do {! r.monad} + (do [! r.monad] [size (|> r.nat (\ ! each (n.% 3))) elems (r.list size input)] (in (code.tuple elems))) @@ -140,7 +140,7 @@ (def: .public test (<| (_.context (name.module (name_of /._))) - (do {! r.monad} + (do [! r.monad] [module_name (r.unicode 5) variant_name (r.unicode 5) record_name (|> (r.unicode 5) (r.only (|>> (text\= variant_name) not))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux index 55e7925fb..229e27bee 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux @@ -80,7 +80,7 @@ )))) (def: apply - (do {! r.monad} + (do [! r.monad] [full_args (|> r.nat (\ ! each (|>> (n.% 10) (n.max 2)))) partial_args (|> r.nat (\ ! each (n.% full_args))) var_idx (|> r.nat (\ ! each (|>> (n.% full_args) (n.max 1)))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux index 1bbec4721..d33dcef00 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux @@ -50,7 +50,7 @@ (def: (reach_test var_name [export? def_module] [import? dependent_module] check!) (-> Text [Bit Text] [Bit Text] Check Bit) - (|> (do {! phase.monad} + (|> (do [! phase.monad] [_ (//module.with_module 0 def_module (//module.define var_name (#.Right [export? Any (' {}) []])))] (//module.with_module 0 dependent_module diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux index 5f1f89442..27fc4ac73 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux @@ -118,7 +118,7 @@ false))) (def: sum - (do {! r.monad} + (do [! r.monad] [size (|> r.nat (\ ! each (|>> (n.% 10) (n.max 2)))) choice (|> r.nat (\ ! each (n.% size))) primitives (r.list size _primitive.primitive) @@ -170,7 +170,7 @@ )))) (def: product - (do {! r.monad} + (do [! r.monad] [size (|> r.nat (\ ! each (|>> (n.% 10) (n.max 2)))) primitives (r.list size _primitive.primitive) choice (|> r.nat (\ ! each (n.% size))) @@ -230,7 +230,7 @@ )))) (def: variant - (do {! r.monad} + (do [! r.monad] [size (|> r.nat (\ ! each (|>> (n.% 10) (n.max 2)))) tags (|> (r.set text.hash size (r.unicode 5)) (\ ! each set.list)) choice (|> r.nat (\ ! each (n.% size))) @@ -276,7 +276,7 @@ )))) (def: record - (do {! r.monad} + (do [! r.monad] [size (|> r.nat (\ ! each (|>> (n.% 10) (n.max 2)))) tags (|> (r.set text.hash size (r.unicode 5)) (\ ! each set.list)) primitives (r.list size _primitive.primitive) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux index 4a6dc9af2..7e1c56eb0 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux @@ -72,7 +72,7 @@ (def: i64 Test - (do {! r.monad} + (do [! r.monad] [subjectC (|> r.nat (\ ! each code.nat)) signedC (|> r.int (\ ! each code.int)) paramC (|> r.nat (\ ! each code.nat))] @@ -99,7 +99,7 @@ (def: int Test - (do {! r.monad} + (do [! r.monad] [subjectC (|> r.int (\ ! each code.int)) paramC (|> r.int (\ ! each code.int))] ($_ _.and @@ -119,7 +119,7 @@ (def: frac Test - (do {! r.monad} + (do [! r.monad] [subjectC (|> r.safe_frac (\ ! each code.frac)) paramC (|> r.safe_frac (\ ! each code.frac)) encodedC (|> r.safe_frac (\ ! each (|>> %.frac code.text)))] @@ -154,7 +154,7 @@ (def: text Test - (do {! r.monad} + (do [! r.monad] [subjectC (|> (r.unicode 5) (\ ! each code.text)) paramC (|> (r.unicode 5) (\ ! each code.text)) replacementC (|> (r.unicode 5) (\ ! each code.text)) @@ -179,7 +179,7 @@ (def: io Test - (do {! r.monad} + (do [! r.monad] [logC (|> (r.unicode 5) (\ ! each code.text)) exitC (|> r.int (\ ! each code.int))] ($_ _.and diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux index 382758101..7b2b5de92 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -41,7 +41,7 @@ (def: masking_test Test - (do {! random.monad} + (do [! random.monad] [maskedA //primitive.primitive temp (|> random.nat (\ ! each (n.% 100))) .let [maskA (analysis.control/case @@ -109,7 +109,7 @@ (def: random_member (Random synthesis.Member) - (do {! random.monad} + (do [! random.monad] [lefts (|> random.nat (\ ! each (n.% 10))) right? random.bit] (in (if right? @@ -118,7 +118,7 @@ (def: random_path (Random (analysis.Tuple synthesis.Member)) - (do {! random.monad} + (do [! random.monad] [size_1 (|> random.nat (\ ! each (|>> (n.% 10) ++)))] (random.list size_1 ..random_member))) @@ -144,7 +144,7 @@ (def: get_test Test - (do {! random.monad} + (do [! random.monad] [recordA (|> random.nat (\ ! each (|>> analysis.nat)) (random.list 10) @@ -167,7 +167,7 @@ (def: random_bit (Random [Path Match]) - (do {! random.monad} + (do [! random.monad] [test random.bit then random.nat else random.nat] @@ -194,7 +194,7 @@ (template [<name> <hash> <random> <path> <synthesis> <pattern> <analysis>] [(def: <name> (Random [Path Match]) - (do {! random.monad} + (do [! random.monad] [[test/0 test/1 test/2 test/3 test/4] (random_five <hash> <random>) [body/0 body/1 body/2 body/3 body/4] (random_five <hash> <random>)] (in [($_ #synthesis.Alt @@ -228,7 +228,7 @@ (def: random_variant (Random [Path Match]) - (do {! random.monad} + (do [! random.monad] [[lefts/0 lefts/1 lefts/2 lefts/3 lefts/4] (random_five n.hash random.nat) [value/0 value/1 value/2 value/3 value/4] (random_five text.hash (random.unicode 1)) last_is_right? random.bit @@ -261,7 +261,7 @@ (def: random_tuple (Random [Path Match]) - (do {! random.monad} + (do [! random.monad] [mid_size (\ ! each (n.% 4) random.nat) value/first (random.unicode 1) @@ -327,7 +327,7 @@ (def: case_test Test - (do {! random.monad} + (do [! random.monad] [expected_input (\ ! each (|>> .i64 synthesis.i64) random.nat) [expected_path match] ..random_case] (_.cover [/.synthesize_case] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux index a975fc269..5cfa2b66e 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux @@ -88,7 +88,7 @@ (template [<name> <random> <synthesis> <analysis>] [(def: (<name> output?) Scenario - (do {! random.monad} + (do [! random.monad] [value <random>] (in [true (<synthesis> value) @@ -114,7 +114,7 @@ (def: (random_variant random_value output?) (-> Scenario Scenario) - (do {! random.monad} + (do [! random.monad] [lefts random.nat right? random.bit [loop? expected_value actual_value] (random_value false)] @@ -130,7 +130,7 @@ (def: (random_tuple random_value output?) (-> Scenario Scenario) - (do {! random.monad} + (do [! random.monad] [[loop?_left expected_left actual_left] (random_value false) [loop?_right expected_right actual_right] (random_value false)] (in [(and loop?_left @@ -146,7 +146,7 @@ (def: (random_variable arity output?) (-> Arity Scenario) - (do {! random.monad} + (do [! random.monad] [register (\ ! each (|>> (n.% arity) ++) random.nat)] (in [(not (n.= 0 register)) (synthesis.variable/local register) @@ -156,7 +156,7 @@ (def: (random_constant output?) Scenario - (do {! random.monad} + (do [! random.monad] [module (random.unicode 1) short (random.unicode 1)] (in [true @@ -170,7 +170,7 @@ (def: (random_case arity random_value output?) (-> Arity Scenario Scenario) - (do {! random.monad} + (do [! random.monad] [bit_test random.bit i64_test random.nat f64_test random.frac @@ -238,7 +238,7 @@ (def: (random_let arity random_value output?) (-> Arity Scenario Scenario) - (do {! random.monad} + (do [! random.monad] [[loop?_input expected_input actual_input] (random_value false) [loop?_output expected_output actual_output] (random_value output?)] (in [(and loop?_input @@ -253,7 +253,7 @@ (def: (random_if random_value output?) (-> Scenario Scenario) - (do {! random.monad} + (do [! random.monad] [[loop?_test expected_test actual_test] (random_value false) [loop?_then expected_then actual_then] (random_value output?) [loop?_else expected_else actual_else] (random_value output?) @@ -278,7 +278,7 @@ (def: (random_get random_value output?) (-> Scenario Scenario) - (do {! random.monad} + (do [! random.monad] [lefts (|> random.nat (\ ! each (n.% 10))) right? random.bit [loop?_record expected_record actual_record] (random_value false)] @@ -305,7 +305,7 @@ (def: (random_recur arity random_value output?) (-> Arity Scenario Scenario) - (do {! random.monad} + (do [! random.monad] [resets (random.list arity (random_value false))] (in [true (synthesis.loop/recur (list\each (|>> product.right product.left) resets)) @@ -316,7 +316,7 @@ (def: (random_scope arity output?) (-> Arity Scenario) - (do {! random.monad} + (do [! random.monad] [resets (random.list arity (..random_variable arity output?)) [_ expected_output actual_output] (..random_nat output?)] (in [(list\mix (function (_ new old) @@ -341,7 +341,7 @@ (def: (random_abstraction' output?) Scenario - (do {! random.monad} + (do [! random.monad] [[loop?_output expected_output actual_output] (..random_nat output?) arity (|> random.nat (\ ! each (|>> (n.% 5) ++))) .let [environment ($_ list\composite @@ -361,7 +361,7 @@ (def: (random_apply random_value output?) (-> Scenario Scenario) - (do {! random.monad} + (do [! random.monad] [[loop?_abstraction expected_abstraction actual_abstraction] (..random_nat output?) arity (|> random.nat (\ ! each (|>> (n.% 5) ++))) inputs (random.list arity (random_value false))] @@ -393,7 +393,7 @@ (def: (random_extension random_value output?) (-> Scenario Scenario) - (do {! random.monad} + (do [! random.monad] [name (random.unicode 1) [loop?_first expected_first actual_first] (random_value false) [loop?_second expected_second actual_second] (random_value false) @@ -418,7 +418,7 @@ (def: random_abstraction (Random [Synthesis Analysis]) - (do {! random.monad} + (do [! random.monad] [arity (|> random.nat (\ ! each (|>> (n.% 5) ++))) [loop? expected_body actual_body] (random_body arity true)] (in [(..n_function loop? arity expected_body) @@ -437,7 +437,7 @@ (def: application Test - (do {! random.monad} + (do [! random.monad] [arity (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1)))) funcA //primitive.primitive argsA (random.list arity //primitive.primitive)] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux index 652465a83..486dfa570 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux @@ -30,7 +30,7 @@ (Scenario Synthesis) (`` ($_ random.either (~~ (template [<synthesis> <random>] - [(do {! random.monad} + [(do [! random.monad] [example (\ ! each (|>> <synthesis>) <random>)] (in [next [example @@ -54,7 +54,7 @@ (def: (variable offset arity next) (Scenario Variable) - (let [local (do {! random.monad} + (let [local (do [! random.monad] [register (\ ! each (|>> (n.% arity) ++) random.nat)] (in [next [(#variable.Local (/.register_optimization offset register)) @@ -63,7 +63,7 @@ 0 local _ ($_ random.either local - (do {! random.monad} + (do [! random.monad] [foreign (\ ! each (n.% offset) random.nat)] (in [next [(#variable.Local foreign) @@ -73,7 +73,7 @@ (Scenario Synthesis) (`` ($_ random.either (~~ (template [<tag> <random>] - [(do {! random.monad} + [(do [! random.monad] [[next [exampleE exampleA]] (<random> offset arity next)] (in [next [(<tag> exampleE) @@ -86,7 +86,7 @@ (def: (structure offset arity next) (Scenario Synthesis) ($_ random.either - (do {! random.monad} + (do [! random.monad] [lefts random.nat right? random.bit [next [valueE valueA]] (..reference offset arity next)] @@ -99,7 +99,7 @@ [#analysis.lefts lefts #analysis.right? right? #analysis.value valueA])]])) - (do {! random.monad} + (do [! random.monad] [[next [leftE leftA]] (..reference offset arity next) [next [rightE rightA]] (..reference offset arity next)] (in [next @@ -116,7 +116,7 @@ [//.path/pop //.path/pop]]) (~~ (template [<path> <random>] - [(do {! random.monad} + [(do [! random.monad] [example (\ ! each (|>> <path>) <random>)] (in [next [example @@ -128,7 +128,7 @@ [//.path/text (random.unicode 1)] )) (~~ (template [<path>] - [(do {! random.monad} + [(do [! random.monad] [example (\ ! each (|>> <path>) (random.or random.nat random.nat))] @@ -166,13 +166,13 @@ random.nat))] ($_ random.either ($_ random.either - (do {! random.monad} + (do [! random.monad] [[next [inputE inputA]] (..reference offset arity next) [next [bodyE bodyA]] (..reference offset arity next)] (in [next [(//.branch/let [inputE (/.register_optimization offset next) bodyE]) (//.branch/let [inputA next bodyA])]])) - (do {! random.monad} + (do [! random.monad] [[next [testE testA]] (..reference offset arity next) [next [thenE thenA]] (..reference offset arity next) [next [elseE elseA]] (..reference offset arity next)] @@ -180,14 +180,14 @@ [(//.branch/if [testE thenE elseE]) (//.branch/if [testA thenA elseA])]]))) ($_ random.either - (do {! random.monad} + (do [! random.monad] [[next [recordE recordA]] (..reference offset arity next) path_length (\ ! each (|>> (n.% 5) ++) random.nat) path (random.list path_length random_member)] (in [next [(//.branch/get [path recordE]) (//.branch/get [path recordA])]])) - (do {! random.monad} + (do [! random.monad] [[next [inputE inputA]] (..reference offset arity next) [next [pathE pathA]] (..path offset arity next)] (in [next @@ -216,7 +216,7 @@ (def: (function offset arity next) (Scenario Synthesis) ($_ random.either - (do {! random.monad} + (do [! random.monad] [[next [firstE firstA]] (..variable offset arity next) [next [secondE secondA]] (..variable offset arity next) arity (\ ! each (n.max 1) random.nat) @@ -265,7 +265,7 @@ Test (<| (_.covering /._) ($_ _.and - (do {! random.monad} + (do [! random.monad] [expected_offset (\ ! each (|>> (n.% 5) (n.+ 2)) random.nat) arity (\ ! each (|>> (n.% 5) ++) random.nat) expected_inits (|> random.nat diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux index 3ff107daa..b132e1027 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux @@ -35,7 +35,7 @@ (def: variant Test - (do {! r.monad} + (do [! r.monad] [size (|> r.nat (\ ! each (|>> (n.% 10) (n.+ 2)))) tagA (|> r.nat (\ ! each (n.% size))) .let [right? (n.= (-- size) tagA) @@ -58,7 +58,7 @@ (def: tuple Test - (do {! r.monad} + (do [! r.monad] [size (|> r.nat (\ ! each (|>> (n.% 10) (n.max 2)))) membersA (r.list size //primitive.primitive)] (_.test "Can synthesize tuple." diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux index 531c792e5..7f6ed6bc5 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux @@ -44,7 +44,7 @@ (template [<name> <synthesis> <random>] [(def: (<name> context) (Scenario Synthesis) - (do {! random.monad} + (do [! random.monad] [value <random>] (in [(<synthesis> value) (<synthesis> value)])))] @@ -64,7 +64,7 @@ (def: (with_redundancy scenario context) (-> (Scenario Synthesis) (Scenario Synthesis)) - (do {! random.monad} + (do [! random.monad] [redundant? random.bit] (if redundant? (do ! @@ -86,7 +86,7 @@ (def: (variant_scenario scenario context) (-> (Scenario Synthesis) (Scenario Synthesis)) - (do {! random.monad} + (do [! random.monad] [lefts random.nat right? random.bit [expected input] (scenario context)] @@ -142,7 +142,7 @@ (def: (get_scenario scenario context) (-> (Scenario Synthesis) (Scenario Synthesis)) - (do {! random.monad} + (do [! random.monad] [length (\ ! each (|>> (n.% 5) ++) random.nat) path (random.list length ..random_member) [expected_record actual_record] (scenario context)] @@ -157,14 +157,14 @@ (-> (Scenario Synthesis) (Scenario Path)) (`` ($_ random.either ($_ random.either - (do {! random.monad} + (do [! random.monad] [_ (in []) [expected_then actual_then] (scenario context)] (in [(#synthesis.Seq #synthesis.Pop (#synthesis.Then expected_then)) (#synthesis.Seq #synthesis.Pop (#synthesis.Then actual_then))])) - (do {! random.monad} + (do [! random.monad] [_ (in []) .let [real_register (dictionary.size (value@ #necessary context)) fake_register (n.+ (value@ #redundants context) @@ -178,7 +178,7 @@ (#synthesis.Then actual_then)))]))) ($_ random.either (~~ (template [<tag> <random>] - [(do {! random.monad} + [(do [! random.monad] [test <random> [expected_then actual_then] (scenario context)] (in [(#synthesis.Seq (#synthesis.Test (<tag> test)) @@ -192,21 +192,21 @@ [#synthesis.Text (random.unicode 1)] ))) ($_ random.either - (do {! random.monad} + (do [! random.monad] [side ..random_side [expected_next actual_next] (path_scenario scenario context)] (in [(#synthesis.Seq (#synthesis.Access (#synthesis.Side side)) expected_next) (#synthesis.Seq (#synthesis.Access (#synthesis.Side side)) actual_next)])) - (do {! random.monad} + (do [! random.monad] [member ..random_member [expected_next actual_next] (path_scenario scenario context)] (in [(#synthesis.Seq (#synthesis.Access (#synthesis.Member member)) expected_next) (#synthesis.Seq (#synthesis.Access (#synthesis.Member member)) actual_next)]))) - (do {! random.monad} + (do [! random.monad] [_ (in []) [expected_left actual_left] (path_scenario scenario context) [expected_right actual_right] (path_scenario scenario context)] @@ -216,7 +216,7 @@ (def: (case_scenario scenario context) (-> (Scenario Synthesis) (Scenario Synthesis)) - (do {! random.monad} + (do [! random.monad] [_ (in []) [expected_input actual_input] (scenario context) [expected_path actual_path] (..path_scenario scenario context)] @@ -236,7 +236,7 @@ (def: (scope_scenario scenario context) (-> (Scenario Synthesis) (Scenario Synthesis)) - (do {! random.monad} + (do [! random.monad] [_ (in []) .let [real_start (dictionary.size (value@ #necessary context)) fake_start (n.+ (value@ #redundants context) @@ -256,7 +256,7 @@ (def: (recur_scenario scenario context) (-> (Scenario Synthesis) (Scenario Synthesis)) - (do {! random.monad} + (do [! random.monad] [_ (in []) resets (random.list ..scope_arity (scenario context))] (in [(synthesis.loop/recur (list\each product.left resets)) @@ -271,7 +271,7 @@ (def: (abstraction_scenario scenario context) (-> (Scenario Synthesis) (Scenario Synthesis)) - (do {! random.monad} + (do [! random.monad] [_ (in []) .let [registers (dictionary.entries (value@ #necessary context)) expected_environment (list\each (|>> product.left #variable.Local) registers) @@ -282,7 +282,7 @@ (def: (apply_scenario scenario context) (-> (Scenario Synthesis) (Scenario Synthesis)) - (do {! random.monad} + (do [! random.monad] [abstraction (\ ! each (|>> synthesis.constant) (random.and (random.unicode 1) (random.unicode 1))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux index b9709c14e..36cd99322 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux @@ -26,7 +26,7 @@ (def: name_part^ (Random Text) - (do {! r.monad} + (do [! r.monad] [size (|> r.nat (\ ! each (|>> (n.% 20) (n.max 1))))] (r.ascii/lower_alpha size))) @@ -73,7 +73,7 @@ (def: code Test - (do {! r.monad} + (do [! r.monad] [sample code^] ($_ _.and (_.test "Can parse Lux code." diff --git a/stdlib/source/test/lux/type.lux b/stdlib/source/test/lux/type.lux index ec32d7fe8..0ffd8ca7f 100644 --- a/stdlib/source/test/lux/type.lux +++ b/stdlib/source/test/lux/type.lux @@ -37,7 +37,7 @@ (def: short (Random Text) - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (n.% 10)))] (random.unicode size))) @@ -79,7 +79,7 @@ (_.for [/.equivalence] ($equivalence.spec /.equivalence (..random 0))) - (do {! random.monad} + (do [! random.monad] [anonymousT (random.only (|>> (case> (#.Named _ _) false _ true)) (..random 0)) @@ -92,7 +92,7 @@ (\ /.equivalence = namedT (/.de_aliased aliasedT))) (_.cover [/.anonymous] (\ /.equivalence = anonymousT (/.anonymous aliasedT))))) - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (n.% 3))) members (|> (..random 0) (random.only (function (_ type) @@ -126,7 +126,7 @@ (in (\ /.equivalence = full (#.Product Bit Int))))) (|> (/.applied (list Bit) Text) (case> #.None #1 _ #0)))) - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (n.% 3))) members (monad.all ! (list.repeated size (..random 0))) extra (|> (..random 0) @@ -148,7 +148,7 @@ (let [[tfunc tparams] (|> extra (/.application members) /.flat_application)] (n.= (list.size members) (list.size tparams)))) )) - (do {! random.monad} + (do [! random.monad] [size (|> random.nat (\ ! each (|>> (n.% 3) ++))) body_type (|> (..random 0) (random.only (function (_ type) @@ -174,7 +174,7 @@ (|> body_type (/.univ_q size) /.quantified?) (|> body_type (/.ex_q size) /.quantified?))) ))) - (do {! random.monad} + (do [! random.monad] [depth (|> random.nat (\ ! each (|>> (n.% 3) ++))) element_type (|> (..random 0) (random.only (function (_ type) diff --git a/stdlib/source/test/lux/type/check.lux b/stdlib/source/test/lux/type/check.lux index d88cd4c95..1a3d50373 100644 --- a/stdlib/source/test/lux/type/check.lux +++ b/stdlib/source/test/lux/type/check.lux @@ -414,7 +414,7 @@ (def: (build_ring tail_size) (-> Nat (/.Check [Type (List Type) Type])) - (do {! /.monad} + (do [! /.monad] [[id/head var/head] /.var var/tail+ (monad.each ! (function (_ _) (do ! @@ -436,7 +436,7 @@ (succeeds? (..build_ring tail_size)) can_bind_rings_of_variables! - (succeeds? (do {! /.monad} + (succeeds? (do [! /.monad] [[var/head var/tail+ var/last] (..build_ring tail_size) _ (/.check var/head nominal/0) failures (monad.each ! (|>> (/.check nominal/1) ..verdict) (list& var/head var/tail+)) @@ -445,7 +445,7 @@ (list.every? (bit\= true) successes))))) can_merge_multiple_rings_of_variables! - (succeeds? (do {! /.monad} + (succeeds? (do [! /.monad] [[var/head/0 var/tail+/0 var/last/0] (..build_ring tail_size) [var/head/1 var/tail+/1 var/last/1] (..build_ring tail_size) _ (/.check var/head/0 var/head/1) @@ -610,7 +610,7 @@ (def: check Test - (do {! random.monad} + (do [! random.monad] [nominal ..nominal [name/0 name/1] (..non_twins text\= (random.ascii/upper 10)) [parameter/0 parameter/1] (..non_twins type\= ..nominal) @@ -657,13 +657,13 @@ [#.Function] [#.Apply] )) - (do {! random.monad} + (do [! random.monad] [name (random.ascii/upper 10) parameterT dirty_type] (in (function (_ holeT) (#.Primitive name (list (parameterT holeT)))))) (~~ (template [<tag>] - [(do {! random.monad} + [(do [! random.monad] [funcT dirty_type argT dirty_type body random.nat] diff --git a/stdlib/source/test/lux/type/implicit.lux b/stdlib/source/test/lux/type/implicit.lux index 88308baf4..ba60470c7 100644 --- a/stdlib/source/test/lux/type/implicit.lux +++ b/stdlib/source/test/lux/type/implicit.lux @@ -24,7 +24,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [.let [digit (\ ! each (n.% 10) random.nat)] left digit right digit diff --git a/stdlib/source/test/lux/type/poly/equivalence.lux b/stdlib/source/test/lux/type/poly/equivalence.lux index 551b0118c..8e03475f4 100644 --- a/stdlib/source/test/lux/type/poly/equivalence.lux +++ b/stdlib/source/test/lux/type/poly/equivalence.lux @@ -57,7 +57,7 @@ (def: random (Random Record) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 2) random.nat) .let [gen_int (|> random.int (\ ! each (|>> i.abs (i.% +1,000,000))))]] ($_ random.and diff --git a/stdlib/source/test/lux/type/poly/json.lux b/stdlib/source/test/lux/type/poly/json.lux index 75d7c3808..970a9bc46 100644 --- a/stdlib/source/test/lux/type/poly/json.lux +++ b/stdlib/source/test/lux/type/poly/json.lux @@ -90,7 +90,7 @@ (def: gen_record (Random Record) - (do {! random.monad} + (do [! random.monad] [size (\ ! each (n.% 2) random.nat)] ($_ random.and random.bit diff --git a/stdlib/source/test/lux/type/refinement.lux b/stdlib/source/test/lux/type/refinement.lux index e919a93ca..1f44a90cf 100644 --- a/stdlib/source/test/lux/type/refinement.lux +++ b/stdlib/source/test/lux/type/refinement.lux @@ -27,7 +27,7 @@ Test (<| (_.covering /._) (_.for [/.Refined]) - (do {! random.monad} + (do [! random.monad] [raw random.nat modulus (\ ! each (|>> (n.% 10) (n.+ 2)) random.nat) .let [predicate (: (Predicate Nat) diff --git a/stdlib/source/test/lux/type/resource.lux b/stdlib/source/test/lux/type/resource.lux index b1e24d4dc..3e51c9964 100644 --- a/stdlib/source/test/lux/type/resource.lux +++ b/stdlib/source/test/lux/type/resource.lux @@ -28,7 +28,7 @@ (def: pure Test - (monad.do {! random.monad} + (monad.do [! random.monad] [pre (\ ! each %.nat random.nat) post (\ ! each %.nat random.nat) .let [! identity.monad]] @@ -70,7 +70,7 @@ (def: sync Test - (monad.do {! random.monad} + (monad.do [! random.monad] [pre (\ ! each %.nat random.nat) post (\ ! each %.nat random.nat) .let [! io.monad]] @@ -113,7 +113,7 @@ (def: async Test - (monad.do {! random.monad} + (monad.do [! random.monad] [pre (\ ! each %.nat random.nat) post (\ ! each %.nat random.nat) .let [! async.monad]] diff --git a/stdlib/source/test/lux/type/unit.lux b/stdlib/source/test/lux/type/unit.lux index c2e17b665..cf3ed5705 100644 --- a/stdlib/source/test/lux/type/unit.lux +++ b/stdlib/source/test/lux/type/unit.lux @@ -93,7 +93,7 @@ (def: scale Test - (do {! random.monad} + (do [! random.monad] [small (|> random.int (\ ! each (i.% +1,000)) (\ ! each (\ /.meter in))) diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux index 09312a7e2..d2c4703d3 100644 --- a/stdlib/source/test/lux/world/file.lux +++ b/stdlib/source/test/lux/world/file.lux @@ -18,7 +18,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [/ (random.ascii/upper 1)] ($_ _.and (_.for [/.mock] diff --git a/stdlib/source/test/lux/world/file/watch.lux b/stdlib/source/test/lux/world/file/watch.lux index 00406139e..52fa06325 100644 --- a/stdlib/source/test/lux/world/file/watch.lux +++ b/stdlib/source/test/lux/world/file/watch.lux @@ -67,7 +67,7 @@ (def: exception Test - (do {! random.monad} + (do [! random.monad] [directory (random.ascii/alpha 5) .let [[fs watcher] (/.mock "/")]] ($_ _.and @@ -91,7 +91,7 @@ (def: (no_events_prior_to_creation! fs watcher directory) (-> (//.System Async) (/.Watcher Async) //.Path (Async (Try Bit))) - (do {! (try.with async.monad)} + (do [! (try.with async.monad)] [_ (\ fs make_directory directory) _ (\ watcher start /.all directory)] (|> (\ watcher poll []) @@ -157,14 +157,14 @@ ..concern\\test ..exception - (do {! random.monad} + (do [! random.monad] [directory (random.ascii/alpha 5) .let [/ "/" [fs watcher] (/.mock /)] expected_path (\ ! each (|>> (format directory /)) (random.ascii/alpha 5)) data ($binary.random 10)] - (in (do {! async.monad} + (in (do [! async.monad] [verdict (do (try.with !) [no_events_prior_to_creation! (..no_events_prior_to_creation! fs watcher directory) diff --git a/stdlib/source/test/lux/world/input/keyboard.lux b/stdlib/source/test/lux/world/input/keyboard.lux index 38ff5feb5..9abbbb7cd 100644 --- a/stdlib/source/test/lux/world/input/keyboard.lux +++ b/stdlib/source/test/lux/world/input/keyboard.lux @@ -139,7 +139,7 @@ (def: .public random (Random /.Key) (let [count (list.size ..listing)] - (do {! random.monad} + (do [! random.monad] [choice (\ ! each (n.% count) random.nat)] (in (maybe.trusted (list.item choice ..listing)))))) diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux index 851f95002..b2999b74d 100644 --- a/stdlib/source/test/lux/world/net/http/client.lux +++ b/stdlib/source/test/lux/world/net/http/client.lux @@ -31,7 +31,7 @@ Test (<| (_.covering /._) (_.for [/.Client]) - (do {! random.monad} + (do [! random.monad] [on_post random.nat on_get random.nat on_put random.nat diff --git a/stdlib/source/test/lux/world/output/video/resolution.lux b/stdlib/source/test/lux/world/output/video/resolution.lux index 6367ff652..59a46f103 100644 --- a/stdlib/source/test/lux/world/output/video/resolution.lux +++ b/stdlib/source/test/lux/world/output/video/resolution.lux @@ -46,7 +46,7 @@ (def: .public random (Random /.Resolution) (let [count (list.size ..listing)] - (do {! random.monad} + (do [! random.monad] [choice (\ ! each (n.% count) random.nat)] (in (maybe.trusted (list.item choice ..listing)))))) diff --git a/stdlib/source/test/lux/world/program.lux b/stdlib/source/test/lux/world/program.lux index 1160ab879..4b1c4ba22 100644 --- a/stdlib/source/test/lux/world/program.lux +++ b/stdlib/source/test/lux/world/program.lux @@ -41,7 +41,7 @@ (def: .public test Test (<| (_.covering /._) - (do {! random.monad} + (do [! random.monad] [env_size (\ ! each (|>> (n.% 10) ++) random.nat) environment (..environment env_size) home ..path diff --git a/stdlib/source/test/lux/world/shell.lux b/stdlib/source/test/lux/world/shell.lux index a57d8d5e8..250f7f9b2 100644 --- a/stdlib/source/test/lux/world/shell.lux +++ b/stdlib/source/test/lux/world/shell.lux @@ -96,7 +96,7 @@ destruction (random.ascii/alpha 5) exit random.int .let [shell (/.async (..io_shell command oops input destruction exit))]] - (in (do {! async.monad} + (in (do [! async.monad] [verdict (do (try.with !) [process (\ shell execute [environment.empty "~" command (list)]) read (\ process read []) |