diff options
author | Eduardo Julian | 2022-03-14 18:27:37 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-03-14 18:27:37 -0400 |
commit | 41495e32d3f5f88b5f189f48dd4fdbfa883c6ac0 (patch) | |
tree | 7a561e83768d5ac4eb08855858dde38d2987fc46 /stdlib/source/test/lux/tool/compiler/language | |
parent | 62299ecdc93b39f6a22b1f89779f55dfa735fb3c (diff) |
De-sigil-ification: >
Diffstat (limited to '')
17 files changed, 407 insertions, 354 deletions
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux index 7ca3c4b12..eb623b548 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux @@ -8,7 +8,7 @@ [\\specification ["$[0]" equivalence]]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" function] ["[0]" maybe] ["[0]" try] @@ -272,52 +272,57 @@ (|> (/.failure expected_error) (phase.result [extension.#bundle extension.empty extension.#state state/0]) - (case> {try.#Failure actual_error} - (and (text.contains? expected_error actual_error) - (text.contains? (location.format location/0) actual_error)) + (pipe.case + {try.#Failure actual_error} + (and (text.contains? expected_error actual_error) + (text.contains? (location.format location/0) actual_error)) - _ - false))) + _ + false))) (_.cover [/.except] (|> (/.except <exception> []) (phase.result [extension.#bundle extension.empty extension.#state state/0]) - (case> {try.#Failure actual_error} - (and (text.contains? (exception.error <exception> []) actual_error) - (text.contains? (location.format location/0) actual_error)) + (pipe.case + {try.#Failure actual_error} + (and (text.contains? (exception.error <exception> []) actual_error) + (text.contains? (location.format location/0) actual_error)) - _ - false))) + _ + false))) (_.cover [/.with_exception] (|> (/.failure expected_error) (/.with_exception <exception> []) (phase.result [extension.#bundle extension.empty extension.#state state/0]) - (case> {try.#Failure actual_error} - (and (text.contains? expected_error actual_error) - (text.contains? (exception.error <exception> []) actual_error) - (text.contains? (location.format location/0) actual_error)) - - _ - false))) + (pipe.case + {try.#Failure actual_error} + (and (text.contains? expected_error actual_error) + (text.contains? (exception.error <exception> []) actual_error) + (text.contains? (location.format location/0) actual_error)) + + _ + false))) (_.cover [/.assertion] (and (|> (/.assertion <exception> [] false) (phase.result [extension.#bundle extension.empty extension.#state state/0]) - (case> {try.#Failure actual_error} - (and (text.contains? (exception.error <exception> []) actual_error) - (text.contains? (location.format location/0) actual_error)) + (pipe.case + {try.#Failure actual_error} + (and (text.contains? (exception.error <exception> []) actual_error) + (text.contains? (location.format location/0) actual_error)) - _ - false)) + _ + false)) (|> (/.assertion <exception> [] true) (phase.result [extension.#bundle extension.empty extension.#state state/0]) - (case> {try.#Success _} - true + (pipe.case + {try.#Success _} + true - _ - false)))) + _ + false)))) )))) (def: test|state @@ -370,11 +375,12 @@ (extension.read (|>> (the .#current_module) (maybe.else "")))) (phase.result [extension.#bundle extension.empty extension.#state state]) - (case> {try.#Success actual} - (same? expected_module actual) + (pipe.case + {try.#Success actual} + (same? expected_module actual) - _ - false))) + _ + false))) (_.cover [/.with_current_module] (let [current_module (extension.read (|>> (the .#current_module) (maybe.else "")))] (|> (do phase.monad @@ -396,11 +402,12 @@ (extension.read (the .#location))) (phase.result [extension.#bundle extension.empty extension.#state state]) - (case> {try.#Success actual} - (same? expected actual) + (pipe.case + {try.#Success actual} + (same? expected actual) - _ - false)))) + _ + false)))) (_.cover [/.with_location] (let [expected (/.location expected_file) dummy (/.location expected_code) @@ -424,11 +431,12 @@ (extension.read (the .#source))) (phase.result [extension.#bundle extension.empty extension.#state state]) - (case> {try.#Success actual} - (same? expected actual) + (pipe.case + {try.#Success actual} + (same? expected actual) - _ - false)))) + _ + false)))) (_.cover [/.with_source_code] (let [expected (/.source expected_file expected_code) dummy (/.source expected_code expected_file) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux index d8ae7a32e..e7e26bd54 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux @@ -8,7 +8,7 @@ [\\specification ["$[0]" equivalence]]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" try {"+" Try} ("[1]#[0]" functor)] ["[0]" exception {"+" Exception}]] [data @@ -116,14 +116,15 @@ (in [(|> coverages (list.only (|>> /.exhaustive? not)) list.reversed - (case> {.#End} - {/.#Exhaustive} - - {.#Item last prevs} - (list#mix (function (_ left right) - {/.#Seq left right}) - last - prevs))) + (pipe.case + {.#End} + {/.#Exhaustive} + + {.#Item last prevs} + (list#mix (function (_ left right) + {/.#Seq left right}) + last + prevs))) {//pattern.#Complex {//complex.#Tuple patterns}}])) (do random.monad @@ -239,7 +240,7 @@ [expected/2 pattern/2] (random.only ($_ predicate.and (|>> product.left (/#= expected/0) not) (|>> product.left (/#= expected/1) not) - (|>> product.left (case> {/.#Variant _} false _ true))) + (|>> product.left (pipe.case {/.#Variant _} false _ true))) ..random_value_pattern) bit random.bit diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux index e3dd8a53f..af025cb4d 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux @@ -7,7 +7,7 @@ [\\specification ["$[0]" equivalence]]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" maybe ("[1]#[0]" functor)] ["[0]" try ("[1]#[0]" functor)] ["[0]" exception]] @@ -87,12 +87,13 @@ (_.cover [/.expansion_failed] (|> (/.expansion ..expander name singular (list)) (meta.result lux) - (case> {try.#Failure it} - (and (text.contains? expected_error it) - (text.contains? (the exception.#label /.expansion_failed) it)) + (pipe.case + {try.#Failure it} + (and (text.contains? expected_error it) + (text.contains? (the exception.#label /.expansion_failed) it)) - _ - false))) + _ + false))) (_.cover [/.single_expansion] (|> (/.single_expansion ..expander name singular poly) (meta.result lux) @@ -101,9 +102,10 @@ (_.cover [/.must_have_single_expansion] (|> (/.single_expansion ..expander name multiple (list mono)) (meta.result lux) - (case> {try.#Failure it} - (text.contains? (the exception.#label /.must_have_single_expansion) it) + (pipe.case + {try.#Failure it} + (text.contains? (the exception.#label /.must_have_single_expansion) it) - _ - false))) + _ + false))) ))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux index 904bd4dd7..52ab6e6ff 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux @@ -5,7 +5,7 @@ [abstract ["[0]" monad {"+" do}]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" try ("[1]#[0]" functor)] ["[0]" exception]] [data @@ -121,12 +121,13 @@ (in it)) (/phase.result state) (try#each (|>> (the .#module_aliases) - (case> (^ (list [actual_alias actual_import])) - (and (same? expected_alias actual_alias) - (same? expected_import actual_import)) + (pipe.case + (^ (list [actual_alias actual_import])) + (and (same? expected_alias actual_alias) + (same? expected_import actual_import)) - _ - false))) + _ + false))) (try.else false))) ))) @@ -164,11 +165,12 @@ [_ (<pre> name)] (<post> name))) (/phase.result state) - (case> {try.#Success _} - false - - {try.#Failure error} - (text.contains? (the exception.#label /.can_only_change_state_of_active_module) error)))] + (pipe.case + {try.#Success _} + false + + {try.#Failure error} + (text.contains? (the exception.#label /.can_only_change_state_of_active_module) error)))] [/.set_compiled /.set_active] [/.set_compiled /.set_compiled] @@ -181,11 +183,12 @@ (and (~~ (template [<set>] [(|> (<set> name) (/phase.result state) - (case> {try.#Success _} - false - - {try.#Failure error} - (text.contains? (the exception.#label /.unknown_module) error)))] + (pipe.case + {try.#Success _} + false + + {try.#Failure error} + (text.contains? (the exception.#label /.unknown_module) error)))] [/.set_active] [/.set_compiled] @@ -221,8 +224,9 @@ [(|> (/.with hash module_name (/.define def_name <global>)) (/phase.result state) - (case> {try.#Success _} true - {try.#Failure _} false))] + (pipe.case + {try.#Success _} true + {try.#Failure _} false))] [definition] [{.#Type [public? def_type {.#Left [labels|head labels|tail]}]}] @@ -234,8 +238,9 @@ [_ (/.define def_name definition)] (/.define alias_name alias))) (/phase.result state) - (case> {try.#Success _} true - {try.#Failure _} false))))) + (pipe.case + {try.#Success _} true + {try.#Failure _} false))))) (_.cover [/.cannot_define_more_than_once] (`` (and (~~ (template [<global>] [(|> (/.with hash module_name @@ -243,8 +248,9 @@ [_ (/.define def_name <global>)] (/.define def_name <global>))) (/phase.result state) - (case> {try.#Success _} false - {try.#Failure _} true))] + (pipe.case + {try.#Success _} false + {try.#Failure _} true))] [{.#Definition [public? def_type []]}] [{.#Type [public? def_type {.#Left [labels|head labels|tail]}]}] @@ -257,8 +263,9 @@ _ (/.define alias_name alias)] (/.define alias_name alias))) (/phase.result state) - (case> {try.#Success _} false - {try.#Failure _} true))))) + (pipe.case + {try.#Success _} false + {try.#Failure _} true))))) ))) (def: test|label @@ -291,8 +298,9 @@ (monad.each ! (|>> [module_name] <query> /extension.lifted) (list& labels|head labels|tail)))) (/phase.result state) - (case> {try.#Success _} <on_success> - {try.#Failure _} (not <on_success>)))] + (pipe.case + {try.#Success _} <on_success> + {try.#Failure _} (not <on_success>)))] [.#Left false meta.tag true] [.#Left false meta.slot false] @@ -306,11 +314,12 @@ _ (/.define def_name {.#Type [public? it {<side> [labels|head labels|tail]}]})] (/.declare_labels <record?> (list& labels|head labels|tail) public? it))) (/phase.result state) - (case> {try.#Success _} - false - - {try.#Failure error} - (text.contains? (the exception.#label /.cannot_declare_labels_for_anonymous_type) error)))] + (pipe.case + {try.#Success _} + false + + {try.#Failure error} + (text.contains? (the exception.#label /.cannot_declare_labels_for_anonymous_type) error)))] [.#Left false] [.#Right true]))))) @@ -322,11 +331,12 @@ _ (/.define def_name {.#Type [public? it {<side> [labels|head labels|tail]}]})] (/.declare_labels <record?> (list& labels|head labels|tail) public? it))) (/phase.result state) - (case> {try.#Success _} - false - - {try.#Failure error} - (text.contains? (the exception.#label /.cannot_declare_labels_for_foreign_type) error)))] + (pipe.case + {try.#Success _} + false + + {try.#Failure error} + (text.contains? (the exception.#label /.cannot_declare_labels_for_foreign_type) error)))] [.#Left false] [.#Right true]))))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux index db4902b2b..faf28f47e 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux @@ -5,7 +5,7 @@ [abstract [monad {"+" do}]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" maybe ("[1]#[0]" functor)] ["[0]" try ("[1]#[0]" functor)] ["[0]" exception]] @@ -64,8 +64,9 @@ /.with (//phase.result state) (try#each (|>> product.right - (case> {.#None} true - {.#Some _} false))) + (pipe.case + {.#None} true + {.#Some _} false))) (try.else false))) (_.cover [/.with_local] (|> (/.with_local [name/0 type/0] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/type.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/type.lux index a5f1b5797..2a13b674c 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/type.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/type.lux @@ -5,7 +5,7 @@ [abstract [monad {"+" do}]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" try ("[1]#[0]" functor)]] [data ["[0]" product]] @@ -58,22 +58,25 @@ (/module.with 0 module) (/phase#each product.right) (/phase.result state) - (case> {try.#Success _} true - {try.#Failure _} false)) + (pipe.case + {try.#Success _} true + {try.#Failure _} false)) (|> (/.inference dummy) (/.expecting expected) (/module.with 0 module) (/phase#each product.right) (/phase.result state) - (case> {try.#Success _} false - {try.#Failure _} true)) + (pipe.case + {try.#Success _} false + {try.#Failure _} true)) (|> (/.inference expected) (/.expecting dummy) (/module.with 0 module) (/phase#each product.right) (/phase.result state) - (case> {try.#Success _} false - {try.#Failure _} true)))) + (pipe.case + {try.#Success _} false + {try.#Failure _} true)))) (_.cover [/.inferring] (|> (/.inference expected) /.inferring @@ -92,8 +95,9 @@ (/module.with 0 module) (/phase#each product.right) (/phase.result state) - (case> {try.#Success _} true - {try.#Failure _} false))) + (pipe.case + {try.#Success _} true + {try.#Failure _} false))) (_.cover [/.existential /.existential?] (|> (do /phase.monad [:it: /.existential] @@ -112,8 +116,9 @@ (/module.with 0 module) (/phase#each product.right) (/phase.result state) - (case> {try.#Success _} true - {try.#Failure _} false)) + (pipe.case + {try.#Success _} true + {try.#Failure _} false)) (|> (do /phase.monad [varT (/.check (do check.monad [[id type] check.var] @@ -124,6 +129,7 @@ (/module.with 0 module) (/phase#each product.right) (/phase.result state) - (case> {try.#Success _} false - {try.#Failure _} true)))) + (pipe.case + {try.#Success _} false + {try.#Failure _} true)))) )))) 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 b08ab36de..5fa0d281b 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 @@ -5,7 +5,6 @@ [abstract [monad {"+" do}]] [control - [pipe {"+" case>}] ["[0]" try {"+" Try} ("[1]#[0]" functor)] ["[0]" exception]] [data diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux index 203c7a46f..f27af5d36 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux @@ -5,7 +5,7 @@ [abstract [monad {"+" do}]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" maybe ("[1]#[0]" functor)] ["[0]" try {"+" Try} ("[1]#[0]" functor)] ["[0]" exception {"+" Exception}]] @@ -479,22 +479,24 @@ (//module.with 0 module) (//phase#each product.right) (//phase.result state) - (case> {try.#Success {.#Some actual}} - (let [(^open "list#[0]") (list.equivalence (product.equivalence symbol.equivalence code.equivalence))] - (list#= expected (list.reversed actual))) - - _ - false))))] + (pipe.case + {try.#Success {.#Some actual}} + (let [(^open "list#[0]") (list.equivalence (product.equivalence symbol.equivalence code.equivalence))] + (list#= expected (list.reversed actual))) + + _ + false))))] (and (normal? (list) (list)) (normal? expected_record global_record) (normal? expected_record local_record) (|> (/.normal false tuple) (//phase.result state) - (case> {try.#Success {.#None}} - true - - _ - false))))) + (pipe.case + {try.#Success {.#None}} + true + + _ + false))))) (_.cover [/.order] (let [local_record (list.zipped/2 (list#each (|>> [""]) slots/0) tuple) global_record (list.zipped/2 (list#each (|>> [module]) slots/0) tuple) @@ -507,22 +509,24 @@ (//module.with 0 module) (//phase#each (|>> product.right product.right)) (//phase.result state) - (case> {try.#Success {.#Some [actual_arity actual_tuple actual_type]}} - (and (n.= arity actual_arity) - (# code.equivalence = (code.tuple tuple) (code.tuple actual_tuple)) - (type#= :record: actual_type)) - - _ - false)))) + (pipe.case + {try.#Success {.#Some [actual_arity actual_tuple actual_type]}} + (and (n.= arity actual_arity) + (# code.equivalence = (code.tuple tuple) (code.tuple actual_tuple)) + (type#= :record: actual_type)) + + _ + false)))) unit? (: (-> Bit Bit) (function (_ pattern_matching?) (|> (/.order false (list)) (//phase.result state) - (case> (^ {try.#Success {.#Some [0 (list) actual_type]}}) - (same? .Any actual_type) + (pipe.case + (^ {try.#Success {.#Some [0 (list) actual_type]}}) + (same? .Any actual_type) - _ - false))))] + _ + false))))] (and (ordered? false global_record) (ordered? false (list.reversed global_record)) (ordered? false local_record) 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 dfc9ba28d..fd60e1de8 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 @@ -5,7 +5,6 @@ [abstract [monad {"+" do}]] [control - [pipe {"+" case>}] ["[0]" function] ["[0]" try ("[1]#[0]" functor)] ["[0]" exception]] 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 3c215c00b..45fef5649 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 @@ -5,7 +5,7 @@ [abstract [monad {"+" do}]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" try ("[1]#[0]" functor)] ["[0]" exception]] [data @@ -53,11 +53,12 @@ (//phase#each product.right) (//phase.result state) (try#each (|>> product.right - (case> (^ [actual_type (//analysis.local 0)]) - (type#= expected_type actual_type) + (pipe.case + (^ [actual_type (//analysis.local 0)]) + (type#= expected_type actual_type) - _ - false))) + _ + false))) (try.else false)) can_find_foreign_variable! @@ -71,11 +72,12 @@ (//phase.result state) (try#each (|>> product.right product.right - (case> (^ [actual_type (//analysis.foreign 0)]) - (type#= expected_type actual_type) + (pipe.case + (^ [actual_type (//analysis.foreign 0)]) + (type#= expected_type actual_type) - _ - false))) + _ + false))) (try.else false)) can_find_local_definition! @@ -86,13 +88,14 @@ (//module.with 0 expected_module) (//phase.result state) (try#each (|>> product.right - (case> (^ [actual_type (//analysis.constant [actual_module actual_name])]) - (and (type#= expected_type actual_type) - (same? expected_module actual_module) - (same? expected_name actual_name)) + (pipe.case + (^ [actual_type (//analysis.constant [actual_module actual_name])]) + (and (type#= expected_type actual_type) + (same? expected_module actual_module) + (same? expected_name actual_name)) - _ - false))) + _ + false))) (try.else false)) can_find_foreign_definition! @@ -105,13 +108,14 @@ (//module.with 0 expected_module) (//phase.result state) (try#each (|>> product.right - (case> (^ [actual_type (//analysis.constant [actual_module actual_name])]) - (and (type#= expected_type actual_type) - (same? import actual_module) - (same? expected_name actual_name)) + (pipe.case + (^ [actual_type (//analysis.constant [actual_module actual_name])]) + (and (type#= expected_type actual_type) + (same? import actual_module) + (same? expected_name actual_name)) - _ - false))) + _ + false))) (try.else false)) can_find_alias! @@ -125,13 +129,14 @@ (//module.with 0 expected_module) (//phase.result state) (try#each (|>> product.right - (case> (^ [actual_type (//analysis.constant [actual_module actual_name])]) - (and (type#= expected_type actual_type) - (same? import actual_module) - (same? expected_name actual_name)) + (pipe.case + (^ [actual_type (//analysis.constant [actual_module actual_name])]) + (and (type#= expected_type actual_type) + (same? import actual_module) + (same? expected_name actual_name)) - _ - false))) + _ + false))) (try.else false)) can_find_type! @@ -145,13 +150,14 @@ (//module.with 0 expected_module) (//phase.result state) (try#each (|>> product.right - (case> (^ [actual_type (//analysis.constant [actual_module actual_name])]) - (and (type#= .Type actual_type) - (same? expected_module actual_module) - (same? expected_name actual_name)) + (pipe.case + (^ [actual_type (//analysis.constant [actual_module actual_name])]) + (and (type#= .Type actual_type) + (same? expected_module actual_module) + (same? expected_name actual_name)) - _ - false))) + _ + false))) (try.else false))] (and can_find_local_variable! can_find_foreign_variable! diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux index 86f813b1d..454cebdc6 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux @@ -6,7 +6,7 @@ [abstract [monad {"+" do}]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" try]] [data ["[0]" product]] @@ -34,43 +34,47 @@ (/phase#each product.right) (/phase.result [/extension.#bundle /extension.empty /extension.#state state]) - (case> (^ {try.#Success analysis}) - (? analysis) + (pipe.case + (^ {try.#Success analysis}) + (? analysis) - _ - false)) + _ + false)) (|> it (/type.expecting .Nothing) (/module.with 0 module) (/phase#each product.right) (/phase.result [/extension.#bundle /extension.empty /extension.#state state]) - (case> (^ {try.#Failure error}) - true + (pipe.case + (^ {try.#Failure error}) + true - _ - false)) + _ + false)) (|> it /type.inferring (/module.with 0 module) (/phase#each product.right) (/phase.result [/extension.#bundle /extension.empty /extension.#state state]) - (case> (^ {try.#Success [inferred analysis]}) - (and (type#= type inferred) - (? analysis)) + (pipe.case + (^ {try.#Success [inferred analysis]}) + (and (type#= type inferred) + (? analysis)) - _ - false)))) + _ + false)))) (template: (analysis? <type> <tag>) [(: (-> <type> Analysis Bit) (function (_ expected) - (|>> (case> (^ (<tag> actual)) - (same? expected actual) + (|>> (pipe.case + (^ (<tag> actual)) + (same? expected actual) - _ - false))))]) + _ + false))))]) (def: .public test (<| (_.covering /._) @@ -83,7 +87,7 @@ (`` ($_ _.and (_.cover [/.unit] (..analysis state module .Any /.unit - (|>> (case> (^ (/analysis.unit)) true _ false)))) + (|>> (pipe.case (^ (/analysis.unit)) true _ false)))) (~~ (template [<analysis> <type> <random> <tag>] [(do ! [sample <random>] diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension.lux index ab2af87eb..1f24840eb 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension.lux @@ -8,7 +8,7 @@ ["$[0]" equivalence] ["$[0]" hash]]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" try] ["[0]" exception]] [data @@ -122,22 +122,24 @@ (/.install extender extension handler/1)) (phase.result [/.#bundle /.empty /.#state state]) - (case> {try.#Failure error} - (exception.match? /.cannot_overwrite error) + (pipe.case + {try.#Failure error} + (exception.match? /.cannot_overwrite error) - _ - false))) + _ + false))) (_.cover [/.unknown] (|> (/.apply archive.empty (function (_ archive input) (# phase.monad in (++ input))) [extension (list left right)]) (phase.result [/.#bundle /.empty /.#state state]) - (case> {try.#Failure error} - (exception.match? /.unknown error) + (pipe.case + {try.#Failure error} + (exception.match? /.unknown error) - _ - false))) + _ + false))) ))) (def: test|bundle @@ -197,11 +199,12 @@ (/.apply archive.empty phase [extension (list)])) (phase.result [/.#bundle /.empty /.#state state]) - (case> {try.#Failure error} - (exception.match? /.incorrect_arity error) + (pipe.case + {try.#Failure error} + (exception.match? /.incorrect_arity error) - _ - false)))) + _ + false)))) (_.cover [/.invalid_syntax] (let [handler (: (/.Handler Int Nat Nat) (function (_ @self phase archive inputs) @@ -211,11 +214,12 @@ (/.apply archive.empty phase [extension (list left right)])) (phase.result [/.#bundle /.empty /.#state state]) - (case> {try.#Failure error} - (exception.match? /.invalid_syntax error) + (pipe.case + {try.#Failure error} + (exception.match? /.invalid_syntax error) - _ - false)))) + _ + false)))) (_.for [/.Name] ..test|name) )) @@ -252,11 +256,12 @@ (/.lifted (phase.lifted {try.#Failure expected_error}))) (phase.result [/.#bundle /.empty /.#state state]) - (case> {try.#Failure actual_error} - (same? expected_error actual_error) + (pipe.case + {try.#Failure actual_error} + (same? expected_error actual_error) - _ - false)))) + _ + false)))) (_.cover [/.up] (|> (do phase.monad [] 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 90cf891ac..24a9fb366 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 @@ -1,37 +1,37 @@ (.using - [lux {"-" i64 int primitive} - [abstract - ["[0]" monad {"+" do}]] - [data - ["%" text/format {"+" format}]] - ["r" math/random {"+" Random}] - ["_" test {"+" Test}] - [control - pipe - [io {"+" IO}] - ["[0]" try] - [concurrency - ["[0]" atom]]] - [data - ["[0]" product]] - ["[0]" type ("[1]#[0]" equivalence)] - [macro - ["[0]" code]] - [meta - ["[0]" symbol]]] - [//// - [analysis - ["_[0]" primitive]]] - [\\ - ["[0]" / - ["///[1]" //// "_" - [analysis - ["[1][0]" scope] - ["[1][0]" type]] - [//// - ["[0]" phase] - [meta - ["[0]" archive]]]]]]) + [lux {"-" i64 int primitive} + [abstract + ["[0]" monad {"+" do}]] + [data + ["%" text/format {"+" format}]] + ["r" math/random {"+" Random}] + ["_" test {"+" Test}] + [control + ["[0]" pipe] + [io {"+" IO}] + ["[0]" try] + [concurrency + ["[0]" atom]]] + [data + ["[0]" product]] + ["[0]" type ("[1]#[0]" equivalence)] + [macro + ["[0]" code]] + [meta + ["[0]" symbol]]] + [//// + [analysis + ["_[0]" primitive]]] + [\\ + ["[0]" / + ["///[1]" //// "_" + [analysis + ["[1][0]" scope] + ["[1][0]" type]] + [//// + ["[0]" phase] + [meta + ["[0]" archive]]]]]]) (template [<name> <success> <failure>] [(def: (<name> procedure params output_type) @@ -40,11 +40,12 @@ (////type.with_type output_type (_primitive.phase archive.empty (` ((~ (code.text procedure)) (~+ params)))))) (phase.result _primitive.state) - (case> {try.#Success _} - <success> + (pipe.case + {try.#Success _} + <success> - {try.#Failure _} - <failure>)))] + {try.#Failure _} + <failure>)))] [check_success+ true false] [check_failure+ false true] 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 beb9c4a34..c5d7ccd02 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 @@ -5,7 +5,7 @@ [hash {"+" Hash}] ["[0]" monad {"+" do}]] [control - [pipe {"+" case>}] + ["[0]" pipe] ["[0]" try ("[1]#[0]" functor)]] [data ["[0]" sum] @@ -71,13 +71,14 @@ (|> letA (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (case> (^ {try.#Success (synthesis.branch/let [inputS registerS outputS])}) - (and (n.= registerA registerS) - (//primitive.corresponds? inputA inputS) - (//primitive.corresponds? outputA outputS)) + (pipe.case + (^ {try.#Success (synthesis.branch/let [inputS registerS outputS])}) + (and (n.= registerA registerS) + (//primitive.corresponds? inputA inputS) + (//primitive.corresponds? outputA outputS)) - _ - false))))) + _ + false))))) (def: if_test Test @@ -99,13 +100,14 @@ (|> ifA (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (case> (^ {try.#Success (synthesis.branch/if [inputS thenS elseS])}) - (and (//primitive.corresponds? inputA inputS) - (//primitive.corresponds? thenA thenS) - (//primitive.corresponds? elseA elseS)) + (pipe.case + (^ {try.#Success (synthesis.branch/if [inputS thenS elseS])}) + (and (//primitive.corresponds? inputA inputS) + (//primitive.corresponds? thenA thenS) + (//primitive.corresponds? elseA elseS)) - _ - false))))) + _ + false))))) (def: random_member (Random synthesis.Member) @@ -158,12 +160,13 @@ (|> getA (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (case> (^ {try.#Success (synthesis.branch/get [pathS recordS])}) - (and (# (list.equivalence (sum.equivalence n.= n.=)) = pathA pathS) - (//primitive.corresponds? recordA recordS)) + (pipe.case + (^ {try.#Success (synthesis.branch/get [pathS recordS])}) + (and (# (list.equivalence (sum.equivalence n.= n.=)) = pathA pathS) + (//primitive.corresponds? recordA recordS)) - _ - false))))) + _ + false))))) (def: random_bit (Random [Path Match]) @@ -185,11 +188,12 @@ (|> random_element (random.set hash 5) (# random.monad each (|>> set.list - (case> (^ (list s0 s1 s2 s3 s4)) - [s0 s1 s2 s3 s4] + (pipe.case + (^ (list s0 s1 s2 s3 s4)) + [s0 s1 s2 s3 s4] - _ - (undefined)))))) + _ + (undefined)))))) (template [<name> <hash> <random> <path> <synthesis> <pattern> <analysis>] [(def: <name> @@ -333,12 +337,13 @@ (_.cover [/.synthesize_case] (|> (/.synthesize_case //.phase archive.empty expected_input match) (phase.result [///bundle.empty synthesis.init]) - (case> (^ {try.#Success (synthesis.branch/case [actual_input actual_path])}) - (and (# synthesis.equivalence = expected_input actual_input) - (# synthesis.path_equivalence = expected_path actual_path)) + (pipe.case + (^ {try.#Success (synthesis.branch/case [actual_input actual_path])}) + (and (# synthesis.equivalence = expected_input actual_input) + (# synthesis.path_equivalence = expected_path actual_path)) - _ - false))))) + _ + false))))) (def: .public test Test diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux index 6fa2b9257..159207280 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux @@ -1,32 +1,32 @@ (.using - [lux {"-" primitive} - [abstract ["[0]" monad {"+" do}]] - [control - [pipe {"+" case>}] - ["[0]" try]] - [data - ["%" text/format {"+" format}] - [number - ["n" nat]] - [collection - ["[0]" list]]] - ["r" math/random {"+" Random} ("[1]#[0]" monad)] - ["_" test {"+" Test}] - [meta - ["[0]" symbol]]] - [\\ - ["[0]" / "_" - ["/[1]" // - ["/[1]" // "_" - [extension - ["[1][0]" bundle]] - ["/[1]" // - ["[1][0]" analysis {"+" Analysis}] - ["[1][0]" synthesis {"+" Synthesis}] - [/// - ["[0]" phase] - [meta - ["[0]" archive]]]]]]]]) + [lux {"-" primitive} + [abstract ["[0]" monad {"+" do}]] + [control + ["[0]" pipe] + ["[0]" try]] + [data + ["%" text/format {"+" format}] + [number + ["n" nat]] + [collection + ["[0]" list]]] + ["r" math/random {"+" Random} ("[1]#[0]" monad)] + ["_" test {"+" Test}] + [meta + ["[0]" symbol]]] + [\\ + ["[0]" / "_" + ["/[1]" // + ["/[1]" // "_" + [extension + ["[1][0]" bundle]] + ["/[1]" // + ["[1][0]" analysis {"+" Analysis}] + ["[1][0]" synthesis {"+" Synthesis}] + [/// + ["[0]" phase] + [meta + ["[0]" archive]]]]]]]]) (def: .public primitive (Random Analysis) @@ -82,11 +82,12 @@ (|> {////analysis.#Primitive {<analysis> expected}} (//.phase archive.empty) (phase.result [///bundle.empty ////synthesis.init]) - (case> {try.#Success {////synthesis.#Primitive {<synthesis> actual}}} - (same? expected actual) + (pipe.case + {try.#Success {////synthesis.#Primitive {<synthesis> actual}}} + (same? expected actual) - _ - false))))] + _ + false))))] [////analysis.#Unit ////synthesis.#Text (r#in ////synthesis.unit)] [////analysis.#Bit ////synthesis.#Bit r.bit] 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 ce3327adb..2f66190b4 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 @@ -1,38 +1,38 @@ (.using - [lux "*" - [abstract - ["[0]" monad {"+" do}]] - [data - ["%" text/format {"+" format}]] - ["r" math/random {"+" Random}] - ["_" test {"+" Test}] - [control - pipe - ["[0]" try]] - [data - ["[0]" bit ("[1]#[0]" equivalence)] - ["[0]" product] - [number - ["n" nat]] - [collection - ["[0]" list]]] - [meta - ["[0]" symbol]]] - ["[0]" // "_" - ["[1][0]" primitive]] - [\\ - ["[0]" / "_" - ["/[1]" // - ["/[1]" // "_" - [extension - ["[1][0]" bundle]] - ["/[1]" // - ["[1][0]" analysis {"+" Analysis}] - ["[1][0]" synthesis {"+" Synthesis}] - [/// - ["[0]" phase] - [meta - ["[0]" archive]]]]]]]]) + [lux "*" + [abstract + ["[0]" monad {"+" do}]] + [data + ["%" text/format {"+" format}]] + ["r" math/random {"+" Random}] + ["_" test {"+" Test}] + [control + ["[0]" pipe] + ["[0]" try]] + [data + ["[0]" bit ("[1]#[0]" equivalence)] + ["[0]" product] + [number + ["n" nat]] + [collection + ["[0]" list]]] + [meta + ["[0]" symbol]]] + ["[0]" // "_" + ["[1][0]" primitive]] + [\\ + ["[0]" / "_" + ["/[1]" // + ["/[1]" // "_" + [extension + ["[1][0]" bundle]] + ["/[1]" // + ["[1][0]" analysis {"+" Analysis}] + ["[1][0]" synthesis {"+" Synthesis}] + [/// + ["[0]" phase] + [meta + ["[0]" archive]]]]]]]]) (def: variant Test @@ -48,14 +48,15 @@ (|> (////analysis.variant [lefts right? memberA]) (//.phase archive.empty) (phase.result [///bundle.empty ////synthesis.init]) - (case> (^ {try.#Success (////synthesis.variant [leftsS right?S valueS])}) - (let [tagS (if right?S (++ leftsS) leftsS)] - (and (n.= tagA tagS) - (|> tagS (n.= (-- size)) (bit#= right?S)) - (//primitive.corresponds? memberA valueS))) - - _ - false))))) + (pipe.case + (^ {try.#Success (////synthesis.variant [leftsS right?S valueS])}) + (let [tagS (if right?S (++ leftsS) leftsS)] + (and (n.= tagA tagS) + (|> tagS (n.= (-- size)) (bit#= right?S)) + (//primitive.corresponds? memberA valueS))) + + _ + false))))) (def: tuple Test @@ -66,13 +67,14 @@ (|> (////analysis.tuple membersA) (//.phase archive.empty) (phase.result [///bundle.empty ////synthesis.init]) - (case> (^ {try.#Success (////synthesis.tuple membersS)}) - (and (n.= size (list.size membersS)) - (list.every? (product.uncurried //primitive.corresponds?) - (list.zipped/2 membersA membersS))) + (pipe.case + (^ {try.#Success (////synthesis.tuple membersS)}) + (and (n.= size (list.size membersS)) + (list.every? (product.uncurried //primitive.corresponds?) + (list.zipped/2 membersA membersS))) - _ - false))))) + _ + false))))) (def: .public test Test 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 55a187083..42a9d531a 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 @@ -6,7 +6,6 @@ [math ["[0]" random {"+" Random}]] [control - [pipe {"+" case>}] ["[0]" try]] [data ["[0]" product] |