diff options
Diffstat (limited to '')
8 files changed, 25 insertions, 25 deletions
diff --git a/stdlib/source/test/lux/tool/compiler/phase/analysis/case.lux b/stdlib/source/test/lux/tool/compiler/phase/analysis/case.lux index 1a74a3cf2..1ca4718c1 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/analysis/case.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/analysis/case.lux @@ -57,7 +57,7 @@ (^template [<tag> <gen> <wrapper>] [_ (<tag> _)] (if allow-literals? - (do r.monad + (do {@ r.monad} [?sample (r.maybe <gen>)] (case ?sample (#.Some sample) @@ -78,7 +78,7 @@ (r@wrap (list (' []))) [_ (#.Tuple members)] - (do r.monad + (do {@ r.monad} [member-wise-patterns (monad.map @ (exhaustive-branches allow-literals? variantTC) members)] (wrap (|> member-wise-patterns exhaustive-weaving @@ -88,7 +88,7 @@ (r@wrap (list (' {}))) [_ (#.Record kvs)] - (do r.monad + (do {@ r.monad} [#let [ks (list@map product.left kvs) vs (list@map product.right kvs)] member-wise-patterns (monad.map @ (exhaustive-branches allow-literals? variantTC) vs)] @@ -97,7 +97,7 @@ (list@map (|>> (list.zip2 ks) code.record))))) (^ [_ (#.Form (list [_ (#.Tag _)] _))]) - (do r.monad + (do {@ r.monad} [bundles (monad.map @ (function (_ [_tag _code]) (do @ @@ -117,12 +117,12 @@ (function (_ input) ($_ r.either (r@map product.right _primitive.primitive) - (do r.monad + (do {@ r.monad} [choice (|> r.nat (:: @ map (n.% (list.size variant-tags)))) #let [choiceT (maybe.assume (list.nth choice variant-tags)) choiceC (maybe.assume (list.nth choice primitivesC))]] (wrap (` ((~ choiceT) (~ choiceC))))) - (do r.monad + (do {@ r.monad} [size (|> r.nat (:: @ map (n.% 3))) elems (r.list size input)] (wrap (code.tuple elems))) @@ -135,7 +135,7 @@ (def: #export 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.filter (|>> (text@= variant-name) not))) diff --git a/stdlib/source/test/lux/tool/compiler/phase/analysis/function.lux b/stdlib/source/test/lux/tool/compiler/phase/analysis/function.lux index 721e17b14..fc07f8963 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/analysis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/analysis/function.lux @@ -75,7 +75,7 @@ )))) (def: apply - (do r.monad + (do {@ r.monad} [full-args (|> r.nat (:: @ map (|>> (n.% 10) (n.max 2)))) partial-args (|> r.nat (:: @ map (n.% full-args))) var-idx (|> r.nat (:: @ map (|>> (n.% full-args) (n.max 1)))) diff --git a/stdlib/source/test/lux/tool/compiler/phase/analysis/reference.lux b/stdlib/source/test/lux/tool/compiler/phase/analysis/reference.lux index 1c23b1c8a..9cb0c1170 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/analysis/reference.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/analysis/reference.lux @@ -45,7 +45,7 @@ (def: (reach-test var-name [export? def-module] [import? dependent-module] check!) (-> Text [Bit Text] [Bit Text] Check Bit) - (|> (do ///.monad + (|> (do {@ ///.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/phase/analysis/structure.lux b/stdlib/source/test/lux/tool/compiler/phase/analysis/structure.lux index ad2233b26..05461adf6 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/analysis/structure.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/analysis/structure.lux @@ -113,7 +113,7 @@ false))) (def: sum - (do r.monad + (do {@ r.monad} [size (|> r.nat (:: @ map (|>> (n.% 10) (n.max 2)))) choice (|> r.nat (:: @ map (n.% size))) primitives (r.list size _primitive.primitive) @@ -165,7 +165,7 @@ )))) (def: product - (do r.monad + (do {@ r.monad} [size (|> r.nat (:: @ map (|>> (n.% 10) (n.max 2)))) primitives (r.list size _primitive.primitive) choice (|> r.nat (:: @ map (n.% size))) @@ -225,7 +225,7 @@ )))) (def: variant - (do r.monad + (do {@ r.monad} [size (|> r.nat (:: @ map (|>> (n.% 10) (n.max 2)))) tags (|> (r.set text.hash size (r.unicode 5)) (:: @ map set.to-list)) choice (|> r.nat (:: @ map (n.% size))) @@ -271,7 +271,7 @@ )))) (def: record - (do r.monad + (do {@ r.monad} [size (|> r.nat (:: @ map (|>> (n.% 10) (n.max 2)))) tags (|> (r.set text.hash size (r.unicode 5)) (:: @ map set.to-list)) primitives (r.list size _primitive.primitive) diff --git a/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/lux.lux b/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/lux.lux index c659d9db0..df4e5a7e5 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/lux.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/lux.lux @@ -67,7 +67,7 @@ (def: i64 Test - (do r.monad + (do {@ r.monad} [subjectC (|> r.nat (:: @ map code.nat)) signedC (|> r.int (:: @ map code.int)) paramC (|> r.nat (:: @ map code.nat))] @@ -94,7 +94,7 @@ (def: int Test - (do r.monad + (do {@ r.monad} [subjectC (|> r.int (:: @ map code.int)) paramC (|> r.int (:: @ map code.int))] ($_ _.and @@ -114,7 +114,7 @@ (def: frac Test - (do r.monad + (do {@ r.monad} [subjectC (|> r.safe-frac (:: @ map code.frac)) paramC (|> r.safe-frac (:: @ map code.frac)) encodedC (|> r.safe-frac (:: @ map (|>> %.frac code.text)))] @@ -149,7 +149,7 @@ (def: text Test - (do r.monad + (do {@ r.monad} [subjectC (|> (r.unicode 5) (:: @ map code.text)) paramC (|> (r.unicode 5) (:: @ map code.text)) replacementC (|> (r.unicode 5) (:: @ map code.text)) @@ -174,7 +174,7 @@ (def: io Test - (do r.monad + (do {@ r.monad} [logC (|> (r.unicode 5) (:: @ map code.text)) exitC (|> r.int (:: @ map code.int))] ($_ _.and diff --git a/stdlib/source/test/lux/tool/compiler/phase/synthesis/case.lux b/stdlib/source/test/lux/tool/compiler/phase/synthesis/case.lux index 13418eba0..263f5e4a7 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/synthesis/case.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/synthesis/case.lux @@ -25,7 +25,7 @@ (def: dummy-vars Test - (do r.monad + (do {@ r.monad} [maskedA //primitive.primitive temp (|> r.nat (:: @ map (n.% 100))) #let [maskA (////analysis.control/case diff --git a/stdlib/source/test/lux/tool/compiler/phase/synthesis/function.lux b/stdlib/source/test/lux/tool/compiler/phase/synthesis/function.lux index 32044f5dc..1a4993c92 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/synthesis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/synthesis/function.lux @@ -35,7 +35,7 @@ (Random [Arity Analysis Analysis]) (r.rec (function (_ constant-function) - (do r.monad + (do {@ r.monad} [function? r.bit] (if function? (do @ @@ -53,7 +53,7 @@ (def: function-with-environment (Random [Arity Analysis Variable]) - (do r.monad + (do {@ r.monad} [num-locals (|> r.nat (:: @ map (|>> (n.% 100) (n.max 10)))) #let [indices (list.n/range 0 (dec num-locals)) local-env (list@map (|>> #////reference.Local) indices) @@ -102,7 +102,7 @@ (wrap [arity' (#////analysis.Function (list) bodyA) predictionA])) - (do r.monad + (do {@ r.monad} [chosen (|> r.nat (:: @ map (|>> (n.% 100) (n.max 2))))] (wrap [arity (#////analysis.Reference (////reference.local chosen)) @@ -149,7 +149,7 @@ (def: application Test - (do r.monad + (do {@ r.monad} [arity (|> r.nat (:: @ map (|>> (n.% 10) (n.max 1)))) funcA //primitive.primitive argsA (r.list arity //primitive.primitive)] diff --git a/stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux b/stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux index 087756562..d59065782 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux @@ -30,7 +30,7 @@ (def: variant Test - (do r.monad + (do {@ r.monad} [size (|> r.nat (:: @ map (|>> (n.% 10) (n.+ 2)))) tagA (|> r.nat (:: @ map (n.% size))) #let [right? (n.= (dec size) tagA) @@ -53,7 +53,7 @@ (def: tuple Test - (do r.monad + (do {@ r.monad} [size (|> r.nat (:: @ map (|>> (n.% 10) (n.max 2)))) membersA (r.list size //primitive.primitive)] (_.test "Can synthesize tuple." |