diff options
Diffstat (limited to '')
145 files changed, 2123 insertions, 2157 deletions
diff --git a/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux b/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux index 8daf8635c..a6532c250 100644 --- a/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux +++ b/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux @@ -47,18 +47,18 @@ (do random.monad [sample random stamp $///stamp.random] - (let [version (value@ #/.version sample) + (let [version (value@ /.#version sample) local! (text\= version - (/.format (with@ #/.snapshot #///.Local sample))) + (/.format (with@ /.#snapshot {///.#Local} sample))) - remote_format (/.format [#/.version (format version /.snapshot) - #/.snapshot {#///.Remote stamp}]) + remote_format (/.format [/.#version (format version /.snapshot) + /.#snapshot {///.#Remote stamp}]) remote! - (and (text.starts_with? (format version (///time.format (value@ #///stamp.time stamp))) + (and (text.starts_with? (format version (///time.format (value@ ///stamp.#time stamp))) remote_format) - (text.ends_with? (%.nat (value@ #///stamp.build stamp)) + (text.ends_with? (%.nat (value@ ///stamp.#build stamp)) remote_format))] (_.cover [/.snapshot /.format] (and local! diff --git a/stdlib/source/test/aedifex/artifact/time/date.lux b/stdlib/source/test/aedifex/artifact/time/date.lux index 77c312380..b32787d49 100644 --- a/stdlib/source/test/aedifex/artifact/time/date.lux +++ b/stdlib/source/test/aedifex/artifact/time/date.lux @@ -59,10 +59,10 @@ (try.else false))) (_.cover [/.year_is_out_of_range] (case (/.date candidate) - {#try.Success date} + {try.#Success date} (same? candidate (/.value date)) - {#try.Failure error} + {try.#Failure error} (exception.match? /.year_is_out_of_range error))) (_.cover [/.epoch] (date\= date.epoch (/.value /.epoch))) diff --git a/stdlib/source/test/aedifex/artifact/time/time.lux b/stdlib/source/test/aedifex/artifact/time/time.lux index 6351eca60..c908eb69b 100644 --- a/stdlib/source/test/aedifex/artifact/time/time.lux +++ b/stdlib/source/test/aedifex/artifact/time/time.lux @@ -19,7 +19,9 @@ (def: .public random (Random /.Time) - (random.one (|>> time.clock (with@ #time.milli_second 0) time.time) + (random.one (|>> time.clock + (with@ time.#milli_second 0) + time.time) random.time)) (def: .public test diff --git a/stdlib/source/test/aedifex/cache.lux b/stdlib/source/test/aedifex/cache.lux index 338feb5fa..84b8aaa02 100644 --- a/stdlib/source/test/aedifex/cache.lux +++ b/stdlib/source/test/aedifex/cache.lux @@ -57,7 +57,7 @@ (try.maybe (do try.monad [pom (//pom.write profile) - identity (try.of_maybe (value@ #//.identity profile))] + identity (try.of_maybe (value@ //.#identity profile))] (in [identity profile pom])))) @profile.random)) @@ -73,9 +73,9 @@ [[identity profile pom] ..profile type ..type content ..content] - (in [[#//dependency.artifact identity - #//dependency.type type] - (with@ #//package.origin {#//repository/origin.Remote ""} (//package.local pom content))]))) + (in [[//dependency.#artifact identity + //dependency.#type type] + (with@ //package.#origin {//repository/origin.#Remote ""} (//package.local pom content))]))) (def: resolution (Random Resolution) @@ -88,14 +88,14 @@ (do ! [pom (random.one (function (_ [identity profile pom]) (|> profile - (with@ #//.dependencies (set.empty //dependency.hash)) - (with@ #//.identity {#.Some (value@ #//dependency.artifact dependency)}) + (with@ //.#dependencies (set.empty //dependency.hash)) + (with@ //.#identity {.#Some (value@ //dependency.#artifact dependency)}) //pom.write try.maybe)) ..profile) content ..content] (in [dependency - (with@ #//package.origin {#//repository/origin.Remote ""} (//package.local pom content))])))))] + (with@ //package.#origin {//repository/origin.#Remote ""} (//package.local pom content))])))))] (in (dictionary.of_list //dependency.hash (list& [main_dependency main_package] dependencies))))) (def: singular @@ -116,7 +116,7 @@ [_ wrote! actual_package read!] (in (\ //package.equivalence = - (with@ #//package.origin {#//repository/origin.Local ""} expected_package) + (with@ //package.#origin {//repository/origin.#Local ""} expected_package) actual_package))))))))) (def: plural @@ -138,7 +138,7 @@ actual read!] (in (\ //dependency/resolution.equivalence = (\ dictionary.functor each - (with@ #//package.origin {#//repository/origin.Local ""}) + (with@ //package.#origin {//repository/origin.#Local ""}) expected) actual))))))))) diff --git a/stdlib/source/test/aedifex/cli.lux b/stdlib/source/test/aedifex/cli.lux index e41f3e44c..d08d5f1a1 100644 --- a/stdlib/source/test/aedifex/cli.lux +++ b/stdlib/source/test/aedifex/cli.lux @@ -53,20 +53,20 @@ (def: (compilation_format value) (-> /.Compilation (List Text)) (case value - #/.Build (list "build") - #/.Test (list "test"))) + {/.#Build} (list "build") + {/.#Test} (list "test"))) (def: (format value) (-> /.Command (List Text)) (case value - #/.Version (list "version") - #/.Clean (list "clean") - #/.POM (list "pom") - #/.Dependencies (list "deps") - #/.Install (list "install") - {#/.Deploy repository [user password]} (list "deploy" repository user password) - {#/.Compilation compilation} (..compilation_format compilation) - {#/.Auto compilation} (list& "auto" (..compilation_format compilation)))) + {/.#Version} (list "version") + {/.#Clean} (list "clean") + {/.#POM} (list "pom") + {/.#Dependencies} (list "deps") + {/.#Install} (list "install") + {/.#Deploy repository [user password]} (list "deploy" repository user password) + {/.#Compilation compilation} (..compilation_format compilation) + {/.#Auto compilation} (list& "auto" (..compilation_format compilation)))) (def: without_profile Test @@ -76,11 +76,11 @@ (|> expected ..format (cli.result /.command) - (case> {#try.Success [names actual]} + (case> {try.#Success [names actual]} (and (\ (list.equivalence text.equivalence) = (list //.default) names) (\ /.equivalence = expected actual)) - {#try.Failure error} + {try.#Failure error} false))))) (def: with_profile @@ -93,11 +93,11 @@ ..format (list& "with" expected_profile) (cli.result /.command) - (case> {#try.Success [actual_profile actual_command]} + (case> {try.#Success [actual_profile actual_command]} (and (\ (list.equivalence text.equivalence) = (list expected_profile //.default) actual_profile) (\ /.equivalence = expected_command actual_command)) - {#try.Failure error} + {try.#Failure error} false))))) (def: .public test diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux index 57aca92d2..307946212 100644 --- a/stdlib/source/test/aedifex/command/auto.lux +++ b/stdlib/source/test/aedifex/command/auto.lux @@ -55,7 +55,7 @@ (do [! async.monad] [[_ actual_runs] (async.future (atom.update! ++ @runs))] (if (n.= expected_runs actual_runs) - (in {#try.Failure end_signal}) + (in {try.#Failure end_signal}) (do (try.with !) [_ (\ fs write (\ utf8.codec encoded (%.nat actual_runs)) dummy_file) _ (\ fs modify @@ -77,14 +77,14 @@ .let [empty_profile (: Profile (\ ///.monoid identity)) with_target (: (-> Profile Profile) - (with@ #///.target target)) + (with@ ///.#target target)) with_program (: (-> Profile Profile) - (with@ #///.program {#.Some program})) + (with@ ///.#program {.#Some program})) profile (|> empty_profile with_program with_target - (with@ #///.sources (set.of_list text.hash (list source))))] + (with@ ///.#sources (set.of_list text.hash (list source))))] home (random.ascii/alpha 5) working_directory (random.ascii/alpha 5) @@ -103,23 +103,23 @@ _ (\ watcher poll [])] (do [! async.monad] [no_dangling_process! (|> profile - (with@ #///.compiler compiler) + (with@ ///.#compiler compiler) ((/.do! 1 watcher command) ($version.echo "") (program.async (program.mock environment.empty home working_directory)) fs (shell.async ($build.good_shell [])) resolution) - (\ ! each (|>> (case> {#try.Failure error} + (\ ! each (|>> (case> {try.#Failure error} (same? end_signal error) - {#try.Success _} + {try.#Success _} false)))) correct_number_of_runs! (|> @runs atom.read! async.future (\ ! each (n.= expected_runs)))] - (in {#try.Success (and correct_number_of_runs! + (in {try.#Success (and correct_number_of_runs! no_dangling_process!)})))] (_.cover' [/.do!] (try.else false verdict)))) diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux index 1376d440a..ee69f1010 100644 --- a/stdlib/source/test/aedifex/command/build.lux +++ b/stdlib/source/test/aedifex/command/build.lux @@ -41,85 +41,85 @@ (-> Any (Shell IO)) (shell.mock (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) - {#try.Success + {try.#Success (: (shell.Mock []) (implementation (def: (on_read state) (exception.except shell.no_more_output [])) - (def: (on_error state) + (def: (on_fail state) (exception.except shell.no_more_output [])) (def: (on_write input state) - {#try.Failure "on_write"}) + {try.#Failure "on_write"}) (def: (on_destroy state) - {#try.Failure "on_destroy"}) + {try.#Failure "on_destroy"}) (def: (on_await state) - {#try.Success [state shell.normal]})))}))) + {try.#Success [state shell.normal]})))}))) (def: .public bad_shell (-> Any (Shell IO)) (shell.mock (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) - {#try.Success + {try.#Success (: (shell.Mock []) (implementation (def: (on_read state) (exception.except shell.no_more_output [])) - (def: (on_error state) + (def: (on_fail state) (exception.except shell.no_more_output [])) (def: (on_write input state) - {#try.Failure "on_write"}) + {try.#Failure "on_write"}) (def: (on_destroy state) - {#try.Failure "on_destroy"}) + {try.#Failure "on_destroy"}) (def: (on_await state) - {#try.Success [state shell.error]})))}))) + {try.#Success [state shell.error]})))}))) (def: .public (reader_shell error?) (-> Bit (-> (List Text) (Shell IO))) (shell.mock (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) - {#try.Success + {try.#Success (: (shell.Mock (List Text)) (implementation (def: (on_read state) (if error? (exception.except shell.no_more_output []) (case state - {#.Item head tail} - {#try.Success [tail head]} + {.#Item head tail} + {try.#Success [tail head]} - #.End + {.#End} (exception.except shell.no_more_output [])))) (def: (on_error state) (if error? (case state - {#.Item head tail} - {#try.Success [tail head]} + {.#Item head tail} + {try.#Success [tail head]} - #.End + {.#End} (exception.except shell.no_more_output [])) (exception.except shell.no_more_output []))) (def: (on_write input state) - {#try.Failure "on_write"}) + {try.#Failure "on_write"}) (def: (on_destroy state) - {#try.Failure "on_destroy"}) + {try.#Failure "on_destroy"}) (def: (on_await state) - {#try.Success [state shell.error]})))}))) + {try.#Success [state shell.error]})))}))) (def: compiler (Random Dependency) (do random.monad [lux_version (random.ascii/alpha 5) - .let [js_compiler [#///dependency.artifact [#///artifact.group /.lux_group - #///artifact.name /.js_compiler_name - #///artifact.version lux_version] - #///dependency.type ///artifact/type.js_library]]] + .let [js_compiler [///dependency.#artifact [///artifact.#group /.lux_group + ///artifact.#name /.js_compiler_name + ///artifact.#version lux_version] + ///dependency.#type ///artifact/type.js_library]]] (`` ($_ random.either (in js_compiler) (~~ (template [<compiler>] - [(in [#///dependency.artifact [#///artifact.group /.lux_group - #///artifact.name <compiler> - #///artifact.version lux_version] - #///dependency.type ///artifact/type.lux_library])] + [(in [///dependency.#artifact [///artifact.#group /.lux_group + ///artifact.#name <compiler> + ///artifact.#version lux_version] + ///dependency.#type ///artifact/type.lux_library])] [/.jvm_compiler_name] [/.python_compiler_name] @@ -151,9 +151,9 @@ .let [empty_profile (: Profile (\ ///.monoid identity)) with_target (: (-> Profile Profile) - (with@ #///.target target)) + (with@ ///.#target target)) with_program (: (-> Profile Profile) - (with@ #///.program {#.Some program})) + (with@ ///.#program {.#Some program})) profile (|> empty_profile with_program @@ -164,19 +164,19 @@ (with_target empty_profile))] (_.cover' [/.no_specified_program] (case outcome - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.no_specified_program error))))) (in (do async.monad [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty profile)] (_.cover' [/.Compiler /.no_available_compiler] (case outcome - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.no_available_compiler error))))) (do ! [.let [console (@version.echo "")] @@ -185,7 +185,7 @@ [verdict (do ///action.monad [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs shell resolution - (with@ #///.compiler compiler profile)) + (with@ ///.#compiler compiler profile)) start (\ console read_line []) end (\ console read_line [])] (in (and (text\= /.start start) @@ -207,7 +207,7 @@ [verdict (do ///action.monad [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (shell.async (..bad_shell [])) resolution - (with@ #///.compiler compiler profile)) + (with@ ///.#compiler compiler profile)) start (\ console read_line []) end (\ console read_line [])] (in (and (text\= /.start start) @@ -232,12 +232,12 @@ actual/1 (\ console read_line []) actual/2 (\ console read_line []) end! (|> (\ console read_line []) - (\ ! each (|>> (case> {#try.Failure error} + (\ ! each (|>> (case> {try.#Failure error} true - {#try.Success _} + {try.#Success _} false) - #try.Success)))] + {try.#Success})))] (in (and (text\= expected/0 actual/0) (text\= expected/1 actual/1) (text\= expected/2 actual/2) diff --git a/stdlib/source/test/aedifex/command/clean.lux b/stdlib/source/test/aedifex/command/clean.lux index 83c3e5a80..7d3e57392 100644 --- a/stdlib/source/test/aedifex/command/clean.lux +++ b/stdlib/source/test/aedifex/command/clean.lux @@ -103,7 +103,7 @@ context_exists!/pre (..directory_exists? fs context) target_exists!/pre (..assets_exist? fs target_path direct_files) sub_exists!/pre (..assets_exist? fs sub_path sub_files) - _ (/.do! console fs (with@ #///.target target_path dummy)) + _ (/.do! console fs (with@ ///.#target target_path dummy)) context_exists!/post (..directory_exists? fs context) target_exists!/post (..assets_exist? fs target_path direct_files) sub_exists!/post (..assets_exist? fs sub_path sub_files) diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux index 219a2931b..0b0f8558b 100644 --- a/stdlib/source/test/aedifex/command/deploy.lux +++ b/stdlib/source/test/aedifex/command/deploy.lux @@ -55,7 +55,7 @@ (Async (Try Text))) (do ///action.monad [.let [console ($version.echo "")] - _ ($install.make_sources! fs (value@ #///.sources profile)) + _ ($install.make_sources! fs (value@ ///.#sources profile)) _ (/.do! console repository fs artifact profile)] (\ console read_line []))) @@ -66,7 +66,7 @@ [[artifact expected_pom profile] (random.one (function (_ profile) (do maybe.monad - [artifact (value@ #///.identity profile) + [artifact (value@ ///.#identity profile) expected_pom (try.maybe (///pom.write profile))] (in [artifact expected_pom profile]))) $profile.random) @@ -81,19 +81,19 @@ [verdict (do [! ///action.monad] [logging (..execute! program repository fs artifact profile) expected_library (|> profile - (value@ #///.sources) + (value@ ///.#sources) set.list (export.library fs) (\ ! each (format.result tar.writer))) - actual_pom (\ repository download (///repository/remote.uri (value@ #///artifact.version artifact) artifact ///artifact/extension.pom)) - actual_library (\ repository download (///repository/remote.uri (value@ #///artifact.version artifact) artifact ///artifact/extension.lux_library)) - actual_sha-1 (\ repository download (///repository/remote.uri (value@ #///artifact.version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.sha-1))) + actual_pom (\ repository download (///repository/remote.uri (value@ ///artifact.#version artifact) artifact ///artifact/extension.pom)) + actual_library (\ repository download (///repository/remote.uri (value@ ///artifact.#version artifact) artifact ///artifact/extension.lux_library)) + actual_sha-1 (\ repository download (///repository/remote.uri (value@ ///artifact.#version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.sha-1))) actual_sha-1 (\ async.monad in (do try.monad [actual_sha-1 (\ utf8.codec decoded actual_sha-1)] (\ ///hash.sha-1_codec decoded actual_sha-1))) - actual_md5 (\ repository download (///repository/remote.uri (value@ #///artifact.version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.md5))) + actual_md5 (\ repository download (///repository/remote.uri (value@ ///artifact.#version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.md5))) actual_md5 (\ async.monad in (do try.monad [actual_md5 (\ utf8.codec decoded actual_md5)] diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux index 8cf0ea05c..037a8e119 100644 --- a/stdlib/source/test/aedifex/command/deps.lux +++ b/stdlib/source/test/aedifex/command/deps.lux @@ -67,31 +67,31 @@ [_ dependee_package] $///package.random [_ depender_package] $///package.random - .let [dependee [#///dependency.artifact dependee_artifact - #///dependency.type ///artifact/type.lux_library] - depender [#///dependency.artifact depender_artifact - #///dependency.type ///artifact/type.lux_library] + .let [dependee [///dependency.#artifact dependee_artifact + ///dependency.#type ///artifact/type.lux_library] + depender [///dependency.#artifact depender_artifact + ///dependency.#type ///artifact/type.lux_library] dependee_pom (|> (\ ///.monoid identity) - (with@ #///.identity {#.Some dependee_artifact}) + (with@ ///.#identity {.#Some dependee_artifact}) ///pom.write try.trusted) depender_pom (|> (\ ///.monoid identity) - (with@ #///.identity {#.Some depender_artifact}) - (with@ #///.dependencies (set.of_list ///dependency.hash (list dependee))) + (with@ ///.#identity {.#Some depender_artifact}) + (with@ ///.#dependencies (set.of_list ///dependency.hash (list dependee))) ///pom.write try.trusted) dependee_package (|> dependee_package - (with@ #///package.origin {#///repository/origin.Remote ""}) - (with@ #///package.pom [dependee_pom + (with@ ///package.#origin {///repository/origin.#Remote ""}) + (with@ ///package.#pom [dependee_pom (|> dependee_pom (\ xml.codec encoded) (\ utf8.codec encoded)) - #///dependency/status.Unverified])) + {///dependency/status.#Unverified}])) depender_package (|> depender_package - (with@ #///package.origin {#///repository/origin.Remote ""}) - (with@ #///package.pom [depender_pom + (with@ ///package.#origin {///repository/origin.#Remote ""}) + (with@ ///package.#pom [depender_pom (|> depender_pom (\ xml.codec encoded) (\ utf8.codec encoded)) - #///dependency/status.Unverified])) + {///dependency/status.#Unverified}])) fs (file.mock (\ file.default separator)) program (program.async (program.mock environment.empty home working_directory))]] @@ -103,7 +103,7 @@ (dictionary.has dependee dependee_package) (///dependency/deployment.all local)) post (|> (\ ///.monoid identity) - (with@ #///.dependencies (set.of_list ///dependency.hash (list dependee depender))) + (with@ ///.#dependencies (set.of_list ///dependency.hash (list dependee depender))) (/.do! console local (list (///repository.mock ($///dependency/resolution.single depender_artifact depender_package) [])) diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux index ac1a87be1..0461029fc 100644 --- a/stdlib/source/test/aedifex/command/install.lux +++ b/stdlib/source/test/aedifex/command/install.lux @@ -56,7 +56,7 @@ (-> (Program Async) (file.System Async) ///.Profile (Async (Try Text))) (do ///action.monad [.let [console ($version.echo "")] - _ (..make_sources! fs (value@ #///.sources sample)) + _ (..make_sources! fs (value@ ///.#sources sample)) _ (/.do! console fs (///repository/local.repository program fs) sample)] (\ console read_line []))) @@ -65,7 +65,7 @@ (<| (_.covering /._) (do [! random.monad] [identity $artifact.random - sample (\ ! each (with@ #///.identity {#.Some identity}) + sample (\ ! each (with@ ///.#identity {.#Some identity}) $profile.random) home (random.ascii/alpha 5) working_directory (random.ascii/alpha 5) @@ -75,7 +75,7 @@ [.let [fs (file.mock /) program (program.async (program.mock environment.empty home working_directory)) - artifact_path (///local.uri (value@ #///artifact.version identity) identity) + 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] @@ -84,11 +84,11 @@ library_exists! (|> library_path (format home /) (\ fs file?) - (\ async.monad each (|>> #try.Success))) + (\ async.monad each (|>> {try.#Success}))) pom_exists! (|> pom_path (format home /) (\ fs file?) - (\ async.monad each (|>> #try.Success)))] + (\ async.monad each (|>> {try.#Success})))] (in (and succeeded! library_exists! pom_exists!)))] @@ -97,7 +97,7 @@ (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))] + logging (..execute! program fs (with@ ///.#identity {.#None} sample))] (_.cover' [/.failure] (|> logging (try\each (text\= /.failure)) diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux index ac080c966..76cdf8b02 100644 --- a/stdlib/source/test/aedifex/command/pom.lux +++ b/stdlib/source/test/aedifex/command/pom.lux @@ -40,7 +40,7 @@ [.let [console (@version.echo "")] outcome (/.do! console fs sample)] (case outcome - {#try.Success _} + {try.#Success _} (do ! [verdict (do ///action.monad [expected (|> (///pom.write sample) @@ -60,11 +60,11 @@ (_.cover' [/.do! /.success] (try.else false verdict))) - {#try.Failure error} + {try.#Failure error} (_.cover' [/.do!] - (case (value@ #///.identity sample) - {#.Some _} + (case (value@ ///.#identity sample) + {.#Some _} false - #.None + {.#None} true)))))))) diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux index 19ae5cd70..cee27dd27 100644 --- a/stdlib/source/test/aedifex/command/test.lux +++ b/stdlib/source/test/aedifex/command/test.lux @@ -50,9 +50,9 @@ .let [empty_profile (: Profile (\ ///.monoid identity)) with_target (: (-> Profile Profile) - (with@ #///.target target)) + (with@ ///.#target target)) with_test (: (-> Profile Profile) - (with@ #///.test {#.Some test})) + (with@ ///.#test {.#Some test})) profile (|> empty_profile with_test @@ -65,7 +65,7 @@ [verdict (do ///action.monad [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (shell.async (@build.good_shell [])) resolution - (with@ #///.compiler compiler profile)) + (with@ ///.#compiler compiler profile)) build_start (\ console read_line []) build_end (\ console read_line []) test_start (\ console read_line []) @@ -83,7 +83,7 @@ [verdict (do ///action.monad [.let [bad_shell (shell.mock (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) - {#try.Success + {try.#Success (: (shell.Mock []) (implementation (def: (on_read state) @@ -91,17 +91,17 @@ (def: (on_error state) (exception.except shell.no_more_output [])) (def: (on_write input state) - {#try.Failure "on_write"}) + {try.#Failure "on_write"}) (def: (on_destroy state) - {#try.Failure "on_destroy"}) + {try.#Failure "on_destroy"}) (def: (on_await state) - {#try.Success [state (if (list.any? (text\= "build") actual_arguments) + {try.#Success [state (if (list.any? (text\= "build") actual_arguments) shell.normal shell.error)]})))}) [])] _ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (shell.async bad_shell) resolution - (with@ #///.compiler compiler profile)) + (with@ ///.#compiler compiler profile)) build_start (\ console read_line []) build_end (\ console read_line []) test_start (\ console read_line []) diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux index 6cd59b3a5..583e21fcd 100644 --- a/stdlib/source/test/aedifex/command/version.lux +++ b/stdlib/source/test/aedifex/command/version.lux @@ -50,11 +50,11 @@ (exception.except ..console_is_closed! []))) (def: (on_write input [open? state]) (if open? - {#try.Success [open? (format state input)]} + {try.#Success [open? (format state input)]} (exception.except ..console_is_closed! []))) (def: (on_close [open? buffer]) (if open? - {#try.Success [false buffer]} + {try.#Success [false buffer]} (exception.except ..console_is_closed! [])))) (def: .public echo diff --git a/stdlib/source/test/aedifex/dependency/deployment.lux b/stdlib/source/test/aedifex/dependency/deployment.lux index 7e137443b..625c7c9f5 100644 --- a/stdlib/source/test/aedifex/dependency/deployment.lux +++ b/stdlib/source/test/aedifex/dependency/deployment.lux @@ -55,7 +55,7 @@ [#@http.headers (http.headers (list)) #@http.body (function (_ _) (|> [0 (binary.empty 0)] - #try.Success + {try.#Success} io.io))]]) (type: Cache @@ -68,31 +68,31 @@ (do io.monad [_ (: (IO Any) (case [method input] - [#@http.Put {#.Some input}] + [{#@http.Put} {.#Some input}] (atom.update! (dictionary.has url input) cache) _ (in [])))] - (in {#try.Success ..good_upload}))))) + (in {try.#Success ..good_upload}))))) (def: (verify_one expected_deployments address package cache expected_artifact actual_artifact) (-> Nat URL Package (Dictionary URL Binary) Artifact Artifact Bit) (let [url (: (-> URI URL) (|>> (format address))) - library_url (url (format (artifact.uri (value@ #artifact.version expected_artifact) + library_url (url (format (artifact.uri (value@ artifact.#version expected_artifact) expected_artifact) artifact/extension.lux_library)) - pom_url (url (format (artifact.uri (value@ #artifact.version expected_artifact) + pom_url (url (format (artifact.uri (value@ artifact.#version expected_artifact) expected_artifact) artifact/extension.pom)) artifact_metadata_url (url (metadata.remote_artifact_uri expected_artifact)) project_metadata_url (url (metadata.remote_project_uri expected_artifact)) expected_library (|> package - (value@ #package.library) + (value@ package.#library) product.left) expected_pom (|> package - (value@ #package.pom) + (value@ package.#pom) product.right product.left) @@ -136,7 +136,7 @@ (do random.monad [[profile package] $///package.random .let [artifact (|> profile - (value@ #profile.identity) + (value@ profile.#identity) maybe.trusted) dependency (: Dependency [artifact @@ -155,7 +155,7 @@ .let [cache (: Cache (atom.atom (dictionary.empty text.hash))) http (..http cache) - repository (repository.async (remote.repository http #.None address))]] + repository (repository.async (remote.repository http {.#None} address))]] (in (do async.monad [?outcome (/.one repository dependency package) cache (async.future (atom.read! cache))] @@ -178,7 +178,7 @@ cache (: Cache (atom.atom (dictionary.empty text.hash))) http (..http cache) - repository (repository.async (remote.repository http #.None address))]] + repository (repository.async (remote.repository http {.#None} address))]] (in (do async.monad [?outcome (/.all repository resolution) cache (async.future (atom.read! cache))] diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux index 69867d5f8..b8b50f23d 100644 --- a/stdlib/source/test/aedifex/dependency/resolution.lux +++ b/stdlib/source/test/aedifex/dependency/resolution.lux @@ -53,8 +53,8 @@ (do [! random.monad] [artifact $///artifact.random [_ package] $///package.random] - (in (dictionary.has [#///dependency.artifact artifact - #///dependency.type ///artifact/type.lux_library] + (in (dictionary.has [///dependency.#artifact artifact + ///dependency.#type ///artifact/type.lux_library] package /.empty)))) @@ -92,13 +92,13 @@ (def: the_description "[0]") (def: (on_download uri state) - {#try.Failure "NOPE"}) + {try.#Failure "NOPE"}) (def: (on_upload uri binary state) - {#try.Failure "NOPE"}))) + {try.#Failure "NOPE"}))) (def: .public (single artifact package) (-> Artifact Package (Mock Any)) - (let [expected (///artifact.uri (value@ #///artifact.version artifact) artifact)] + (let [expected (///artifact.uri (value@ ///artifact.#version artifact) artifact)] (implementation (def: the_description "[1]") @@ -106,37 +106,37 @@ (if (text.contains? expected uri) (let [library (: Binary (|> package - (value@ #///package.library) + (value@ ///package.#library) product.left)) pom (: Binary (|> package - (value@ #///package.pom) + (value@ ///package.#pom) product.left (\ xml.codec encoded) (\ utf8.codec encoded)))] (cond (text.ends_with? ///artifact/extension.lux_library uri) - {#try.Success [state library]} + {try.#Success [state library]} (text.ends_with? ..lux_sha-1 uri) - {#try.Success [state (..sha-1 library)]} + {try.#Success [state (..sha-1 library)]} (text.ends_with? ..lux_md5 uri) - {#try.Success [state (..md5 library)]} + {try.#Success [state (..md5 library)]} (text.ends_with? ///artifact/extension.pom uri) - {#try.Success [state pom]} + {try.#Success [state pom]} (text.ends_with? ..pom_sha-1 uri) - {#try.Success [state (..sha-1 pom)]} + {try.#Success [state (..sha-1 pom)]} (text.ends_with? ..pom_md5 uri) - {#try.Success [state (..md5 pom)]} + {try.#Success [state (..md5 pom)]} ... else - {#try.Failure "NOPE"})) - {#try.Failure "NOPE"})) + {try.#Failure "NOPE"})) + {try.#Failure "NOPE"})) (def: (on_upload uri binary state) - {#try.Failure "NOPE"})))) + {try.#Failure "NOPE"})))) (def: (bad_sha-1 expected_artifact expected_package dummy_package) (-> Artifact Package Package (Mock Any)) @@ -144,52 +144,52 @@ (def: the_description "[~SHA-1]") (def: (on_download uri state) - (if (text.contains? (///artifact.uri (value@ #///artifact.version expected_artifact) expected_artifact) uri) + (if (text.contains? (///artifact.uri (value@ ///artifact.#version expected_artifact) expected_artifact) uri) (cond (text.ends_with? ///artifact/extension.lux_library uri) - {#try.Success [state (|> expected_package - (value@ #///package.library) + {try.#Success [state (|> expected_package + (value@ ///package.#library) product.left)]} (text.ends_with? ..lux_sha-1 uri) - {#try.Success [state (|> expected_package - (value@ #///package.library) + {try.#Success [state (|> expected_package + (value@ ///package.#library) product.left ..sha-1)]} (text.ends_with? ..lux_md5 uri) - {#try.Success [state (|> expected_package - (value@ #///package.library) + {try.#Success [state (|> expected_package + (value@ ///package.#library) product.left ..md5)]} (text.ends_with? ///artifact/extension.pom uri) - {#try.Success [state (|> expected_package - (value@ #///package.pom) + {try.#Success [state (|> expected_package + (value@ ///package.#pom) product.left (\ xml.codec encoded) (\ utf8.codec encoded))]} (text.ends_with? ..pom_sha-1 uri) - {#try.Success [state (|> dummy_package - (value@ #///package.pom) + {try.#Success [state (|> dummy_package + (value@ ///package.#pom) product.left (\ xml.codec encoded) (\ utf8.codec encoded) ..sha-1)]} (text.ends_with? ..pom_md5 uri) - {#try.Success [state (|> expected_package - (value@ #///package.pom) + {try.#Success [state (|> expected_package + (value@ ///package.#pom) product.left (\ xml.codec encoded) (\ utf8.codec encoded) ..md5)]} ... else - {#try.Failure "NOPE"}) - {#try.Failure "NOPE"})) + {try.#Failure "NOPE"}) + {try.#Failure "NOPE"})) (def: (on_upload uri binary state) - {#try.Failure "NOPE"}))) + {try.#Failure "NOPE"}))) (def: (bad_md5 expected_artifact expected_package dummy_package) (-> Artifact Package Package (Mock Any)) @@ -197,52 +197,52 @@ (def: the_description "[~MD5]") (def: (on_download uri state) - (if (text.contains? (///artifact.uri (value@ #///artifact.version expected_artifact) expected_artifact) uri) + (if (text.contains? (///artifact.uri (value@ ///artifact.#version expected_artifact) expected_artifact) uri) (cond (text.ends_with? ///artifact/extension.lux_library uri) - {#try.Success [state (|> expected_package - (value@ #///package.library) + {try.#Success [state (|> expected_package + (value@ ///package.#library) product.left)]} (text.ends_with? ..lux_sha-1 uri) - {#try.Success [state (|> expected_package - (value@ #///package.library) + {try.#Success [state (|> expected_package + (value@ ///package.#library) product.left ..sha-1)]} (text.ends_with? ..lux_md5 uri) - {#try.Success [state (|> dummy_package - (value@ #///package.library) + {try.#Success [state (|> dummy_package + (value@ ///package.#library) product.left ..md5)]} (text.ends_with? ///artifact/extension.pom uri) - {#try.Success [state (|> expected_package - (value@ #///package.pom) + {try.#Success [state (|> expected_package + (value@ ///package.#pom) product.left (\ xml.codec encoded) (\ utf8.codec encoded))]} (text.ends_with? ..pom_sha-1 uri) - {#try.Success [state (|> expected_package - (value@ #///package.pom) + {try.#Success [state (|> expected_package + (value@ ///package.#pom) product.left (\ xml.codec encoded) (\ utf8.codec encoded) ..sha-1)]} (text.ends_with? ..pom_md5 uri) - {#try.Success [state (|> dummy_package - (value@ #///package.pom) + {try.#Success [state (|> dummy_package + (value@ ///package.#pom) product.left (\ xml.codec encoded) (\ utf8.codec encoded) ..md5)]} ... else - {#try.Failure "NOPE"}) - {#try.Failure "NOPE"})) + {try.#Failure "NOPE"}) + {try.#Failure "NOPE"})) (def: (on_upload uri binary state) - {#try.Failure "NOPE"}))) + {try.#Failure "NOPE"}))) (def: one Test @@ -250,7 +250,7 @@ [expected_artifact $///artifact.random [_ expected_package] $///package.random [_ dummy_package] (random.only (|>> product.right - (with@ #///package.pom (value@ #///package.pom expected_package)) + (with@ ///package.#pom (value@ ///package.#pom expected_package)) (\ ///package.equivalence = expected_package) not) $///package.random) @@ -260,28 +260,28 @@ (`` ($_ _.and (in (do async.monad [actual_package (/.one (///repository.mock good []) - [#///dependency.artifact expected_artifact - #///dependency.type ///artifact/type.lux_library])] + [///dependency.#artifact expected_artifact + ///dependency.#type ///artifact/type.lux_library])] (_.cover' [/.one] (case actual_package - {#try.Success actual_package} + {try.#Success actual_package} (\ ///package.equivalence = - (with@ #///package.origin {#///repository/origin.Remote ""} expected_package) + (with@ ///package.#origin {///repository/origin.#Remote ""} expected_package) actual_package) - {#try.Failure _} + {try.#Failure _} false)))) (~~ (template [<exception> <bad>] [(in (do async.monad [actual_package (/.one (///repository.mock <bad> []) - [#///dependency.artifact expected_artifact - #///dependency.type ///artifact/type.lux_library])] + [///dependency.#artifact expected_artifact + ///dependency.#type ///artifact/type.lux_library])] (_.cover' [<exception>] (case actual_package - {#try.Failure error} + {try.#Failure error} (exception.match? <exception> error) - {#try.Success _} + {try.#Success _} false))))] [/.sha-1_does_not_match bad_sha-1] @@ -295,7 +295,7 @@ [expected_artifact $///artifact.random [_ expected_package] $///package.random [_ dummy_package] (random.only (|>> product.right - (with@ #///package.pom (value@ #///package.pom expected_package)) + (with@ ///package.#pom (value@ ///package.#pom expected_package)) (\ ///package.equivalence = expected_package) not) $///package.random) @@ -309,30 +309,30 @@ (list (///repository.mock bad_sha-1 []) (///repository.mock bad_md5 []) (///repository.mock good [])) - [#///dependency.artifact expected_artifact - #///dependency.type ///artifact/type.lux_library])] + [///dependency.#artifact expected_artifact + ///dependency.#type ///artifact/type.lux_library])] (_.cover' [/.any] (case actual_package - {#try.Success actual_package} + {try.#Success actual_package} (\ ///package.equivalence = - (with@ #///package.origin {#///repository/origin.Remote ""} expected_package) + (with@ ///package.#origin {///repository/origin.#Remote ""} expected_package) actual_package) - {#try.Failure _} + {try.#Failure _} false)))) (in (do async.monad [.let [console ($///version.echo "")] actual_package (/.any console (list (///repository.mock bad_sha-1 []) (///repository.mock bad_md5 [])) - [#///dependency.artifact expected_artifact - #///dependency.type ///artifact/type.lux_library])] + [///dependency.#artifact expected_artifact + ///dependency.#type ///artifact/type.lux_library])] (_.cover' [/.cannot_resolve] (case actual_package - {#try.Failure error} + {try.#Failure error} (exception.match? /.cannot_resolve error) - {#try.Success _} + {try.#Success _} false)))) ))) @@ -358,41 +358,41 @@ [_ depender_package] $///package.random [_ ignored_package] $///package.random - .let [dependee [#///dependency.artifact dependee_artifact - #///dependency.type ///artifact/type.lux_library] - depender [#///dependency.artifact depender_artifact - #///dependency.type ///artifact/type.lux_library] - ignored [#///dependency.artifact ignored_artifact - #///dependency.type ///artifact/type.lux_library] + .let [dependee [///dependency.#artifact dependee_artifact + ///dependency.#type ///artifact/type.lux_library] + depender [///dependency.#artifact depender_artifact + ///dependency.#type ///artifact/type.lux_library] + ignored [///dependency.#artifact ignored_artifact + ///dependency.#type ///artifact/type.lux_library] dependee_pom (|> (\ ///.monoid identity) - (with@ #///.identity {#.Some dependee_artifact}) + (with@ ///.#identity {.#Some dependee_artifact}) ///pom.write try.trusted) depender_pom (|> (\ ///.monoid identity) - (with@ #///.identity {#.Some depender_artifact}) - (with@ #///.dependencies (set.of_list ///dependency.hash (list dependee))) + (with@ ///.#identity {.#Some depender_artifact}) + (with@ ///.#dependencies (set.of_list ///dependency.hash (list dependee))) ///pom.write try.trusted) ignored_pom (|> (\ ///.monoid identity) - (with@ #///.identity {#.Some ignored_artifact}) + (with@ ///.#identity {.#Some ignored_artifact}) ///pom.write try.trusted) - dependee_package (with@ #///package.pom + dependee_package (with@ ///package.#pom [dependee_pom (|> dependee_pom (\ xml.codec encoded) (\ utf8.codec encoded)) - #///dependency/status.Unverified] + {///dependency/status.#Unverified}] dependee_package) - depender_package (with@ #///package.pom + depender_package (with@ ///package.#pom [depender_pom (|> depender_pom (\ xml.codec encoded) (\ utf8.codec encoded)) - #///dependency/status.Unverified] + {///dependency/status.#Unverified}] depender_package) - ignored_package (with@ #///package.pom + ignored_package (with@ ///package.#pom [ignored_pom (|> ignored_pom (\ xml.codec encoded) (\ utf8.codec encoded)) - #///dependency/status.Unverified] + {///dependency/status.#Unverified}] ignored_package)]] (in [[dependee depender ignored] [dependee_package depender_package ignored_package]]))) diff --git a/stdlib/source/test/aedifex/dependency/status.lux b/stdlib/source/test/aedifex/dependency/status.lux index 79e59460f..ea39e0cf5 100644 --- a/stdlib/source/test/aedifex/dependency/status.lux +++ b/stdlib/source/test/aedifex/dependency/status.lux @@ -40,7 +40,7 @@ [payload (binaryT.random 1)] (_.cover [/.verified] (case (/.verified payload) - {#/.Verified sha1 md5} + {/.#Verified sha1 md5} true _ diff --git a/stdlib/source/test/aedifex/hash.lux b/stdlib/source/test/aedifex/hash.lux index 049023718..eb3886755 100644 --- a/stdlib/source/test/aedifex/hash.lux +++ b/stdlib/source/test/aedifex/hash.lux @@ -50,18 +50,18 @@ [expected (..random <hash>)] (_.cover [<hash> <constructor> <exception>] (and (case (<constructor> (/.data expected)) - {#try.Success actual} + {try.#Success actual} (\ /.equivalence = expected actual) - {#try.Failure error} + {try.#Failure error} false) (case (<constructor> (\ binary.monoid composite (/.data expected) (/.data expected))) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? <exception> error)))))] [/.sha-1 /.as_sha-1 /.not_a_sha-1] @@ -83,10 +83,10 @@ (case (\ <codec> decoded (format (\ <codec> encoded expected) "AABBCC")) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_a_hash error))))] [/.sha-1_codec /.sha-1] diff --git a/stdlib/source/test/aedifex/input.lux b/stdlib/source/test/aedifex/input.lux index cf7f59840..cec84de94 100644 --- a/stdlib/source/test/aedifex/input.lux +++ b/stdlib/source/test/aedifex/input.lux @@ -45,7 +45,7 @@ Test (<| (_.covering /._) (do [! random.monad] - [expected (\ ! each (with@ #//.parents (list)) $profile.random) + [expected (\ ! each (with@ //.#parents (list)) $profile.random) .let [fs (: (file.System Async) (file.mock (\ file.default separator)))]] (in (do async.monad @@ -60,8 +60,8 @@ (/.read async.monad fs (list //.default)))] (in (\ //.equivalence = (|> expected - (revised@ #//.sources ..with_default_source) - (revised@ #//.repositories ..with_default_repository)) + (revised@ //.#sources ..with_default_source) + (revised@ //.#repositories ..with_default_repository)) actual)))] (_.cover' [/.read] (try.else false verdict))))))) diff --git a/stdlib/source/test/aedifex/local.lux b/stdlib/source/test/aedifex/local.lux index bd49df4c8..a2a943921 100644 --- a/stdlib/source/test/aedifex/local.lux +++ b/stdlib/source/test/aedifex/local.lux @@ -23,5 +23,5 @@ ($_ _.and (_.cover [/.repository /.uri] (text.starts_with? /.repository - (/.uri (value@ #//artifact.version sample) sample))) + (/.uri (value@ //artifact.#version sample) sample))) )))) diff --git a/stdlib/source/test/aedifex/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux index a1d3133c5..5708eb39b 100644 --- a/stdlib/source/test/aedifex/metadata/artifact.lux +++ b/stdlib/source/test/aedifex/metadata/artifact.lux @@ -60,10 +60,10 @@ month (month.by_number month) date (date.date year month day_of_month) time (time.time - [#time.hour hour - #time.minute minute - #time.second second - #time.milli_second 0])] + [time.#hour hour + time.#minute minute + time.#second second + time.#milli_second 0])] (in (instant.of_date_time date time)))))))) (def: .public test @@ -72,10 +72,10 @@ (_.for [/.Metadata]) (do random.monad [expected ..random - .let [artifact [#///artifact.group (value@ #/.group expected) - #///artifact.name (value@ #/.name expected) - #///artifact.version (|> expected - (value@ #/.versions) + .let [artifact [///artifact.#group (value@ /.#group expected) + ///artifact.#name (value@ /.#name expected) + ///artifact.#version (|> expected + (value@ /.#versions) list.head (maybe.else ""))]]] ($_ _.and @@ -105,12 +105,12 @@ actual (/.read repository artifact)] (_.cover' [/.write /.read] (and (case wrote? - {#try.Success _} true - {#try.Failure _} false) + {try.#Success _} true + {try.#Failure _} false) (case actual - {#try.Success actual} + {try.#Success actual} (\ /.equivalence = expected actual) - {#try.Failure _} + {try.#Failure _} false)))))) )))) diff --git a/stdlib/source/test/aedifex/metadata/snapshot.lux b/stdlib/source/test/aedifex/metadata/snapshot.lux index 52f7a1562..069cefcd2 100644 --- a/stdlib/source/test/aedifex/metadata/snapshot.lux +++ b/stdlib/source/test/aedifex/metadata/snapshot.lux @@ -64,16 +64,16 @@ month (month.by_number month) date (date.date year month day_of_month) time (time.time - [#time.hour hour - #time.minute minute - #time.second second - #time.milli_second 0])] + [time.#hour hour + time.#minute minute + time.#second second + time.#milli_second 0])] (in (instant.of_date_time date time))))))) (def: random_versioning (Random Versioning) ($_ random.and - (random\in #///snapshot.Local) + (random\in {///snapshot.#Local}) $///artifact/time.random (random.list 5 $///artifact/snapshot/version.random) )) @@ -91,7 +91,7 @@ (_.for [/.Metadata]) (do random.monad [expected ..random - .let [artifact (value@ #/.artifact expected)]] + .let [artifact (value@ /.#artifact expected)]] ($_ _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence ..random)) @@ -117,12 +117,12 @@ actual (/.read repository artifact)] (_.cover' [/.write /.read] (and (case wrote? - {#try.Success _} true - {#try.Failure _} false) + {try.#Success _} true + {try.#Failure _} false) (case actual - {#try.Success actual} + {try.#Success actual} (\ /.equivalence = expected actual) - {#try.Failure _} + {try.#Failure _} false)))))) )))) diff --git a/stdlib/source/test/aedifex/package.lux b/stdlib/source/test/aedifex/package.lux index 69d31ddcc..8f8285c49 100644 --- a/stdlib/source/test/aedifex/package.lux +++ b/stdlib/source/test/aedifex/package.lux @@ -64,25 +64,25 @@ ($equivalence.spec /.equivalence (\ ! each product.right ..random))) (_.cover [/.local?] - (/.local? (with@ #/.origin {#//origin.Local "~/yolo"} package))) + (/.local? (with@ /.#origin {//origin.#Local "~/yolo"} package))) (_.cover [/.remote?] - (/.remote? (with@ #/.origin {#//origin.Remote "https://example.com"} package))) + (/.remote? (with@ /.#origin {//origin.#Remote "https://example.com"} package))) (_.cover [/.local] - (let [expected_pom (|> package (value@ #/.pom) product.left) - expected_library (|> package (value@ #/.library) product.left) + (let [expected_pom (|> package (value@ /.#pom) product.left) + expected_library (|> package (value@ /.#library) product.left) local (/.local expected_pom expected_library) - [actual_pom binary_pom pom_status] (value@ #/.pom local) - [actual_library library_status] (value@ #/.library local)] - (and (case (value@ #/.origin local) - {#//origin.Local ""} true + [actual_pom binary_pom pom_status] (value@ /.#pom local) + [actual_library library_status] (value@ /.#library local)] + (and (case (value@ /.#origin local) + {//origin.#Local ""} true _ false) (let [expected_sha1 (//hash.sha-1 expected_library) expected_md5 (//hash.md5 expected_library)] (and (same? expected_library actual_library) (case library_status - {#//status.Verified actual_sha1 expected_md5} + {//status.#Verified actual_sha1 expected_md5} (and (//hash\= expected_sha1 actual_sha1) (//hash\= expected_md5 expected_md5)) @@ -97,26 +97,26 @@ (in (\ xml.equivalence = actual_pom decoded_pom))) (try.else false)) (case pom_status - {#//status.Verified actual_sha1 expected_md5} + {//status.#Verified actual_sha1 expected_md5} (and (//hash\= expected_sha1 actual_sha1) (//hash\= expected_md5 expected_md5)) _ false)))))) (_.cover [/.dependencies] - (let [expected (value@ #//.dependencies profile)] + (let [expected (value@ //.#dependencies profile)] (case (/.dependencies package) - {#try.Success actual} + {try.#Success actual} (\ set.equivalence = expected actual) - {#try.Failure error} + {try.#Failure error} false))) (_.cover [/.repositories] - (let [expected (value@ #//.repositories profile)] + (let [expected (value@ //.#repositories profile)] (case (/.repositories package) - {#try.Success actual} + {try.#Success actual} (\ set.equivalence = expected actual) - {#try.Failure error} + {try.#Failure error} false))) )))) diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux index 3dc073f0d..fea31184f 100644 --- a/stdlib/source/test/aedifex/parser.lux +++ b/stdlib/source/test/aedifex/parser.lux @@ -55,7 +55,7 @@ (def: with_default_sources (-> //.Profile //.Profile) - (revised@ #//.sources + (revised@ //.#sources (: (-> (Set //.Source) (Set //.Source)) (function (_ sources) (if (set.empty? sources) @@ -64,7 +64,7 @@ (def: with_default_repository (-> //.Profile //.Profile) - (revised@ #//.repositories (set.has //.default_repository))) + (revised@ //.#repositories (set.has //.default_repository))) (def: (with_empty_profile project) (-> Project Project) @@ -84,7 +84,7 @@ //format.project list (<code>.result /.project) - (case> {#try.Success actual} + (case> {try.#Success actual} (|> expected ..with_empty_profile dictionary.entries @@ -95,5 +95,5 @@ (dictionary.of_list text.hash) (\ //project.equivalence = actual)) - {#try.Failure error} + {try.#Failure error} false)))))) diff --git a/stdlib/source/test/aedifex/pom.lux b/stdlib/source/test/aedifex/pom.lux index 4913df25d..dff414e66 100644 --- a/stdlib/source/test/aedifex/pom.lux +++ b/stdlib/source/test/aedifex/pom.lux @@ -34,22 +34,22 @@ [expected @profile.random] (_.cover [/.write /.parser] (case [(/.write expected) - (value@ #//.identity expected)] - [{#try.Success pom} - {#.Some _}] + (value@ //.#identity expected)] + [{try.#Success pom} + {.#Some _}] (case (<xml>.result /.parser (list pom)) - {#try.Success actual} + {try.#Success actual} (\ //.equivalence = (|> (\ //.monoid identity) - (with@ #//.dependencies (value@ #//.dependencies expected)) - (with@ #//.repositories (value@ #//.repositories expected))) + (with@ //.#dependencies (value@ //.#dependencies expected)) + (with@ //.#repositories (value@ //.#repositories expected))) actual) - {#try.Failure error} + {try.#Failure error} false) - [{#try.Failure error} - #.None] + [{try.#Failure error} + {.#None}] (exception.match? //.no_identity error) _ diff --git a/stdlib/source/test/aedifex/profile.lux b/stdlib/source/test/aedifex/profile.lux index 7a0bcb279..cd5491c33 100644 --- a/stdlib/source/test/aedifex/profile.lux +++ b/stdlib/source/test/aedifex/profile.lux @@ -154,10 +154,10 @@ (text\= "" /.default)) (_.cover [/.default_compiler] (|> (\ /.monoid identity) - (value@ #/.compiler) + (value@ /.#compiler) (same? /.default_compiler))) (_.cover [/.default_target] (|> (\ /.monoid identity) - (value@ #/.target) + (value@ /.#target) (same? /.default_target))) ))))) diff --git a/stdlib/source/test/aedifex/project.lux b/stdlib/source/test/aedifex/project.lux index 767f8cdb3..aa3d726c3 100644 --- a/stdlib/source/test/aedifex/project.lux +++ b/stdlib/source/test/aedifex/project.lux @@ -27,7 +27,7 @@ (def: profile (Random [//.Name //.Profile]) (|> @profile.random - (random\each (with@ #//.parents (list))) + (random\each (with@ //.#parents (list))) (random.and (random.ascii/alpha 1)))) (def: .public random @@ -66,11 +66,11 @@ .let [project ($_ (\ /.monoid composite) (/.project super_name super_profile) (/.project dummy_name dummy_profile) - (/.project sub_name (with@ #//.parents (list super_name) sub_profile))) + (/.project sub_name (with@ //.#parents (list super_name) sub_profile))) circular ($_ (\ /.monoid composite) - (/.project super_name (with@ #//.parents (list sub_name) super_profile)) + (/.project super_name (with@ //.#parents (list sub_name) super_profile)) (/.project dummy_name dummy_profile) - (/.project sub_name (with@ #//.parents (list super_name) sub_profile)))]] + (/.project sub_name (with@ //.#parents (list super_name) sub_profile)))]] ($_ _.and (_.cover [/.profile] (and (|> (/.profile project super_name) @@ -84,17 +84,17 @@ (try.else false)))) (_.cover [/.unknown_profile] (case (/.profile project fake_name) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.unknown_profile error))) (_.cover [/.circular_dependency] (case (/.profile circular sub_name) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.circular_dependency error))) )) )))) diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux index e65503ee9..9cc73f6c8 100644 --- a/stdlib/source/test/aedifex/repository.lux +++ b/stdlib/source/test/aedifex/repository.lux @@ -72,17 +72,17 @@ "@") (def: (on_download uri state) (case (dictionary.value uri state) - {#.Some content} + {.#Some content} (case (binary.size content) 0 (exception.except ..not_found [uri]) - _ {#try.Success [state content]}) + _ {try.#Success [state content]}) - #.None + {.#None} (exception.except ..not_found [uri]))) (def: (on_upload uri content state) (if (dictionary.key? state uri) (exception.except ..cannot_upload [uri]) - {#try.Success (dictionary.has uri content state)}))) + {try.#Success (dictionary.has uri content state)}))) (def: .public test Test diff --git a/stdlib/source/test/aedifex/repository/local.lux b/stdlib/source/test/aedifex/repository/local.lux index b6d647bb9..5d3c94565 100644 --- a/stdlib/source/test/aedifex/repository/local.lux +++ b/stdlib/source/test/aedifex/repository/local.lux @@ -44,8 +44,8 @@ actual (\ repo download uri)] (_.cover' [/.repository] (and (case before_upload - {#try.Success _} false - {#try.Failure _} true) + {try.#Success _} false + {try.#Failure _} true) (|> actual (try\each (binary\= expected)) (try.else false)))))) diff --git a/stdlib/source/test/aedifex/repository/remote.lux b/stdlib/source/test/aedifex/repository/remote.lux index 443ab884e..9cea986a8 100644 --- a/stdlib/source/test/aedifex/repository/remote.lux +++ b/stdlib/source/test/aedifex/repository/remote.lux @@ -35,7 +35,7 @@ (-> URL (@http.Body IO)) (let [url (\ utf8.codec encoded url)] (function (_ _) - (io.io {#try.Success [(binary.size url) url]})))) + (io.io {try.#Success [(binary.size url) url]})))) (def: (good_http user password) (-> //identity.User //identity.Password (http.Client IO)) @@ -45,18 +45,18 @@ [#@http.headers (http.headers (list)) #@http.body (..url_body "")]]] (<| io.io - #try.Success + {try.#Success} (if (|> headers (dictionary.value "User-Agent") (maybe\each (same? /.user_agent)) (maybe.else false)) (case [method input] - [#@http.Get #.None] + [#@http.Get {.#None}] [http/status.ok [#@http.headers (http.headers (list)) #@http.body (..url_body url)]] - [#@http.Put {#.Some input}] + [#@http.Put {.#Some input}] (if (|> headers (dictionary.value "Authorization") (maybe\each (text\= (//identity.basic_auth user password))) @@ -75,7 +75,7 @@ (implementation (def: (request method url headers input) (<| io.io - #try.Success + {try.#Success} [http/status.bad_request [#@http.headers (http.headers (list)) #@http.body (..url_body "")]])))) @@ -95,8 +95,8 @@ ($_ _.and (_.cover [/.repository /.user_agent /.Address] (let [repo (/.repository (..good_http user password) - {#.Some [#//identity.user user - #//identity.password password]} + {.#Some [//identity.#user user + //identity.#password password]} address)] (and (|> (\ repo download uri) io.run! @@ -110,22 +110,22 @@ (try.else false))))) (_.cover [/.upload_failure] (let [repo (/.repository (..good_http user password) - #.None + {.#None} address)] (case (io.run! (\ repo upload uri content)) - {#try.Failure error} + {try.#Failure error} (exception.match? /.upload_failure error) - {#try.Success _} + {try.#Success _} false))) (_.cover [/.download_failure] (let [repo (/.repository ..bad_http - #.None + {.#None} address)] (case (io.run! (\ repo download uri)) - {#try.Failure error} + {try.#Failure error} (exception.match? /.download_failure error) - {#try.Success _} + {try.#Success _} false))) )))) diff --git a/stdlib/source/test/aedifex/runtime.lux b/stdlib/source/test/aedifex/runtime.lux index 0e5b72b01..77f7bcbed 100644 --- a/stdlib/source/test/aedifex/runtime.lux +++ b/stdlib/source/test/aedifex/runtime.lux @@ -44,7 +44,7 @@ (~~ (template [<command>] [(_.cover [/.default_java /.default_js /.default_python /.default_lua /.default_ruby] (let [listing (|> (list /.default_java /.default_js /.default_python /.default_lua /.default_ruby) - (list\each (value@ #/.program))) + (list\each (value@ /.#program))) unique (set.of_list text.hash listing)] (n.= (list.size listing) (set.size unique))))] @@ -57,10 +57,10 @@ )) (_.cover [/.for] (let [runtime' (/.for runtime path)] - (and (text\= (value@ #/.program runtime) - (value@ #/.program runtime')) + (and (text\= (value@ /.#program runtime) + (value@ /.#program runtime')) (|> runtime' - (value@ #/.parameters) + (value@ /.#parameters) list.last (maybe\each (text\= path)) (maybe.else false))))) diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 6a6ef3fac..46d467058 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -176,24 +176,24 @@ ($_ _.and (_.cover [/.try] (case (/.try expected) - {#.Left _} + {.#Left _} false - {#.Right actual} + {.#Right actual} (n.= expected actual))) (_.cover [/.undefined] (case (/.try (/.undefined)) - {#.Left _} + {.#Left _} true - {#.Right _} + {.#Right _} false)) (_.cover [/.panic!] (case (/.try (/.panic! expected_error)) - {#.Left actual_error} + {.#Left actual_error} (text.contains? expected_error actual_error) - {#.Right _} + {.#Right _} false)) ))) @@ -321,12 +321,6 @@ (/.' .example_identifier)) (code\= (code.identifier [..current_module "example_identifier"]) (/.' ..example_identifier)) - (code\= (code.tag ["" "example"]) - (/.' #example)) - (code\= (code.tag [/.prelude_module "example"]) - (/.' #.example)) - (code\= (code.tag [..current_module "example"]) - (/.' #..example)) (code\= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.' (6 +7 .8))) (code\= (code.variant (list (code.frac +9.0) @@ -357,12 +351,6 @@ (/.` .example_identifier)) (code\= (code.identifier [..current_module "example_identifier"]) (/.` ..example_identifier)) - (code\= (code.tag [..current_module "example"]) - (/.` #example)) - (code\= (code.tag [/.prelude_module "example"]) - (/.` #.example)) - (code\= (code.tag [..current_module "example"]) - (/.` #..example)) (code\= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.` (6 +7 .8))) (code\= (code.variant (list (code.frac +9.0) @@ -392,12 +380,6 @@ (/.`' .example_identifier)) (code\= (code.identifier [..current_module "example_identifier"]) (/.`' ..example_identifier)) - (code\= (code.tag ["" "example"]) - (/.`' #example)) - (code\= (code.tag [/.prelude_module "example"]) - (/.`' #.example)) - (code\= (code.tag [..current_module "example"]) - (/.`' #..example)) (code\= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.`' (6 +7 .8))) (code\= (code.variant (list (code.frac +9.0) @@ -425,7 +407,7 @@ )) (_.cover [/.Ann] (|> example - (value@ #/.meta) + (value@ /.#meta) (location\= location.dummy))) ))) @@ -436,14 +418,14 @@ "This is an arbitrary text whose only purpose is to be found, somewhere, in the source-code.") (/.macro: (found_crosshair? tokens lux) - (let [[_ _ source_code] (value@ #.source lux)] - {#.Right [lux (list (code.bit (text.contains? ..crosshair source_code)))]})) + (let [[_ _ source_code] (value@ .#source lux)] + {.#Right [lux (list (code.bit (text.contains? ..crosshair source_code)))]})) (def: for_macro Test (let [macro (: /.Macro' (function (_ tokens lux) - {#.Right [lux (list)]}))] + {.#Right [lux (list)]}))] (do random.monad [expected random.nat] (with_expansions [<found_crosshair?> (for [@.old (~~ (as_is))] @@ -467,7 +449,7 @@ (/.type: for_type/variant (Variant - #Case/0 + {#Case/0} {#Case/1 Nat} {#Case/2 Int Text})) @@ -487,7 +469,7 @@ expected_left random.nat expected_right random.nat - .let [existential_type (\ ! each (|>> #.Ex) random.nat)] + .let [existential_type (\ ! each (|>> {.#Ex}) random.nat)] expected/0 existential_type expected/1 existential_type] (<| (_.for [/.Type]) @@ -518,7 +500,7 @@ (same? /.Nat (/.:of expected))) (_.cover [/.primitive] (case (/.primitive "foo" [expected/0 expected/1]) - (^ {#.Primitive "foo" (list actual/0 actual/1)}) + (^ {.#Primitive "foo" (list actual/0 actual/1)}) (and (same? expected/0 actual/0) (same? expected/1 actual/1)) @@ -526,28 +508,28 @@ false)) (_.cover [/.type] (and (case (/.type [expected/0 expected/1]) - {#.Product actual/0 actual/1} + {.#Product actual/0 actual/1} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) _ false) (case (/.type (/.Or expected/0 expected/1)) - {#.Sum actual/0 actual/1} + {.#Sum actual/0 actual/1} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) _ false) (case (/.type (-> expected/0 expected/1)) - {#.Function actual/0 actual/1} + {.#Function actual/0 actual/1} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) _ false) (case (/.type (expected/0 expected/1)) - {#.Apply actual/1 actual/0} + {.#Apply actual/1 actual/0} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) @@ -836,11 +818,11 @@ (_.cover [/.Either] (and (exec (: (/.Either Nat Text) - {#.Left left}) + {.#Left left}) true) (exec (: (/.Either Nat Text) - {#.Right right}) + {.#Right right}) true))) (_.cover [/.Any] (and (exec @@ -890,12 +872,12 @@ (_.cover [/.Rec] (let [list (: (/.Rec NList (Maybe [Nat NList])) - {#.Some [item/0 - {#.Some [item/1 - {#.Some [item/2 - #.None]}]}]})] + {.#Some [item/0 + {.#Some [item/1 + {.#Some [item/2 + {.#None}]}]}]})] (case list - {#.Some [actual/0 {#.Some [actual/1 {#.Some [actual/2 #.None]}]}]} + {.#Some [actual/0 {.#Some [actual/1 {.#Some [actual/2 {.#None}]}]}]} (and (same? item/0 actual/0) (same? item/1 actual/1) (same? item/2 actual/2)) @@ -950,11 +932,11 @@ (/.case [#left expected_nat #right expected_int] [#left 0 #right +0] true _ false) - (/.case (: (Either Nat Int) {#.Left expected_nat}) - {#.Left 0} true + (/.case (: (Either Nat Int) {.#Left expected_nat}) + {.#Left 0} true _ false) - (/.case (: (Either Nat Int) {#.Right expected_int}) - {#.Right +0} true + (/.case (: (Either Nat Int) {.#Right expected_int}) + {.#Right +0} true _ false) )) (_.cover [/.^or] @@ -970,8 +952,8 @@ (_.cover [/.^slots] (/.case [#left expected_nat #right expected_int] (/.^slots [#left #right]) - (and (/.same? expected_nat left) - (/.same? expected_int right)))) + (and (/.same? expected_nat #left) + (/.same? expected_int #right)))) (_.cover [/.^] (/.case [#left expected_nat #right expected_int] (/.^ (!pair 0 +0)) true @@ -1074,23 +1056,23 @@ (syntax: (for_meta|Info []) (function (_ lux) - (let [info (value@ #.info lux) + (let [info (value@ .#info lux) conforming_target! - (set.member? ..possible_targets (value@ #.target info)) + (set.member? ..possible_targets (value@ .#target info)) compiling! - (case (value@ #.mode info) - #.Build true + (case (value@ .#mode info) + {.#Build} true _ false)] - {#.Right [lux (list (code.bit (and conforming_target! + {.#Right [lux (list (code.bit (and conforming_target! compiling!)))]}))) (syntax: (for_meta|Module_State []) (do meta.monad [prelude_module (meta.module .prelude_module)] - (in (list (code.bit (case (value@ #.module_state prelude_module) - #.Active false + (in (list (code.bit (case (value@ .#module_state prelude_module) + {.#Active} false _ true)))))) (def: for_meta @@ -1126,40 +1108,40 @@ let/2 <code>.local_identifier let/3 <code>.local_identifier]) - (in (list (code.bit (case (value@ #.scopes *lux*) + (in (list (code.bit (case (value@ .#scopes *lux*) (^ (list& scope/2 _)) - (let [locals/2 (value@ #.locals scope/2) + (let [locals/2 (value@ .#locals scope/2) expected_locals/2 (set.of_list text.hash (list fn/2 var/2 let/2 let/3)) actual_locals/2 (|> locals/2 - (value@ #.mappings) + (value@ .#mappings) (list\each product.left) (set.of_list text.hash)) correct_locals! - (and (n.= 4 (value@ #.counter locals/2)) + (and (n.= 4 (value@ .#counter locals/2)) (set\= expected_locals/2 actual_locals/2)) - captured/2 (value@ #.captured scope/2) + captured/2 (value@ .#captured scope/2) local? (: (-> Ref Bit) (function (_ ref) (case ref - {#.Local _} true - {#.Captured _} false))) + {.#Local _} true + {.#Captured _} false))) captured? (: (-> Ref Bit) (|>> local? not)) binding? (: (-> (-> Ref Bit) Text Bit) (function (_ is? name) (|> captured/2 - (value@ #.mappings) + (value@ .#mappings) (plist.value name) (maybe\each (|>> product.right is?)) (maybe.else false)))) correct_closure! - (and (n.= 6 (value@ #.counter captured/2)) + (and (n.= 6 (value@ .#counter captured/2)) (binding? local? fn/1) (binding? local? var/1) (binding? local? let/1) diff --git a/stdlib/source/test/lux/abstract/apply.lux b/stdlib/source/test/lux/abstract/apply.lux index d7c6495c3..3a63d3f34 100644 --- a/stdlib/source/test/lux/abstract/apply.lux +++ b/stdlib/source/test/lux/abstract/apply.lux @@ -26,9 +26,9 @@ (_.cover [/.composite] (let [expected (n.+ left right)] (case (\ (/.composite maybe.monad maybe.apply list.apply) on - {#.Some (list right)} - {#.Some (list (n.+ left))}) - (^ {#.Some (list actual)}) + {.#Some (list right)} + {.#Some (list (n.+ left))}) + (^ {.#Some (list actual)}) (n.= expected actual) _ diff --git a/stdlib/source/test/lux/abstract/codec.lux b/stdlib/source/test/lux/abstract/codec.lux index aadf0d0e2..6c4f334d3 100644 --- a/stdlib/source/test/lux/abstract/codec.lux +++ b/stdlib/source/test/lux/abstract/codec.lux @@ -22,7 +22,7 @@ (let [field "value"] (implementation (def: encoded - (|>> #json.Boolean + (|>> {json.#Boolean} [field] list json.object)) @@ -40,8 +40,8 @@ (<| (_.covering /._) (_.cover [/.composite] (case (|> expected (\ ..codec encoded) (\ ..codec decoded)) - {#try.Success actual} + {try.#Success actual} (bit\= expected actual) - {#try.Failure error} + {try.#Failure error} false))))) diff --git a/stdlib/source/test/lux/abstract/enum.lux b/stdlib/source/test/lux/abstract/enum.lux index 5e2807e53..856c20d1a 100644 --- a/stdlib/source/test/lux/abstract/enum.lux +++ b/stdlib/source/test/lux/abstract/enum.lux @@ -38,7 +38,7 @@ (/.range n.enum start end) (list.reversed (/.range n.enum end start))) every_element_is_a_successor? (case range - {#.Item head tail} + {.#Item head tail} (|> (list\mix (function (_ next [verdict prev]) [(and verdict (n.= next (\ n.enum succ prev))) @@ -47,7 +47,7 @@ tail) product.left) - #.End + {.#End} false)] (and (n.= expected_size (list.size range)) expected_start? diff --git a/stdlib/source/test/lux/abstract/equivalence.lux b/stdlib/source/test/lux/abstract/equivalence.lux index 799a657cb..c0d5ad8ec 100644 --- a/stdlib/source/test/lux/abstract/equivalence.lux +++ b/stdlib/source/test/lux/abstract/equivalence.lux @@ -45,10 +45,10 @@ (implementation (def: (= left right) (case [left right] - [#.End #.End] + [{.#End} {.#End}] true - [{#.Item leftH lefT} {#.Item rightH rightT}] + [{.#Item leftH lefT} {.#Item rightH rightT}] (and (n.= leftH rightH) (\ equivalence = lefT rightT)) diff --git a/stdlib/source/test/lux/abstract/functor.lux b/stdlib/source/test/lux/abstract/functor.lux index 97540f00e..7f3f078aa 100644 --- a/stdlib/source/test/lux/abstract/functor.lux +++ b/stdlib/source/test/lux/abstract/functor.lux @@ -27,16 +27,16 @@ (_.cover [/.Or /.sum] (and (case (\ (/.sum maybe.functor list.functor) each (n.+ shift) - {#.Left {#.Some left}}) - {#.Left {#.Some actual}} + {.#Left {.#Some left}}) + {.#Left {.#Some actual}} (n.= (n.+ shift left) actual) _ false) (case (\ (/.sum maybe.functor list.functor) each (n.+ shift) - {#.Right (list right)}) - (^ {#.Right (list actual)}) + {.#Right (list right)}) + (^ {.#Right (list actual)}) (n.= (n.+ shift right) actual) _ @@ -44,8 +44,8 @@ (_.cover [/.And /.product] (case (\ (/.product maybe.functor list.functor) each (n.+ shift) - [{#.Some left} (list right)]) - (^ [{#.Some actualL} (list actualR)]) + [{.#Some left} (list right)]) + (^ [{.#Some actualL} (list actualR)]) (and (n.= (n.+ shift left) actualL) (n.= (n.+ shift right) actualR)) @@ -54,8 +54,8 @@ (_.cover [/.Then /.composite] (case (\ (/.composite maybe.functor list.functor) each (n.+ shift) - {#.Some (list left)}) - (^ {#.Some (list actual)}) + {.#Some (list left)}) + (^ {.#Some (list actual)}) (n.= (n.+ shift left) actual) _ diff --git a/stdlib/source/test/lux/abstract/monad/free.lux b/stdlib/source/test/lux/abstract/monad/free.lux index 8fc9c96a8..f3275ef62 100644 --- a/stdlib/source/test/lux/abstract/monad/free.lux +++ b/stdlib/source/test/lux/abstract/monad/free.lux @@ -20,15 +20,15 @@ (def: injection (Injection (/.Free List)) - (|>> {#/.Pure})) + (|>> {/.#Pure})) (def: (interpret free) (All (_ a) (-> (/.Free List a) (List a))) (case free - {#/.Pure value} + {/.#Pure value} (list value) - {#/.Effect effect} + {/.#Effect effect} (|> effect (list\each interpret) list.together))) diff --git a/stdlib/source/test/lux/abstract/predicate.lux b/stdlib/source/test/lux/abstract/predicate.lux index 3cc54444b..d31ebfd62 100644 --- a/stdlib/source/test/lux/abstract/predicate.lux +++ b/stdlib/source/test/lux/abstract/predicate.lux @@ -80,10 +80,10 @@ (/.rec (function (_ recur) (function (_ values) (case values - #.End + {.#End} false - {#.Item head tail} + {.#Item head tail} (or (even? head) (recur tail)))))))] (bit\= (list.any? even? samples) diff --git a/stdlib/source/test/lux/control/concatenative.lux b/stdlib/source/test/lux/control/concatenative.lux index d1bb1d315..593e14bd8 100644 --- a/stdlib/source/test/lux/control/concatenative.lux +++ b/stdlib/source/test/lux/control/concatenative.lux @@ -73,8 +73,8 @@ (||> (/.push sample) <function>)))] - [/.||L #.Left] - [/.||R #.Right])) + [/.||L .#Left] + [/.||R .#Right])) (_.cover [/.dip] (n.= (++ sample) (||> (/.push sample) diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux index 2767082b2..108257528 100644 --- a/stdlib/source/test/lux/control/concurrency/actor.lux +++ b/stdlib/source/test/lux/control/concurrency/actor.lux @@ -36,14 +36,14 @@ (message: (count! [increment Nat] state self) Nat (let [state' (n.+ increment state)] - (async\in {#try.Success [state' state']}))) + (async\in {try.#Success [state' state']}))) ) (def: (mailed? outcome) (-> (Try Any) Bit) (case outcome - {#try.Success _} true - {#try.Failure _} false)) + {try.#Success _} true + {try.#Failure _} false)) (def: .public test Test @@ -52,7 +52,7 @@ .let [as_mail (: (All (_ a) (-> (-> a a) (/.Mail a))) (function (_ transform) (function (_ state actor) - (|> state transform #try.Success async\in)))) + (|> state transform {try.#Success} async\in)))) ++! (: (/.Mail Nat) (as_mail ++)) --! (: (/.Mail Nat) (as_mail --))]] (<| (_.covering /._) @@ -87,17 +87,17 @@ (in (do async.monad [_ (async.future (do io.monad [actor (/.spawn! (: (/.Behavior Any Any) - [#/.on_init (|>>) - #/.on_mail (function (_ message state self) + [/.#on_init (|>>) + /.#on_mail (function (_ message state self) (do [! async.monad] [outcome (message state self)] (case outcome - {#try.Failure cause} + {try.#Failure cause} (do ! [_ (async.future (write cause))] (in outcome)) - {#try.Success _} + {try.#Success _} (in outcome))))]) [])] (/.poison! actor))) @@ -105,10 +105,10 @@ result (async.future (async.value read))] (_.cover' [/.poisoned] (case result - {#.Some error} + {.#Some error} (exception.match? /.poisoned error) - #.None + {.#None} false))))) (in (do async.monad @@ -127,10 +127,10 @@ (/.mail! ++! counter)))] (_.cover' [/.dead] (case result - {#try.Success outcome} + {try.#Success outcome} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.dead error))))) (let [die! (: (/.Mail Nat) @@ -142,10 +142,10 @@ sent? (/.mail! die! actor) alive? (/.alive? actor) obituary (/.obituary' actor)] - (in {#try.Success [actor sent? alive? obituary]})))] + (in {try.#Success [actor sent? alive? obituary]})))] (_.cover' [/.Obituary /.obituary'] (case result - (^ {#try.Success [actor sent? alive? {#.Some [error state (list single_pending_message)]}]}) + (^ {try.#Success [actor sent? alive? {.#Some [error state (list single_pending_message)]}]}) (and (..mailed? sent?) (not alive?) (exception.match? ..got_wrecked error) @@ -166,10 +166,10 @@ (n.= 3 output_3))))] (_.cover' [/.Message /.actor: /.message: /.tell!] (case result - {#try.Success outcome} + {try.#Success outcome} outcome - {#try.Failure error} + {try.#Failure error} false)))) (in (do async.monad @@ -187,7 +187,7 @@ (..mailed? sent/--?) (..mailed? poisoned?) (case obituary - (^ {#.Some [error final_state (list poison_pill)]}) + (^ {.#Some [error final_state (list poison_pill)]}) (and (exception.match? /.poisoned error) (n.= (++ (++ initial_state)) final_state)) @@ -214,10 +214,10 @@ (if (n.< num_observations events_seen) (do ! [_ (atom.update! (row.suffix event) sink)] - (in {#try.Success (++ events_seen)})) + (in {try.#Success (++ events_seen)})) (do ! [_ stop] - (in {#try.Failure "YOLO"})))))) + (in {try.#Failure "YOLO"})))))) (frp.sequential 0 events) agent)] (in agent))) diff --git a/stdlib/source/test/lux/control/concurrency/async.lux b/stdlib/source/test/lux/control/concurrency/async.lux index f117f57f5..57fec6c78 100644 --- a/stdlib/source/test/lux/control/concurrency/async.lux +++ b/stdlib/source/test/lux/control/concurrency/async.lux @@ -38,8 +38,8 @@ [?left (/.value left) ?right (/.value right)] (in (case [?left ?right] - [{#.Some left} - {#.Some right}] + [{.#Some left} + {.#Some right}] (== left right) _ @@ -120,7 +120,7 @@ (in rightE))] (_.cover' [/.or] (case [?left ?right] - [{#.Left leftA} {#.Right rightA}] + [{.#Left leftA} {.#Right rightA}] (n.= (n.+ leftE rightE) (n.+ leftA rightA)) @@ -141,7 +141,7 @@ ?never (/.future (/.value async))] (_.cover' [/.value] (case [?actual ?never] - [{#.Some actual} #.None] + [{.#Some actual} {.#None}] (n.= expected actual) _ @@ -159,7 +159,7 @@ ?actual (/.within waiting_time (in expected))] (_.cover' [/.within] (case [?none ?actual] - [#.None {#.Some actual}] + [{.#None} {.#Some actual}] (n.= expected actual) _ diff --git a/stdlib/source/test/lux/control/concurrency/frp.lux b/stdlib/source/test/lux/control/concurrency/frp.lux index c46d0da92..fcefb15ec 100644 --- a/stdlib/source/test/lux/control/concurrency/frp.lux +++ b/stdlib/source/test/lux/control/concurrency/frp.lux @@ -39,8 +39,8 @@ [?left (async.value left) ?right (async.value right)] (in (case [?left ?right] - [{#.Some {#.Some [left _]}} - {#.Some {#.Some [right _]}}] + [{.#Some {.#Some [left _]}} + {.#Some {.#Some [right _]}}] (== left right) _ @@ -51,15 +51,15 @@ (case amount_of_polls 0 (do async.monad [_ (async.future (\ sink close))] - (in #.End)) + (in {.#End})) _ (do [! async.monad] [event channel] (case event - #.None - (in #.End) + {.#None} + (in {.#End}) - {#.Some [head tail]} - (\ ! each (|>> {#.Item head}) + {.#Some [head tail]} + (\ ! each (|>> {.#Item head}) (take_amount (-- amount_of_polls) [channel sink])))))) (def: .public test @@ -90,18 +90,18 @@ _ (\ sink feed sample) _ (\ sink close)] (in channel))) - {#try.Success channel} + {try.#Success channel} (io.run! (do io.monad [?actual (async.value channel)] (in (case ?actual - {#.Some {#.Some [actual _]}} + {.#Some {.#Some [actual _]}} (n.= sample actual) _ false)))) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.channel_is_already_closed] (case (io.run! @@ -109,10 +109,10 @@ [.let [[channel sink] (/.channel [])] _ (\ sink close)] (\ sink feed sample))) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.channel_is_already_closed error))) (in (do async.monad [output (|> sample @@ -148,10 +148,10 @@ _ (atom.update! (row.suffix value) sink)] (if (n.< (list.size inputs) (++ (row.size current))) - (in {#.Some []}) + (in {.#Some []}) (do ! [_ (!signal [])] - (in #.None))))) + (in {.#None}))))) (/.sequential 0 (list\composite inputs inputs)))) _ ?signal listened (|> sink @@ -212,9 +212,9 @@ (/.iterations (function (_ [iterations current]) (async.resolved (if (n.< max_iterations iterations) - {#.Some [[(++ iterations) (n.+ shift current)] + {.#Some [[(++ iterations) (n.+ shift current)] current]} - #.None)))) + {.#None})))) /.list)] (_.cover' [/.iterations] (and (n.= max_iterations (list.size actual)) diff --git a/stdlib/source/test/lux/control/concurrency/semaphore.lux b/stdlib/source/test/lux/control/concurrency/semaphore.lux index 44b2241f3..da3c90bae 100644 --- a/stdlib/source/test/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/test/lux/control/concurrency/semaphore.lux @@ -45,10 +45,10 @@ [result (async.within ..delay (/.wait! semaphore))] (_.cover' [/.semaphore] (case result - {#.Some _} + {.#Some _} true - #.None + {.#None} false))))) (do [! random.monad] [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1)))) @@ -58,10 +58,10 @@ result (async.within ..delay (/.wait! semaphore))] (_.cover' [/.wait!] (case result - {#.Some _} + {.#Some _} false - #.None + {.#None} true))))) (do [! random.monad] [initial_open_positions (|> random.nat (\ ! each (|>> (n.% 10) (n.max 1)))) @@ -74,7 +74,7 @@ result/1 (async.within ..delay block)] (_.cover' [/.signal!] (case [result/0 result/1 open_positions] - [#.None {#.Some _} {#try.Success +0}] + [{.#None} {.#Some _} {try.#Success +0}] true _ @@ -86,7 +86,7 @@ [outcome (/.signal! semaphore)] (_.cover' [/.semaphore_is_maxed_out] (case outcome - {#try.Failure error} + {try.#Failure error} (exception.match? /.semaphore_is_maxed_out error) _ @@ -145,10 +145,10 @@ [raw random.nat] (_.cover [/.Limit /.limit] (case [raw (/.limit raw)] - [0 #.None] + [0 {.#None}] true - [_ {#.Some limit}] + [_ {.#Some limit}] (and (n.> 0 raw) (n.= raw (refinement.value limit))) diff --git a/stdlib/source/test/lux/control/continuation.lux b/stdlib/source/test/lux/control/continuation.lux index 9fcea56e8..cdabfb8d0 100644 --- a/stdlib/source/test/lux/control/continuation.lux +++ b/stdlib/source/test/lux/control/continuation.lux @@ -72,15 +72,15 @@ (/.Cont (List Nat) (List Nat))) (function (visit xs) (case xs - #.End - (_\in #.End) + {.#End} + (_\in {.#End}) - {#.Item x xs'} + {.#Item x xs'} (do [! /.monad] [output (/.shift (function (_ k) (do ! [tail (k xs')] - (in {#.Item x tail}))))] + (in {.#Item x tail}))))] (visit output)))))] (list\= elems (/.result (/.reset (visit elems)))))) diff --git a/stdlib/source/test/lux/control/exception.lux b/stdlib/source/test/lux/control/exception.lux index 1a0d26c86..6df9238fc 100644 --- a/stdlib/source/test/lux/control/exception.lux +++ b/stdlib/source/test/lux/control/exception.lux @@ -39,24 +39,24 @@ ($_ _.and (_.cover [/.except] (case (/.except ..an_exception []) - {#try.Success _} false - {#try.Failure _} true)) + {try.#Success _} false + {try.#Failure _} true)) (_.cover [/.error] (case (/.except ..an_exception []) - {#try.Success _} + {try.#Success _} false - {#try.Failure message} + {try.#Failure message} (text\= message (/.error ..an_exception [])))) (_.cover [/.match?] (/.match? ..an_exception (/.error ..an_exception []))) (_.cover [/.assertion] (case (/.assertion ..an_exception [] assertion_succeeded?) - {#try.Success _} + {try.#Success _} assertion_succeeded? - {#try.Failure message} + {try.#Failure message} (and (not assertion_succeeded?) (text\= message (/.error ..an_exception []))))) (_.cover [/.when] @@ -88,27 +88,27 @@ (text.contains? field1 enumeration) (text.contains? value1 enumeration)))) (_.cover [/.with] - (and (case (/.with ..an_exception [] {#try.Success expected}) - {#try.Success actual} (n.= expected actual) - {#try.Failure _} false) - (case (/.with ..an_exception [] {#try.Failure ""}) - {#try.Success _} false - {#try.Failure message} (text\= message (/.error ..an_exception []))) + (and (case (/.with ..an_exception [] {try.#Success expected}) + {try.#Success actual} (n.= expected actual) + {try.#Failure _} false) + (case (/.with ..an_exception [] {try.#Failure ""}) + {try.#Success _} false + {try.#Failure message} (text\= message (/.error ..an_exception []))) (case (/.with ..an_exception [] (: (Try Nat) (/.except ..another_exception []))) - {#try.Success _} + {try.#Success _} false - {#try.Failure message} + {try.#Failure message} (and (text.contains? (/.error ..an_exception []) message) (text.contains? (/.error ..another_exception []) message))))) (_.cover [/.exception:] (case (/.except ..custom_exception [expected]) - {#try.Success _} + {try.#Success _} false - {#try.Failure message} + {try.#Failure message} (and (text.contains? ..label message) (text.contains? (%.nat expected) message)))) )))) diff --git a/stdlib/source/test/lux/control/function/contract.lux b/stdlib/source/test/lux/control/function/contract.lux index 3e50834a7..45cb6f8fd 100644 --- a/stdlib/source/test/lux/control/function/contract.lux +++ b/stdlib/source/test/lux/control/function/contract.lux @@ -25,21 +25,21 @@ (_.cover [/.pre /.pre_condition_failed] (case (try (/.pre (n.even? expected) true)) - {#try.Success output} + {try.#Success output} output - {#try.Failure error} - (and (text.contains? (value@ #exception.label /.pre_condition_failed) + {try.#Failure error} + (and (text.contains? (value@ exception.#label /.pre_condition_failed) error) (not (n.even? expected))))) (_.cover [/.post /.post_condition_failed] (case (try (/.post n.odd? expected)) - {#try.Success actual} + {try.#Success actual} (same? expected actual) - {#try.Failure error} - (and (text.contains? (value@ #exception.label /.post_condition_failed) + {try.#Failure error} + (and (text.contains? (value@ exception.#label /.post_condition_failed) error) (not (n.odd? expected))))) ))) diff --git a/stdlib/source/test/lux/control/maybe.lux b/stdlib/source/test/lux/control/maybe.lux index 2cdce3830..14cce16b3 100644 --- a/stdlib/source/test/lux/control/maybe.lux +++ b/stdlib/source/test/lux/control/maybe.lux @@ -34,7 +34,7 @@ ($equivalence.spec (/.equivalence n.equivalence) (random.maybe random.nat))) (_.for [/.hash] (|> random.nat - (\ random.monad each (|>> #.Some)) + (\ random.monad each (|>> {.#Some})) ($hash.spec (/.hash n.hash)))) (_.for [/.monoid] ($monoid.spec (/.equivalence n.equivalence) /.monoid (random.maybe random.nat))) @@ -55,7 +55,7 @@ [a (lifted (io\in left)) b (in right)] (in (n.+ a b)))) - (case> {#.Some actual} + (case> {.#Some actual} (n.= expected actual) _ @@ -65,24 +65,24 @@ value random.nat] (_.cover [/.else] (and (same? default (/.else default - #.None)) + {.#None})) (same? value (/.else default - {#.Some value}))))) + {.#Some value}))))) (do random.monad [value random.nat] (_.cover [/.trusted] - (same? value (/.trusted {#.Some value})))) + (same? value (/.trusted {.#Some value})))) (do random.monad [value random.nat] (_.cover [/.list] (\ (list.equivalence n.equivalence) = (list value) - (/.list {#.Some value})))) + (/.list {.#Some value})))) (do random.monad [expected random.nat .let [(^open "/\[0]") (/.equivalence n.equivalence)]] (_.cover [/.when] - (and (/\= {#.Some expected} (/.when true {#.Some expected})) - (/\= #.None (/.when false {#.Some expected}))))) + (and (/\= {.#Some expected} (/.when true {.#Some expected})) + (/\= {.#None} (/.when false {.#Some expected}))))) ))) diff --git a/stdlib/source/test/lux/control/parser.lux b/stdlib/source/test/lux/control/parser.lux index 119bfebb6..611459da0 100644 --- a/stdlib/source/test/lux/control/parser.lux +++ b/stdlib/source/test/lux/control/parser.lux @@ -43,7 +43,7 @@ (def: (should_fail expected input) (All (_ a) (-> Text (Try a) Bit)) (case input - {#try.Failure actual} + {try.#Failure actual} (text\= expected actual) _ @@ -52,7 +52,7 @@ (def: (enforced? parser input) (All (_ s) (-> (Parser s Any) s Bit)) (case (/.result parser input) - {#try.Success [_ []]} + {try.#Success [_ []]} #1 _ @@ -61,7 +61,7 @@ (def: (found? parser input) (All (_ s) (-> (Parser s Bit) s Bit)) (case (/.result parser input) - {#try.Success [_ #1]} + {try.#Success [_ #1]} #1 _ @@ -70,7 +70,7 @@ (def: (fails? input) (All (_ a) (-> (Try a) Bit)) (case input - {#try.Failure _} + {try.#Failure _} #1 _ @@ -80,7 +80,7 @@ then <code>.any input <code>.any]) (in (list (` (case (~ input) - (^ {#try.Success [(~' _) (~ pattern)]}) + (^ {try.#Success [(~' _) (~ pattern)]}) (~ then) (~' _) @@ -99,11 +99,11 @@ (_.cover [/.maybe] (and (|> (list (code.nat expected0)) (/.result (/.maybe <code>.nat)) - (match {#.Some actual} + (match {.#Some actual} (n.= expected0 actual))) (|> (list (code.int (.int expected0))) (/.result (/.maybe <code>.nat)) - (match #.None + (match {.#None} #1)))) (_.cover [/.some] (and (|> (list\each code.nat expected+) @@ -112,7 +112,7 @@ (\ (list.equivalence n.equivalence) = expected+ actual))) (|> (list\each (|>> .int code.int) expected+) (/.result (/.some <code>.nat)) - (match #.End + (match {.#End} #1)))) (_.cover [/.many] (and (|> (list\each code.nat expected+) @@ -149,10 +149,10 @@ odd (/.only n.odd? <code>.nat)] (and (|> (list (code.nat even0)) (/.result (/.or even odd)) - (match {#.Left actual} (n.= even0 actual))) + (match {.#Left actual} (n.= even0 actual))) (|> (list (code.nat odd0)) (/.result (/.or even odd)) - (match {#.Right actual} (n.= odd0 actual))) + (match {.#Right actual} (n.= odd0 actual))) (|> (list (code.bit not0)) (/.result (/.or even odd)) fails?)))) @@ -339,7 +339,7 @@ (Comparison (All (_ a i) (Parser i a))) (function (_ == left right) (case [(/.result left []) (/.result right [])] - [{#try.Success [_ left]} {#try.Success [_ right]}] + [{try.#Success [_ left]} {try.#Success [_ right]}] (== left right) _ @@ -370,10 +370,10 @@ (should_fail failure))) (_.cover [/.lifted] (and (|> (list) - (/.result (/.lifted {#try.Success expected})) + (/.result (/.lifted {try.#Success expected})) (match actual (n.= expected actual))) (|> (list) - (/.result (/.lifted {#try.Failure failure})) + (/.result (/.lifted {try.#Failure failure})) (should_fail failure)))) (_.cover [/.assertion] (and (|> (list (code.bit #1) (code.int +123)) diff --git a/stdlib/source/test/lux/control/parser/analysis.lux b/stdlib/source/test/lux/control/parser/analysis.lux index 392e66382..521bd8927 100644 --- a/stdlib/source/test/lux/control/parser/analysis.lux +++ b/stdlib/source/test/lux/control/parser/analysis.lux @@ -57,10 +57,10 @@ (_.cover [/.result /.any] (|> (list expected) (/.result /.any) - (case> {#try.Success actual} + (case> {try.#Success actual} (\ analysis.equivalence = expected actual) - {#try.Failure _} + {try.#Failure _} false)))) (~~ (template [<query> <check> <random> <analysis> <=>] [(do [! random.monad] @@ -68,17 +68,17 @@ (_.cover [<query>] (|> (list (<analysis> expected)) (/.result <query>) - (case> {#try.Success actual} + (case> {try.#Success actual} (<=> expected actual) - {#try.Failure _} + {try.#Failure _} false)))) (do [! random.monad] [expected <random>] (_.cover [<check>] (|> (list (<analysis> expected)) (/.result (<check> expected)) - (!expect {#try.Success _}))))] + (!expect {try.#Success _}))))] [/.bit /.bit! random.bit analysis.bit bit\=] [/.nat /.nat! random.nat analysis.nat n.=] @@ -95,54 +95,54 @@ (_.cover [/.tuple] (|> (list (analysis.tuple (list (analysis.bit expected)))) (/.result (/.tuple /.bit)) - (case> {#try.Success actual} + (case> {try.#Success actual} (bit\= expected actual) - {#try.Failure _} + {try.#Failure _} false)))) (do [! random.monad] [dummy random.bit] (_.cover [/.end?] (and (|> (/.result /.end? (list)) - (!expect {#try.Success #1})) + (!expect {try.#Success #1})) (|> (/.result (do <>.monad [verdict /.end? _ /.bit] (in verdict)) (list (analysis.bit dummy))) - (!expect {#try.Success #0}))))) + (!expect {try.#Success #0}))))) (do [! random.monad] [dummy random.bit] (_.cover [/.end!] (and (|> (/.result /.end! (list)) - (!expect {#try.Success _})) + (!expect {try.#Success _})) (|> (/.result /.end! (list (analysis.bit dummy))) - (!expect {#try.Failure _}))))) + (!expect {try.#Failure _}))))) (do [! random.monad] [expected random.bit] (_.cover [/.cannot_parse] (and (|> (list (analysis.bit expected)) (/.result /.nat) - (case> {#try.Success _} + (case> {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.cannot_parse error))) (|> (list) (/.result /.bit) - (case> {#try.Success _} + (case> {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.cannot_parse error)))))) (do [! random.monad] [expected random.bit] (_.cover [/.unconsumed_input] (|> (list (analysis.bit expected) (analysis.bit expected)) (/.result /.bit) - (case> {#try.Success _} + (case> {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.unconsumed_input error))))) ))))) diff --git a/stdlib/source/test/lux/control/parser/binary.lux b/stdlib/source/test/lux/control/parser/binary.lux index 40e2fa301..7b57b1547 100644 --- a/stdlib/source/test/lux/control/parser/binary.lux +++ b/stdlib/source/test/lux/control/parser/binary.lux @@ -56,10 +56,10 @@ (|> value (\ utf8.codec encoded) (\ utf8.codec decoded) - (case> {#try.Success converted} + (case> {try.#Success converted} (text\= value converted) - {#try.Failure error} + {try.#Failure error} false))) (def: random_text @@ -105,7 +105,6 @@ random.safe_frac ..random_text ..random_name - ..random_name random_sequence random_sequence random_sequence @@ -131,7 +130,7 @@ (_.cover [<size> <parser> <format>] (|> (format.result <format> expected) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= (.nat expected) (.nat actual)))))))] @@ -150,7 +149,7 @@ (_.cover [<parser> <format>] (|> (format.result <format> expected) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ binary.equivalence = expected actual))))))] [/.binary/8 format.binary/8] @@ -168,7 +167,7 @@ (_.cover [<parser> <format>] (|> (format.result <format> expected) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ text.equivalence = expected actual))))))] [/.utf8/8 format.utf8/8] @@ -188,7 +187,7 @@ (|> expected (format.result (<format> format.nat)) (/.result (<parser> /.nat)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ (row.equivalence n.equivalence) = expected actual))))))] [/.row/8 format.row/8] @@ -207,7 +206,7 @@ (|> expected (format.result <format>) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ <equivalence> = expected actual))))))] [/.bit format.bit random.bit bit.equivalence] @@ -220,7 +219,7 @@ (|> expected (format.result format.frac) (/.result /.frac) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (or (\ frac.equivalence = expected actual) (and (frac.not_a_number? expected) (frac.not_a_number? actual)))))))) @@ -232,7 +231,7 @@ (|> expected (format.result format.bits/8) (/.result /.bit) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.not_a_bit error)))))) ))) @@ -246,7 +245,7 @@ (|> expected (format.result <format>) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ <equivalence> = expected actual))))))] [/.location format.location random_location location_equivalence] @@ -260,7 +259,7 @@ (|> expected (format.result <format>) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ <equivalence> = expected actual))))))] [/.maybe (/.maybe /.nat) format.maybe (format.maybe format.nat) (random.maybe random.nat) (maybe.equivalence n.equivalence)] @@ -273,7 +272,7 @@ (|> expected (format.result (format.list format.nat)) (/.result (/.set n.hash /.nat)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.set_elements_are_not_unique error)))))) (do [! random.monad] [expected (random.or random.bit random.nat)] @@ -282,7 +281,7 @@ (format.result (format.or format.bit format.nat)) (/.result (: (/.Parser (Either Bit Nat)) (/.or /.bit /.nat))) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ (sum.equivalence bit.equivalence n.equivalence) = expected actual)))))) @@ -296,7 +295,7 @@ (format.result (format.and format.bits/8 format.bit)) (/.result (: (/.Parser (Either Bit Nat)) (/.or /.bit /.nat))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.invalid_tag error)))))) (do [! random.monad] [expected (random.list ..segment_size random.nat)] @@ -310,7 +309,7 @@ (/.or /.any (<>.and /.nat recur)))))) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ (list.equivalence n.equivalence) = expected actual)))))) @@ -325,13 +324,13 @@ format.no_op format.instance] (|> (format.instance format.no_op) (/.result /.any) - (!expect {#try.Success _}))) + (!expect {try.#Success _}))) (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} + (!expect (^multi {try.#Failure error} (exception.match? /.binary_was_not_fully_read error)))))) (do [! random.monad] [expected (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] @@ -339,7 +338,7 @@ (|> expected (format.result (format.segment ..segment_size)) (/.result (/.segment ..segment_size)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ binary.equivalence = expected actual)))))) (do [! random.monad] [data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] @@ -351,7 +350,7 @@ post /.end?] (in (and (not pre) post)))) - (!expect {#try.Success #1})))) + (!expect {try.#Success #1})))) (do [! random.monad] [to_read (\ ! each (n.% (++ ..segment_size)) random.nat) data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] @@ -366,7 +365,7 @@ (in (and (n.= 0 start) (n.= to_read offset) (n.= ..segment_size nothing_left))))) - (!expect {#try.Success #1})))) + (!expect {try.#Success #1})))) (do [! random.monad] [to_read (\ ! each (n.% (++ ..segment_size)) random.nat) data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] @@ -380,7 +379,7 @@ (in (and (n.= ..segment_size (n.+ to_read remaining)) (n.= 0 nothing_left))))) - (!expect {#try.Success #1})))) + (!expect {try.#Success #1})))) ..size ..binary ..utf8 diff --git a/stdlib/source/test/lux/control/parser/cli.lux b/stdlib/source/test/lux/control/parser/cli.lux index fe10e5ccd..d8d936cd1 100644 --- a/stdlib/source/test/lux/control/parser/cli.lux +++ b/stdlib/source/test/lux/control/parser/cli.lux @@ -42,42 +42,42 @@ ($_ _.and (_.cover [/.result /.any] (|> (/.result /.any (list expected)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (text\= expected actual))))) (_.cover [/.parse] (|> (/.result (/.parse n\decoded) (list expected)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (text\= expected (n\encoded actual)))))) (_.cover [/.this] (and (|> (/.result (/.this expected) (list expected)) - (!expect {#try.Success _})) + (!expect {try.#Success _})) (|> (/.result (/.this expected) (list dummy)) - (!expect {#try.Failure _})))) + (!expect {try.#Failure _})))) (_.cover [/.somewhere] (|> (/.result (|> (/.somewhere (/.this expected)) (<>.before (<>.some /.any))) (list.together (list pre_ignore (list expected) post_ignore))) - (!expect {#try.Success _}))) + (!expect {try.#Success _}))) (_.cover [/.end] (and (|> (/.result /.end (list)) - (!expect {#try.Success _})) + (!expect {try.#Success _})) (|> (/.result (<>.not /.end) (list expected)) - (!expect {#try.Failure _})))) + (!expect {try.#Failure _})))) (_.cover [/.named] (|> (/.result (/.named dummy /.any) (list dummy expected)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (text\= expected actual))))) (_.cover [/.parameter] (and (|> (/.result (/.parameter [short long] /.any) (list short expected)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (text\= expected actual)))) (|> (/.result (/.parameter [short long] /.any) (list long expected)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (text\= expected actual)))) (|> (/.result (/.parameter [short long] /.any) (list dummy expected)) - (!expect {#try.Failure _})))) + (!expect {try.#Failure _})))) )))) diff --git a/stdlib/source/test/lux/control/parser/code.lux b/stdlib/source/test/lux/control/parser/code.lux index 400aea243..501e2d4ab 100644 --- a/stdlib/source/test/lux/control/parser/code.lux +++ b/stdlib/source/test/lux/control/parser/code.lux @@ -48,9 +48,9 @@ [expected (\ ! each code.bit random.bit)] (_.cover [/.result] (and (|> (/.result /.any (list expected)) - (!expect {#try.Success _})) + (!expect {try.#Success _})) (|> (/.result /.any (list)) - (!expect {#try.Failure _}))))) + (!expect {try.#Failure _}))))) (~~ (template [<query> <check> <random> <code> <equivalence>] [(do [! random.monad] [expected <random> @@ -58,13 +58,13 @@ ($_ _.and (_.cover [<query>] (|> (/.result <query> (list (<code> expected))) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ <equivalence> = expected actual))))) (_.cover [<check>] (and (|> (/.result (<check> expected) (list (<code> expected))) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result (<check> expected) (list (<code> dummy))) - (!expect {#try.Failure _})))) + (!expect {try.#Failure _})))) ))] [/.any /.this! (\ ! each code.bit random.bit) function.identity code.equivalence] @@ -75,9 +75,7 @@ [/.frac /.frac! random.safe_frac code.frac frac.equivalence] [/.text /.text! (random.unicode 1) code.text text.equivalence] [/.identifier /.identifier! ..random_name code.identifier name.equivalence] - [/.tag /.tag! ..random_name code.tag name.equivalence] [/.local_identifier /.local_identifier! (random.unicode 1) code.local_identifier text.equivalence] - [/.local_tag /.local_tag! (random.unicode 1) code.local_tag text.equivalence] )) (~~ (template [<query> <code>] [(do [! random.monad] @@ -87,7 +85,7 @@ (|> (/.result (<query> (<>.and /.nat /.int)) (list (<code> (list (code.nat expected_left) (code.int expected_right))))) - (!expect (^multi {#try.Success [actual_left actual_right]} + (!expect (^multi {try.#Success [actual_left actual_right]} (and (\ nat.equivalence = expected_left actual_left) (\ int.equivalence = expected_right actual_right)))))))] @@ -102,7 +100,7 @@ (|> (/.result (<>.and (/.local (list (code.nat expected_local)) /.nat) /.int) (list (code.int expected_global))) - (!expect (^multi {#try.Success [actual_local actual_global]} + (!expect (^multi {try.#Success [actual_local actual_global]} (and (\ nat.equivalence = expected_local actual_local) (\ int.equivalence = expected_global actual_global))))))) (do [! random.monad] @@ -115,15 +113,15 @@ (in (and (not pre) post))) (list dummy)) - (!expect (^multi {#try.Success verdict} + (!expect (^multi {try.#Success verdict} verdict))))) (do [! random.monad] [dummy (\ ! each code.bit random.bit)] (_.cover [/.end!] (and (|> (/.result /.end! (list)) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result /.end! (list dummy)) - (!expect {#try.Failure _}))))) + (!expect {try.#Failure _}))))) (do [! random.monad] [expected (\ ! each code.bit random.bit)] (_.cover [/.next] @@ -133,13 +131,13 @@ (in (and (same? expected pre) (same? pre post)))) (list expected)) - (!expect {#try.Success _})))) + (!expect {try.#Success _})))) (do [! random.monad] [expected (\ ! each code.bit random.bit)] (_.cover [/.not] (and (|> (/.result (/.not /.nat) (list expected)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (same? expected actual)))) (|> (/.result (/.not /.bit) (list expected)) - (!expect {#try.Failure _}))))) + (!expect {try.#Failure _}))))) )))) diff --git a/stdlib/source/test/lux/control/parser/environment.lux b/stdlib/source/test/lux/control/parser/environment.lux index dbef40a52..06d06bc53 100644 --- a/stdlib/source/test/lux/control/parser/environment.lux +++ b/stdlib/source/test/lux/control/parser/environment.lux @@ -45,9 +45,9 @@ [property (random.ascii/alpha 1)] (_.cover [/.unknown_property] (case (/.result (/.property property) /.empty) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.unknown_property error)))) ))) diff --git a/stdlib/source/test/lux/control/parser/json.lux b/stdlib/source/test/lux/control/parser/json.lux index ad35703ab..6728343fb 100644 --- a/stdlib/source/test/lux/control/parser/json.lux +++ b/stdlib/source/test/lux/control/parser/json.lux @@ -46,14 +46,14 @@ (_.for [/.Parser]) (`` ($_ _.and (do [! random.monad] - [expected (\ ! each (|>> #json.String) (random.unicode 1))] + [expected (\ ! each (|>> {json.#String}) (random.unicode 1))] (_.cover [/.result /.any] (|> (/.result /.any expected) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ json.equivalence = expected actual)))))) (_.cover [/.null] - (|> (/.result /.null #json.Null) - (!expect {#try.Success _}))) + (|> (/.result /.null {json.#Null}) + (!expect {try.#Success _}))) (~~ (template [<query> <test> <check> <random> <json> <equivalence>] [(do [! random.monad] [expected <random> @@ -61,46 +61,46 @@ ($_ _.and (_.cover [<query>] (|> (/.result <query> {<json> expected}) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ <equivalence> = expected actual))))) (_.cover [<test>] (and (|> (/.result (<test> expected) {<json> expected}) - (!expect {#try.Success #1})) + (!expect {try.#Success #1})) (|> (/.result (<test> expected) {<json> dummy}) - (!expect {#try.Success #0})))) + (!expect {try.#Success #0})))) (_.cover [<check>] (and (|> (/.result (<check> expected) {<json> expected}) - (!expect {#try.Success _})) + (!expect {try.#Success _})) (|> (/.result (<check> expected) {<json> dummy}) - (!expect {#try.Failure _}))))))] + (!expect {try.#Failure _}))))))] - [/.boolean /.boolean? /.boolean! random.bit #json.Boolean bit.equivalence] - [/.number /.number? /.number! ..safe_frac #json.Number frac.equivalence] - [/.string /.string? /.string! (random.unicode 1) #json.String text.equivalence] + [/.boolean /.boolean? /.boolean! random.bit json.#Boolean bit.equivalence] + [/.number /.number? /.number! ..safe_frac json.#Number frac.equivalence] + [/.string /.string? /.string! (random.unicode 1) json.#String text.equivalence] )) (do [! random.monad] [expected (random.unicode 1) dummy random.bit] (_.cover [/.unexpected_value] - (|> (/.result /.string {#json.Boolean dummy}) - (!expect (^multi {#try.Failure error} + (|> (/.result /.string {json.#Boolean dummy}) + (!expect (^multi {try.#Failure error} (exception.match? /.unexpected_value error)))))) (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} + (|> (/.result (/.string! expected) {json.#String dummy}) + (!expect (^multi {try.#Failure error} (exception.match? /.value_mismatch error)))))) (do [! random.monad] [expected (random.unicode 1)] (_.cover [/.nullable] - (and (|> (/.result (/.nullable /.string) #json.Null) - (!expect (^multi {#try.Success actual} - (\ (maybe.equivalence text.equivalence) = #.None actual)))) - (|> (/.result (/.nullable /.string) {#json.String expected}) - (!expect (^multi {#try.Success actual} - (\ (maybe.equivalence text.equivalence) = {#.Some expected} actual))))))) + (and (|> (/.result (/.nullable /.string) {json.#Null}) + (!expect (^multi {try.#Success actual} + (\ (maybe.equivalence text.equivalence) = {.#None} actual)))) + (|> (/.result (/.nullable /.string) {json.#String expected}) + (!expect (^multi {try.#Success actual} + (\ (maybe.equivalence text.equivalence) = {.#Some expected} actual))))))) (do [! random.monad] [size (\ ! each (n.% 10) random.nat) expected (|> (random.unicode 1) @@ -108,18 +108,18 @@ (\ ! each row.of_list))] (_.cover [/.array] (|> (/.result (/.array (<>.some /.string)) - {#json.Array (row\each (|>> #json.String) expected)}) - (!expect (^multi {#try.Success actual} + {json.#Array (row\each (|>> {json.#String}) expected)}) + (!expect (^multi {try.#Success actual} (\ (row.equivalence text.equivalence) = expected (row.of_list actual))))))) (do [! random.monad] - [expected (\ ! each (|>> #json.String) (random.unicode 1))] + [expected (\ ! each (|>> {json.#String}) (random.unicode 1))] (_.cover [/.unconsumed_input] - (|> (/.result (/.array /.any) {#json.Array (row expected expected)}) - (!expect (^multi {#try.Failure error} + (|> (/.result (/.array /.any) {json.#Array (row expected expected)}) + (!expect (^multi {try.#Failure error} (exception.match? /.unconsumed_input error)))))) (_.cover [/.empty_input] - (|> (/.result (/.array /.any) {#json.Array (row)}) - (!expect (^multi {#try.Failure error} + (|> (/.result (/.array /.any) {json.#Array (row)}) + (!expect (^multi {try.#Failure error} (exception.match? /.empty_input error))))) (do [! random.monad] [expected_boolean random.bit @@ -137,12 +137,12 @@ (/.field boolean_field /.boolean) (/.field number_field /.number) (/.field string_field /.string))) - {#json.Object + {json.#Object (dictionary.of_list text.hash - (list [boolean_field {#json.Boolean expected_boolean}] - [number_field {#json.Number expected_number}] - [string_field {#json.String expected_string}]))}) - (!expect (^multi {#try.Success [actual_boolean actual_number actual_string]} + (list [boolean_field {json.#Boolean expected_boolean}] + [number_field {json.#Number expected_number}] + [string_field {json.#String expected_string}]))}) + (!expect (^multi {try.#Success [actual_boolean actual_number actual_string]} (and (\ bit.equivalence = expected_boolean actual_boolean) (\ frac.equivalence = expected_number actual_number) (\ text.equivalence = expected_string actual_string))))))) @@ -153,11 +153,11 @@ .let [expected (dictionary.of_list text.hash (list.zipped/2 keys values))]] (_.cover [/.dictionary] (|> (/.result (/.dictionary /.string) - {#json.Object + {json.#Object (|> values - (list\each (|>> #json.String)) + (list\each (|>> {json.#String})) (list.zipped/2 keys) (dictionary.of_list text.hash))}) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ (dictionary.equivalence text.equivalence) = expected actual)))))) )))) diff --git a/stdlib/source/test/lux/control/parser/synthesis.lux b/stdlib/source/test/lux/control/parser/synthesis.lux index 67906c0a1..161ee54bc 100644 --- a/stdlib/source/test/lux/control/parser/synthesis.lux +++ b/stdlib/source/test/lux/control/parser/synthesis.lux @@ -68,13 +68,13 @@ ($_ _.and (_.cover [<query>] (|> (/.result <query> (list (<synthesis> expected))) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ <equivalence> = expected actual))))) (_.cover [<check>] (and (|> (/.result (<check> expected) (list (<synthesis> expected))) - (!expect {#try.Success _})) + (!expect {try.#Success _})) (|> (/.result (<check> expected) (list (<synthesis> dummy))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.cannot_parse error)))))) ))] @@ -102,14 +102,14 @@ (synthesis.i64 expected_i64) (synthesis.f64 expected_f64) (synthesis.text expected_text))))) - (!expect (^multi {#try.Success [actual_bit actual_i64 actual_f64 actual_text]} + (!expect (^multi {try.#Success [actual_bit actual_i64 actual_f64 actual_text]} (and (\ bit.equivalence = expected_bit actual_bit) (\ i64.equivalence = expected_i64 actual_i64) (\ frac.equivalence = expected_f64 actual_f64) (\ text.equivalence = expected_text actual_text))))) (|> (/.result (/.tuple ($_ <>.and /.bit /.i64 /.f64 /.text)) (list (synthesis.text expected_text))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.cannot_parse error))))))) (do [! random.monad] [arity random.nat @@ -118,14 +118,14 @@ (_.cover [/.function] (and (|> (/.result (/.function arity /.text) (list (synthesis.function/abstraction [expected_environment arity (synthesis.text expected_body)]))) - (!expect (^multi {#try.Success [actual_environment actual_body]} + (!expect (^multi {try.#Success [actual_environment actual_body]} (and (\ (list.equivalence synthesis.equivalence) = expected_environment actual_environment) (\ text.equivalence = expected_body actual_body))))) (|> (/.result (/.function arity /.text) (list (synthesis.text expected_body))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.cannot_parse error))))))) (do [! random.monad] [arity random.nat @@ -134,7 +134,7 @@ (_.cover [/.wrong_arity] (|> (/.result (/.function (++ arity) /.text) (list (synthesis.function/abstraction [expected_environment arity (synthesis.text expected_body)]))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.wrong_arity error)))))) (do [! random.monad] [arity (\ ! each (|>> (n.% 10) ++) random.nat) @@ -146,7 +146,7 @@ (list (synthesis.loop/scope [expected_offset (list\each (|>> synthesis.bit) expected_inits) (synthesis.text expected_body)]))) - (!expect (^multi {#try.Success [actual_offset actual_inits actual_body]} + (!expect (^multi {try.#Success [actual_offset actual_inits actual_body]} (and (\ n.equivalence = expected_offset actual_offset) (\ (list.equivalence bit.equivalence) = expected_inits @@ -154,7 +154,7 @@ (\ text.equivalence = expected_body actual_body))))) (|> (/.result (/.loop (<>.many /.bit) /.text) (list (synthesis.text expected_body))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.cannot_parse error))))))) )) @@ -167,33 +167,33 @@ [expected (\ ! each (|>> synthesis.i64) random.nat)] (_.cover [/.result /.any] (|> (/.result /.any (list expected)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ synthesis.equivalence = expected actual)))))) (_.cover [/.empty_input] (|> (/.result /.any (list)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.empty_input error))))) (do [! random.monad] [expected (\ ! each (|>> synthesis.i64) random.nat)] (_.cover [/.unconsumed_input] (|> (/.result /.any (list expected expected)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.unconsumed_input error)))))) (do [! random.monad] [dummy (\ ! each (|>> synthesis.i64) random.nat)] (_.cover [/.end! /.expected_empty_input] (and (|> (/.result /.end! (list)) - (!expect {#try.Success _})) + (!expect {try.#Success _})) (|> (/.result /.end! (list dummy)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.expected_empty_input error))))))) (do [! random.monad] [dummy (\ ! each (|>> synthesis.i64) random.nat)] (_.cover [/.end?] (and (|> (/.result /.end? (list)) - (!expect {#try.Success #1})) + (!expect {try.#Success #1})) (|> (/.result (<>.before /.any /.end?) (list dummy)) - (!expect {#try.Success #0}))))) + (!expect {try.#Success #0}))))) (_.for [/.cannot_parse] ($_ _.and ..simple diff --git a/stdlib/source/test/lux/control/parser/text.lux b/stdlib/source/test/lux/control/parser/text.lux index 8377f6b4b..b340e8450 100644 --- a/stdlib/source/test/lux/control/parser/text.lux +++ b/stdlib/source/test/lux/control/parser/text.lux @@ -42,7 +42,7 @@ (def: (should_fail' sample parser exception) (All (_ a e) (-> Text (/.Parser a) (Exception e) Bit)) (case (/.result parser sample) - {#try.Failure error} + {try.#Failure error} (exception.match? exception error) _ @@ -51,7 +51,7 @@ (def: (should_fail sample parser) (All (_ a) (-> Text (/.Parser a) Bit)) (case (/.result parser sample) - {#try.Failure _} + {try.#Failure _} true _ @@ -301,10 +301,10 @@ (_.cover [/.result /.end!] (and (|> (/.result /.end! "") - (!expect {#try.Success _})) + (!expect {try.#Success _})) (|> (/.result /.end! sample) - (!expect {#try.Failure _}))))) + (!expect {try.#Failure _}))))) (do [! random.monad] [.let [size 10] expected (random.unicode size) @@ -313,15 +313,15 @@ (_.cover [/.this /.cannot_match] (and (|> (/.result (/.this expected) expected) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result (/.this expected) dummy) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.cannot_match error))))))) (_.cover [/.Slice /.slice /.cannot_slice] (|> "" (/.result (/.slice /.any!)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.cannot_slice error))))) (do [! random.monad] [expected (random.unicode 1)] @@ -337,14 +337,14 @@ (and (..should_pass expected (<>.before /.any /.next)) (|> "" (/.result (<>.before /.any /.next)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.cannot_parse error))))))) (do [! random.monad] [dummy (random.unicode 1)] (_.cover [/.unconsumed_input] (|> (format dummy dummy) (/.result /.any) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.unconsumed_input error)))))) (do [! random.monad] [sample (random.unicode 1)] @@ -355,7 +355,7 @@ _ /.any post /.offset] (in [pre post]))) - (!expect {#try.Success [0 1]})))) + (!expect {try.#Success [0 1]})))) (do [! random.monad] [left (random.unicode 1) right (random.unicode 1) @@ -369,7 +369,7 @@ _ /.any] (in (and (text\= input pre) (text\= right post))))) - (!expect {#try.Success #1})))) + (!expect {try.#Success #1})))) (do [! random.monad] [left (random.unicode 1) right (random.unicode 1) @@ -378,7 +378,7 @@ (_.cover [/.enclosed] (|> (format left expected right) (/.result (/.enclosed [left right] (/.this expected))) - (!expect {#try.Success _})))) + (!expect {try.#Success _})))) (do [! random.monad] [input (random.unicode 1) output (random.unicode 1)] @@ -387,13 +387,13 @@ (/.result (do <>.monad [_ (/.local input (/.this input))] (/.this output))) - (!expect {#try.Success _})))) + (!expect {try.#Success _})))) (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} + (!expect (^multi {try.#Success actual} (text\= expected actual)))))) (do [! random.monad] [invalid (random.ascii/upper 1) @@ -405,13 +405,13 @@ (and (..should_pass (text.of_char expected) (/.not /.upper)) (|> invalid (/.result (/.not /.upper)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.expected_to_fail error)))) (..should_pass! (text.of_char expected) (/.not! upper!)) (|> invalid (/.result (/.not! upper!)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.expected_to_fail error))))))) (do [! random.monad] [upper (random.ascii/upper 1) diff --git a/stdlib/source/test/lux/control/parser/tree.lux b/stdlib/source/test/lux/control/parser/tree.lux index d99273be5..f0bf2a2a0 100644 --- a/stdlib/source/test/lux/control/parser/tree.lux +++ b/stdlib/source/test/lux/control/parser/tree.lux @@ -34,7 +34,7 @@ (_.cover <coverage> (|> (/.result <parser> <sample>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= expected actual))))))]) (template: (!cover/2 <coverage> <parser> <sample0> <sample1>) @@ -43,10 +43,10 @@ expected (|> random.nat (random.only (|>> (n.= dummy) not)))] (_.cover <coverage> (and (|> (/.result <parser> <sample0>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= expected actual)))) (|> (/.result <parser> <sample1>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= expected actual)))))))]) (def: .public test @@ -62,7 +62,7 @@ (_.cover [/.result'] (|> (/.result' /.value (zipper.zipper (tree.leaf expected))) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= expected actual)))))) (!cover [/.down] (do //.monad @@ -163,7 +163,7 @@ (`` (and (~~ (template [<parser>] [(|> (/.result <parser> (tree.leaf dummy)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.cannot_move_further error))))] [/.down] [/.up] diff --git a/stdlib/source/test/lux/control/parser/type.lux b/stdlib/source/test/lux/control/parser/type.lux index 3d27819bd..3e26eb4ab 100644 --- a/stdlib/source/test/lux/control/parser/type.lux +++ b/stdlib/source/test/lux/control/parser/type.lux @@ -32,7 +32,7 @@ (Random Type) (|> (random.ascii/alpha_num 1) (\ random.monad each (function (_ name) - {#.Primitive name (list)})))) + {.#Primitive name (list)})))) (def: matches Test @@ -44,29 +44,29 @@ ($_ _.and (_.cover [/.exactly] (and (|> (/.result (/.exactly expected) expected) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result (/.exactly expected) dummy) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.types_do_not_match error)))))) (_.cover [/.sub] (and (|> (/.result (/.sub expected) expected) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result (/.sub Any) expected) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result (/.sub expected) Nothing) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result (/.sub expected) dummy) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.types_do_not_match error)))))) (_.cover [/.super] (and (|> (/.result (/.super expected) expected) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result (/.super expected) Any) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result (/.super Nothing) expected) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.result (/.super expected) dummy) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.types_do_not_match error)))))) ))) @@ -81,13 +81,13 @@ [(_.cover [<parser> <exception>] (and (|> (/.result (<parser> ($_ //.and /.any /.any /.any)) (<good_constructor> (list expected_left expected_middle expected_right))) - (!expect (^multi {#try.Success [actual_left actual_middle actual_right]} + (!expect (^multi {try.#Success [actual_left actual_middle actual_right]} (and (type\= expected_left actual_left) (type\= expected_middle actual_middle) (type\= expected_right actual_right))))) (|> (/.result (<parser> ($_ //.and /.any /.any /.any)) (<bad_constructor> (list expected_left expected_middle expected_right))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? <exception> error))))))] [/.variant /.not_variant type.variant type.tuple] @@ -97,24 +97,24 @@ (_.cover [/.function /.not_function] (and (|> (/.result (/.function ($_ //.and /.any /.any) /.any) (type.function (list expected_left expected_middle) expected_right)) - (!expect (^multi {#try.Success [[actual_left actual_middle] actual_right]} + (!expect (^multi {try.#Success [[actual_left actual_middle] actual_right]} (and (type\= expected_left actual_left) (type\= expected_middle actual_middle) (type\= expected_right actual_right))))) (|> (/.result (/.function ($_ //.and /.any /.any) /.any) (type.variant (list expected_left expected_middle expected_right))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.not_function error)))))) (_.cover [/.applied /.not_application] (and (|> (/.result (/.applied ($_ //.and /.any /.any /.any)) (type.application (list expected_middle expected_right) expected_left)) - (!expect (^multi {#try.Success [actual_left actual_middle actual_right]} + (!expect (^multi {try.#Success [actual_left actual_middle actual_right]} (and (type\= expected_left actual_left) (type\= expected_middle actual_middle) (type\= expected_right actual_right))))) (|> (/.result (/.applied ($_ //.and /.any /.any /.any)) (type.variant (list expected_left expected_middle expected_right))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.not_application error)))))) )))) @@ -128,38 +128,38 @@ ($_ _.and (_.cover [/.not_parameter] (|> (/.result /.parameter not_parameter) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.not_parameter error))))) (_.cover [/.unknown_parameter] - (|> (/.result /.parameter {#.Parameter parameter}) - (!expect (^multi {#try.Failure error} + (|> (/.result /.parameter {.#Parameter parameter}) + (!expect (^multi {try.#Failure error} (exception.match? /.unknown_parameter error))))) (_.cover [/.with_extension] (|> (/.result (<| (/.with_extension quantification) (/.with_extension argument) /.any) not_parameter) - (!expect (^multi {#try.Success [quantification\\binding argument\\binding actual]} + (!expect (^multi {try.#Success [quantification\\binding argument\\binding actual]} (same? not_parameter actual))))) (_.cover [/.parameter] (|> (/.result (<| (/.with_extension quantification) (/.with_extension argument) /.parameter) - {#.Parameter 0}) - (!expect {#try.Success [quantification\\binding argument\\binding _]}))) + {.#Parameter 0}) + (!expect {try.#Success [quantification\\binding argument\\binding _]}))) (_.cover [/.wrong_parameter] (|> (/.result (<| (/.with_extension quantification) (/.with_extension argument) (/.parameter! 1)) - {#.Parameter 0}) - (!expect (^multi {#try.Failure error} + {.#Parameter 0}) + (!expect (^multi {try.#Failure error} (exception.match? /.wrong_parameter error))))) (_.cover [/.parameter!] (|> (/.result (<| (/.with_extension quantification) (/.with_extension argument) (/.parameter! 0)) - {#.Parameter 0}) - (!expect {#try.Success [quantification\\binding argument\\binding _]}))) + {.#Parameter 0}) + (!expect {try.#Success [quantification\\binding argument\\binding _]}))) ))) (def: polymorphic @@ -171,16 +171,16 @@ (_.cover [/.not_polymorphic] (and (|> (/.result (/.polymorphic /.any) not_polymorphic) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.not_polymorphic error)))) (|> (/.result (/.polymorphic /.any) (type.univ_q 0 not_polymorphic)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.not_polymorphic error)))))) (_.cover [/.polymorphic] (|> (/.result (/.polymorphic /.any) (type.univ_q expected_inputs not_polymorphic)) - (!expect (^multi {#try.Success [g!poly actual_inputs bodyT]} + (!expect (^multi {try.#Success [g!poly actual_inputs bodyT]} (and (n.= expected_inputs (list.size actual_inputs)) (same? not_polymorphic bodyT)))))) ))) @@ -194,7 +194,7 @@ [expected ..primitive] (_.cover [/.result /.any] (|> (/.result /.any expected) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (type\= expected actual)))))) (do [! random.monad] [expected ..primitive] @@ -204,10 +204,10 @@ _ /.any] (in actual)) expected) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (type\= expected actual)))) (|> (/.result /.next expected) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.unconsumed_input error))))))) (do [! random.monad] [expected ..primitive] @@ -217,7 +217,7 @@ [_ /.any] <parser>) expected) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.empty_input error))))] [/.any] @@ -231,7 +231,7 @@ _ /.any] (in env)) expected) - (!expect (^multi {#try.Success environment} + (!expect (^multi {try.#Success environment} (same? /.fresh environment)))))) (do [! random.monad] [expected ..primitive @@ -243,14 +243,14 @@ (/.local (list expected) /.any)) dummy) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (type\= expected actual)))))) (do [! random.monad] [expected random.nat] (_.cover [/.existential /.not_existential] (|> (/.result /.existential - {#.Ex expected}) - (!expect (^multi {#try.Success actual} + {.#Ex expected}) + (!expect (^multi {try.#Success actual} (n.= expected actual)))))) (do [! random.monad] [expected_name (random.and (random.ascii/alpha_num 1) @@ -258,8 +258,8 @@ expected_type ..primitive] (_.cover [/.named /.not_named] (|> (/.result /.named - {#.Named expected_name expected_type}) - (!expect (^multi {#try.Success [actual_name actual_type]} + {.#Named expected_name expected_type}) + (!expect (^multi {try.#Success [actual_name actual_type]} (and (name\= expected_name actual_name) (type\= expected_type actual_type))))))) ..aggregate diff --git a/stdlib/source/test/lux/control/parser/xml.lux b/stdlib/source/test/lux/control/parser/xml.lux index 511f56e78..7b87831a8 100644 --- a/stdlib/source/test/lux/control/parser/xml.lux +++ b/stdlib/source/test/lux/control/parser/xml.lux @@ -41,7 +41,7 @@ (_.cover [<exception>] (`` (and (~~ (template [<parser> <input>] [(|> (/.result <parser> (list <input>)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? <exception> error))))] <<cases>>)))))))]) @@ -62,14 +62,14 @@ (do [! random.monad] [expected (random.ascii/alpha 1)] (_.cover [/.result /.text] - (|> (/.result /.text (list {#xml.Text expected})) - (!expect (^multi {#try.Success actual} + (|> (/.result /.text (list {xml.#Text expected})) + (!expect (^multi {try.#Success actual} (text\= expected actual)))))) (!failure /.unconsumed_inputs [[(//\in expected) - {#xml.Text expected}]]) + {xml.#Text expected}]]) (do [! random.monad] - [expected (\ ! each (|>> #xml.Text) (random.ascii/alpha 1))] + [expected (\ ! each (|>> {xml.#Text}) (random.ascii/alpha 1))] (_.cover [/.any] (|> (/.result /.any (list expected)) (try\each (xml\= expected)) @@ -81,17 +81,17 @@ [actual /.tag _ /.any] (in (name\= expected actual))) - (list {#xml.Node expected (dictionary.empty name.hash) (list)})) - (!expect {#try.Success #1})))) + (list {xml.#Node expected (dictionary.empty name.hash) (list)})) + (!expect {try.#Success #1})))) (do [! random.monad] [expected ..random_tag] (_.cover [/.node] (|> (/.result (/.node expected (//\in [])) - (list {#xml.Node expected (dictionary.empty name.hash) (list)})) - (!expect {#try.Success []})))) + (list {xml.#Node expected (dictionary.empty name.hash) (list)})) + (!expect {try.#Success []})))) (!failure /.wrong_tag [[(/.node ["" expected] (//\in [])) - {#xml.Node [expected ""] (dictionary.empty name.hash) (list)}]]) + {xml.#Node [expected ""] (dictionary.empty name.hash) (list)}]]) (do [! random.monad] [expected_tag ..random_tag expected_attribute ..random_attribute @@ -100,14 +100,14 @@ (|> (/.result (<| (/.node expected_tag) (//.after (/.attribute expected_attribute)) (//\in [])) - (list {#xml.Node expected_tag + (list {xml.#Node expected_tag (|> (dictionary.empty name.hash) (dictionary.has expected_attribute expected_value)) (list)})) - (!expect {#try.Success []})))) + (!expect {try.#Success []})))) (!failure /.unknown_attribute [[(/.attribute ["" expected]) - {#xml.Node [expected expected] + {xml.#Node [expected expected] (|> (dictionary.empty name.hash) (dictionary.has [expected ""] expected)) (list)}]]) @@ -115,39 +115,39 @@ [[(do //.monad [_ /.any] /.any) - {#xml.Text expected}] + {xml.#Text expected}] [(do //.monad [_ /.any] /.text) - {#xml.Text expected}] + {xml.#Text expected}] [(do //.monad [_ /.any] (/.node [expected expected] (//\in []))) - {#xml.Node [expected expected] + {xml.#Node [expected expected] (dictionary.empty name.hash) (list)}] [(do //.monad [_ /.any] (/.node [expected expected] (/.attribute [expected expected]))) - {#xml.Node [expected expected] + {xml.#Node [expected expected] (|> (dictionary.empty name.hash) (dictionary.has [expected expected] expected)) (list)}]]) (!failure /.unexpected_input [[/.text - {#xml.Node [expected expected] (dictionary.empty name.hash) (list)}] + {xml.#Node [expected expected] (dictionary.empty name.hash) (list)}] [(/.node [expected expected] (//\in [])) - {#xml.Text expected}] + {xml.#Text expected}] [(/.node [expected expected] (/.attribute [expected expected])) - {#xml.Text expected}]]) + {xml.#Text expected}]]) (do [! random.monad] [.let [node (: (-> xml.Tag (List xml.XML) xml.XML) (function (_ tag children) - {#xml.Node tag (dictionary.empty name.hash) children}))] + {xml.#Node tag (dictionary.empty name.hash) children}))] parent ..random_tag right ..random_tag wrong (random.only (|>> (name\= right) not) @@ -167,12 +167,12 @@ (list.together (list (list.repeated repetitions (node wrong (list))) (list (node right (list))) (list.repeated repetitions (node wrong (list)))))))) - (!expect {#try.Success []}))) + (!expect {try.#Success []}))) (_.cover [/.nowhere] (|> (/.result parser (list (node parent (list.repeated repetitions (node wrong (list)))))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.nowhere error))))) )) ))) diff --git a/stdlib/source/test/lux/control/region.lux b/stdlib/source/test/lux/control/region.lux index da88cb31e..9bdd575f7 100644 --- a/stdlib/source/test/lux/control/region.lux +++ b/stdlib/source/test/lux/control/region.lux @@ -33,19 +33,19 @@ (def: (success? result) (All (_ a) (-> (Try a) Bit)) (case result - {#try.Success _} + {try.#Success _} true - {#try.Failure _} + {try.#Failure _} false)) (def: (throws? exception result) (All (_ e a) (-> (Exception e) (Try a) Bit)) (case result - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? exception error))) (def: (injection value) @@ -53,7 +53,7 @@ (function (_ [region scope]) (function (_ !) [scope - {#try.Success value}]))) + {try.#Success value}]))) (def: comparison (Comparison (All (_ a) (All (_ ! r) (Region r (Thread !) a)))) @@ -70,7 +70,7 @@ (Try a) (thread.result (:expected (/.run! thread.monad right))))] - [{#try.Success left} {#try.Success right}] + [{try.#Success left} {try.#Success right}] (== left right) _ @@ -104,7 +104,7 @@ count_clean_up (function (_ value) (do ! [_ (thread.update! ++ clean_up_counter)] - (in {#try.Success []})))] + (in {try.#Success []})))] outcome (/.run! ! (do [! (/.monad !)] [_ (monad.each ! (/.acquire! //@ count_clean_up) @@ -122,7 +122,7 @@ count_clean_up (function (_ value) (do ! [_ (thread.update! ++ clean_up_counter)] - (in {#try.Success []})))] + (in {try.#Success []})))] outcome (/.run! ! (do [! (/.monad !)] [_ (monad.each ! (/.acquire! //@ count_clean_up) @@ -141,7 +141,7 @@ count_clean_up (function (_ value) (do ! [_ (thread.update! ++ clean_up_counter)] - (in {#try.Success []})))] + (in {try.#Success []})))] outcome (/.run! ! (do [! (/.monad !)] [_ (monad.each ! (/.acquire! //@ count_clean_up) diff --git a/stdlib/source/test/lux/control/remember.lux b/stdlib/source/test/lux/control/remember.lux index 3b210813d..704aaed01 100644 --- a/stdlib/source/test/lux/control/remember.lux +++ b/stdlib/source/test/lux/control/remember.lux @@ -38,28 +38,28 @@ (~ (code.text (%.date deadline))) (~ (code.text message)) (~+ (case focus - #.None (list) - {#.Some focus} (list focus)))))) + {.#None} (list) + {.#Some focus} (list focus)))))) (def: (attempt computation) (All (_ a) (-> (Meta a) (Meta (Try a)))) (function (_ compiler) (case (computation compiler) - {#try.Success [compiler output]} - {#try.Success [compiler {#try.Success output}]} + {try.#Success [compiler output]} + {try.#Success [compiler {try.#Success output}]} - {#try.Failure error} - {#try.Success [compiler {#try.Failure error}]}))) + {try.#Failure error} + {try.#Success [compiler {try.#Failure error}]}))) (def: (test_failure deadline message focus failure) (-> Date Text (Maybe Code) Text Bit) (and (text.contains? (%.date deadline) failure) (text.contains? message failure) (case focus - #.None + {.#None} true - {#.Some focus} + {.#Some focus} (text.contains? (%.code focus) failure)))) (syntax: (test_macro [macro <code>.identifier @@ -73,32 +73,32 @@ message (product.right (random.result prng ..message)) expected (product.right (random.result prng ..focus))] (do meta.monad - [should_fail0 (..attempt (macro.expansion (..memory macro yesterday message #.None))) - should_fail1 (..attempt (macro.expansion (..memory macro yesterday message {#.Some expected}))) - should_succeed0 (..attempt (macro.expansion (..memory macro tomorrow message #.None))) - should_succeed1 (..attempt (macro.expansion (..memory macro tomorrow message {#.Some expected})))] + [should_fail0 (..attempt (macro.expansion (..memory macro yesterday message {.#None}))) + should_fail1 (..attempt (macro.expansion (..memory macro yesterday message {.#Some expected}))) + should_succeed0 (..attempt (macro.expansion (..memory macro tomorrow message {.#None}))) + should_succeed1 (..attempt (macro.expansion (..memory macro tomorrow message {.#Some expected})))] (in (list (code.bit (and (case should_fail0 - {#try.Failure error} - (and (test_failure yesterday message #.None error) + {try.#Failure error} + (and (test_failure yesterday message {.#None} error) (text.contains? extra error)) _ false) (case should_fail1 - {#try.Failure error} - (and (test_failure yesterday message {#.Some expected} error) + {try.#Failure error} + (and (test_failure yesterday message {.#Some expected} error) (text.contains? extra error)) _ false) (case should_succeed0 - (^ {#try.Success (list)}) + (^ {try.#Success (list)}) true _ false) (case should_succeed1 - (^ {#try.Success (list actual)}) + (^ {try.#Success (list actual)}) (same? expected actual) _ @@ -114,10 +114,10 @@ focus ..focus] ($_ _.and (_.cover [/.must_remember] - (and (test_failure deadline message #.None - (exception.error /.must_remember [deadline deadline message #.None])) - (test_failure deadline message {#.Some focus} - (exception.error /.must_remember [deadline deadline message {#.Some focus}])))) + (and (test_failure deadline message {.#None} + (exception.error /.must_remember [deadline deadline message {.#None}])) + (test_failure deadline message {.#Some focus} + (exception.error /.must_remember [deadline deadline message {.#Some focus}])))) (_.cover [/.remember] (..test_macro /.remember "")) (_.cover [/.to_do] diff --git a/stdlib/source/test/lux/control/security/policy.lux b/stdlib/source/test/lux/control/security/policy.lux index 810020b02..63448cef6 100644 --- a/stdlib/source/test/lux/control/security/policy.lux +++ b/stdlib/source/test/lux/control/security/policy.lux @@ -48,21 +48,21 @@ (Ex (_ %) (-> Any (Policy %))) (/.with_policy (: (Context Privacy Policy) - (function (_ (^@ privilege (^open "%\[0]"))) + (function (_ (^@ privilege (^open "%[0]"))) (implementation (def: &hash (implementation (def: &equivalence (implementation (def: (= reference sample) - (text\= (%\can_downgrade reference) - (%\can_downgrade sample))))) + (text\= (%#can_downgrade reference) + (%#can_downgrade sample))))) (def: hash - (|>> %\can_downgrade + (|>> %#can_downgrade (\ text.hash hash))))) (def: password - %\can_upgrade) + %#can_upgrade) (def: privilege privilege)))))) @@ -81,18 +81,18 @@ /.Safety /.Safe /.Can_Trust /.Can_Distrust] ($_ _.and (_.for [/.functor] - ($functor.spec (..injection (\ policy_0 can_upgrade)) (..comparison (\ policy_0 can_downgrade)) /.functor)) + ($functor.spec (..injection (\ policy_0 #can_upgrade)) (..comparison (\ policy_0 #can_downgrade)) /.functor)) (_.for [/.apply] - ($apply.spec (..injection (\ policy_0 can_upgrade)) (..comparison (\ policy_0 can_downgrade)) /.apply)) + ($apply.spec (..injection (\ policy_0 #can_upgrade)) (..comparison (\ policy_0 #can_downgrade)) /.apply)) (_.for [/.monad] - ($monad.spec (..injection (\ policy_0 can_upgrade)) (..comparison (\ policy_0 can_downgrade)) /.monad)))) + ($monad.spec (..injection (\ policy_0 #can_upgrade)) (..comparison (\ policy_0 #can_downgrade)) /.monad)))) (_.cover [/.Privilege /.Context /.with_policy] (and (\ policy_0 = password password) (n.= (\ text.hash hash raw_password) (\ policy_0 hash password)))) (let [policy_1 (policy []) - delegate (/.delegation (\ policy_0 can_downgrade) (\ policy_1 can_upgrade))] + delegate (/.delegation (\ policy_0 #can_downgrade) (\ policy_1 #can_upgrade))] (_.cover [/.Delegation /.delegation] (\ policy_1 = (delegate password) (delegate password)))) )))) diff --git a/stdlib/source/test/lux/control/try.lux b/stdlib/source/test/lux/control/try.lux index 3e38574b2..6c05f2e53 100644 --- a/stdlib/source/test/lux/control/try.lux +++ b/stdlib/source/test/lux/control/try.lux @@ -23,7 +23,7 @@ (def: injection (Injection Try) - (|>> #/.Success)) + (|>> {/.#Success})) (def: comparison (Comparison Try) @@ -57,28 +57,28 @@ (_.cover [/.trusted] (n.= expected - (/.trusted {#/.Success expected}))) + (/.trusted {/.#Success expected}))) (_.cover [/.of_maybe] - (case [(/.of_maybe {#.Some expected}) - (/.of_maybe #.None)] - [{#/.Success actual} {#/.Failure _}] + (case [(/.of_maybe {.#Some expected}) + (/.of_maybe {.#None})] + [{/.#Success actual} {/.#Failure _}] (n.= expected actual) _ false)) (_.cover [/.maybe] - (case [(/.maybe {#/.Success expected}) - (/.maybe (: (/.Try Nat) {#/.Failure error}))] - [{#.Some actual} #.None] + (case [(/.maybe {/.#Success expected}) + (/.maybe (: (/.Try Nat) {/.#Failure error}))] + [{.#Some actual} {.#None}] (n.= expected actual) _ false)) (_.cover [/.else] (and (n.= expected - (/.else alternative {#/.Success expected})) + (/.else alternative {/.#Success expected})) (n.= alternative - (/.else alternative (: (Try Nat) {#/.Failure error}))))) + (/.else alternative (: (Try Nat) {/.#Failure error}))))) (_.cover [/.with /.lifted] (let [lifted (/.lifted io.monad)] (|> (do (/.with io.monad) @@ -86,7 +86,7 @@ b (in alternative)] (in (n.+ a b))) io.run! - (case> {#/.Success result} + (case> {/.#Success result} (n.= (n.+ expected alternative) result) diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index d301efd1c..ca497af1c 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -25,10 +25,10 @@ (def: (succeed result) (-> (Try Bit) Bit) (case result - {#try.Failure _} + {try.#Failure _} false - {#try.Success output} + {try.#Success output} output)) (def: .public (random size) @@ -45,10 +45,10 @@ (def: (throws? exception try) (All (_ e a) (-> (Exception e) (Try a) Bit)) (case try - {#try.Failure error} + {try.#Failure error} (exception.match? exception error) - {#try.Success _} + {try.#Success _} false)) (def: (binary_io power read write value) @@ -72,7 +72,7 @@ (def: as_list (-> /.Binary (List Nat)) (/.aggregate (function (_ head tail) - {#.Item head tail}) + {.#Item head tail}) (list))) (def: .public test @@ -123,7 +123,7 @@ (and (n.= length (/.size random_slice)) (case [(monad.each try.monad (|>> (n.+ offset) (reader sample)) idxs) (monad.each try.monad (reader random_slice) idxs)] - [{#try.Success binary_vals} {#try.Success slice_vals}] + [{try.#Success binary_vals} {try.#Success slice_vals}] (\ (list.equivalence n.equivalence) = binary_vals slice_vals) _ @@ -138,19 +138,19 @@ (and (\ /.equivalence = sample (/.after 0 sample)) (\ /.equivalence = (/.empty 0) (/.after size sample)) (case (list.reversed (..as_list sample)) - #.End + {.#End} false - {#.Item head tail} + {.#Item head tail} (n.= (list.mix n.+ 0 tail) (/.aggregate n.+ 0 (/.after 1 sample)))))) (_.cover [/.copy] (and (case (/.copy size 0 sample 0 (/.empty size)) - {#try.Success output} + {try.#Success output} (and (not (same? sample output)) (\ /.equivalence = sample output)) - {#try.Failure _} + {try.#Failure _} false) (succeed (do try.monad diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux index 243d77203..0337bd12a 100644 --- a/stdlib/source/test/lux/data/collection/array.lux +++ b/stdlib/source/test/lux/data/collection/array.lux @@ -59,33 +59,33 @@ (_.cover [/.example] (\ (maybe.equivalence n.equivalence) = (/.example n.even? the_array) - (list.example n.even? (/.list #.None the_array)))) + (list.example n.even? (/.list {.#None} the_array)))) (_.cover [/.example+] (case [(/.example n.even? the_array) (/.example+ (function (_ idx member) (n.even? member)) the_array)] - [{#.Some expected} {#.Some [idx actual]}] + [{.#Some expected} {.#Some [idx actual]}] (case (/.read! idx the_array) - {#.Some again} + {.#Some again} (and (n.= expected actual) (n.= actual again)) - #.None + {.#None} false) - [#.None #.None] + [{.#None} {.#None}] true _ false)) (_.cover [/.every?] (\ bit.equivalence = - (list.every? n.even? (/.list #.None the_array)) + (list.every? n.even? (/.list {.#None} the_array)) (/.every? n.even? the_array))) (_.cover [/.any?] (\ bit.equivalence = - (list.any? n.even? (/.list #.None the_array)) + (list.any? n.even? (/.list {.#None} the_array)) (/.any? n.even? the_array))) ))) @@ -109,7 +109,7 @@ (/.empty size))))) (_.cover [/.type_name] (case /.Array - (^ {#.Named _ {#.UnivQ _ {#.Primitive nominal_type (list {#.Parameter 1})}}}) + (^ {.#Named _ {.#UnivQ _ {.#Primitive nominal_type (list {.#Parameter 1})}}}) (same? /.type_name nominal_type) _ @@ -120,7 +120,7 @@ (/.write! 0 expected))] (case [(/.read! 0 the_array) (/.read! 1 the_array)] - [{#.Some actual} #.None] + [{.#Some actual} {.#None}] (n.= expected actual) _ @@ -131,7 +131,7 @@ (/.write! 0 expected))] (case [(/.read! 0 the_array) (/.read! 0 (/.delete! 0 the_array))] - [{#.Some actual} #.None] + [{.#Some actual} {.#None}] (n.= expected actual) _ @@ -149,7 +149,7 @@ (/.write! 0 base) (/.update! 0 (n.+ shift)))] (case (/.read! 0 the_array) - {#.Some actual} + {.#Some actual} (n.= expected actual) _ @@ -162,7 +162,7 @@ (/.upsert! 1 base (n.+ shift)))] (case [(/.read! 0 the_array) (/.read! 1 the_array)] - [{#.Some actual/0} {#.Some actual/1}] + [{.#Some actual/0} {.#Some actual/1}] (and (n.= expected actual/0) (n.= expected actual/1)) @@ -184,22 +184,22 @@ (do ! [the_list (random.list size random.nat) .let [the_array (/.clone the_array) - members (|> the_array (/.list #.None) (set.of_list n.hash))] + members (|> the_array (/.list {.#None}) (set.of_list n.hash))] default (random.only (function (_ value) (not (or (n.even? value) (set.member? members value)))) random.nat)] (_.cover [/.of_list /.list] - (and (|> the_list /.of_list (/.list #.None) + (and (|> the_list /.of_list (/.list {.#None}) (\ (list.equivalence n.equivalence) = the_list)) - (|> the_array (/.list #.None) /.of_list + (|> the_array (/.list {.#None}) /.of_list (\ (/.equivalence n.equivalence) = the_array)) (exec (/.filter! n.even? the_array) (list.every? (function (_ value) (or (n.even? value) (same? default value))) - (/.list {#.Some default} the_array)))))) + (/.list {.#Some default} the_array)))))) (do ! [amount (\ ! each (n.% (++ size)) random.nat)] (_.cover [/.copy!] @@ -207,18 +207,18 @@ (/.empty size))] (exec (/.copy! amount 0 the_array 0 copy) (\ (list.equivalence n.equivalence) = - (list.first amount (/.list #.None the_array)) - (/.list #.None copy)))))) + (list.first amount (/.list {.#None} the_array)) + (/.list {.#None} copy)))))) (_.cover [/.clone] (let [clone (/.clone the_array)] (and (not (same? the_array clone)) (\ (/.equivalence n.equivalence) = the_array clone)))) (let [the_array (/.clone the_array) - evens (|> the_array (/.list #.None) (list.only n.even?)) - odds (|> the_array (/.list #.None) (list.only n.odd?))] + evens (|> the_array (/.list {.#None}) (list.only n.even?)) + odds (|> the_array (/.list {.#None}) (list.only n.odd?))] (_.cover [/.filter!] (exec (/.filter! n.even? the_array) (and (n.= (list.size evens) (/.occupancy the_array)) (n.= (list.size odds) (/.vacancy the_array)) - (|> the_array (/.list #.None) (\ (list.equivalence n.equivalence) = evens)))))) + (|> the_array (/.list {.#None}) (\ (list.equivalence n.equivalence) = evens)))))) )))) diff --git a/stdlib/source/test/lux/data/collection/dictionary.lux b/stdlib/source/test/lux/data/collection/dictionary.lux index 2f8a58bfc..264f80fb9 100644 --- a/stdlib/source/test/lux/data/collection/dictionary.lux +++ b/stdlib/source/test/lux/data/collection/dictionary.lux @@ -147,39 +147,39 @@ (_.cover [/.value] (and (list.every? (function (_ key) (case (/.value key dict) - {#.Some _} true + {.#Some _} true _ false)) (/.keys dict)) (case (/.value non_key dict) - {#.Some _} false + {.#Some _} false _ true))) (_.cover [/.has] (and (n.= (++ (/.size dict)) (/.size (/.has non_key test_val dict))) (case (/.value non_key (/.has non_key test_val dict)) - {#.Some v} (n.= test_val v) + {.#Some v} (n.= test_val v) _ true))) (_.cover [/.has' /.key_already_exists] (let [can_put_new_keys! (case (/.has' non_key test_val dict) - {#try.Success dict} + {try.#Success dict} (case (/.value non_key dict) - {#.Some v} (n.= test_val v) + {.#Some v} (n.= test_val v) _ true) - {#try.Failure _} + {try.#Failure _} false) cannot_put_old_keys! (or (n.= 0 size) (let [first_key (|> dict /.keys list.head maybe.trusted)] (case (/.has' first_key test_val dict) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.key_already_exists error))))] (and can_put_new_keys! cannot_put_old_keys!))) @@ -189,10 +189,10 @@ (and (/.key? base non_key) (not (/.key? (/.lacks non_key base) non_key)))) (case (list.head (/.keys dict)) - #.None + {.#None} true - {#.Some known_key} + {.#Some known_key} (n.= (-- (/.size dict)) (/.size (/.lacks known_key dict)))))) @@ -200,7 +200,7 @@ (let [base (/.has non_key test_val dict) updt (/.revised non_key ++ base)] (case [(/.value non_key base) (/.value non_key updt)] - [{#.Some x} {#.Some y}] + [{.#Some x} {.#Some y}] (n.= (++ x) y) _ @@ -209,23 +209,23 @@ (_.cover [/.revised'] (let [can_upsert_new_key! (case (/.value non_key (/.revised' non_key test_val ++ dict)) - {#.Some inserted} + {.#Some inserted} (n.= (++ test_val) inserted) - #.None + {.#None} false) can_upsert_old_key! (case (list.head (/.entries dict)) - #.None + {.#None} true - {#.Some [known_key known_value]} + {.#Some [known_key known_value]} (case (/.value known_key (/.revised' known_key test_val ++ dict)) - {#.Some updated} + {.#Some updated} (n.= (++ known_value) updated) - #.None + {.#None} false))] (and can_upsert_new_key! can_upsert_old_key!))) diff --git a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux index 004b8e608..75749c61d 100644 --- a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux @@ -75,20 +75,20 @@ (/.empty? (/.empty n.order))) (_.cover [/.min] (case [(/.min sample) (list.head sorted_values)] - [#.None #.None] + [{.#None} {.#None}] #1 - [{#.Some reference} {#.Some sample}] + [{.#Some reference} {.#Some sample}] (n.= reference sample) _ #0)) (_.cover [/.max] (case [(/.max sample) (list.last sorted_values)] - [#.None #.None] + [{.#None} {.#None}] #1 - [{#.Some reference} {#.Some sample}] + [{.#Some reference} {.#Some sample}] (n.= reference sample) _ @@ -117,7 +117,7 @@ (let [sample+ (/.has extra_key extra_value sample)] (case [(/.value extra_key sample) (/.value extra_key sample+)] - [#.None {#.Some actual}] + [{.#None} {.#Some actual}] (n.= extra_value actual) _ diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index b2411ce74..d924cb788 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -168,10 +168,10 @@ (_.cover [/.item] (/.every? (function (_ [index expected]) (case (/.item index sample) - {#.Some actual} + {.#Some actual} (n.= expected actual) - #.None + {.#None} false)) (/.enumeration sample))) )))) @@ -238,20 +238,20 @@ [($_ _.and (_.cover [<head>] (case [(<pre> sample) (<head> sample)] - [{#.Item expected _} {#.Some actual}] + [{.#Item expected _} {.#Some actual}] (n.= expected actual) - [#.End #.None] + [{.#End} {.#None}] true _ false)) (_.cover [<tail>] (case [(<pre> sample) (<tail> sample)] - [{#.Item _ expected} {#.Some actual}] + [{.#Item _ expected} {.#Some actual}] (/\= (<pre> expected) actual) - [#.End #.None] + [{.#End} {.#None}] true _ @@ -355,8 +355,8 @@ choose (: (-> Nat (Maybe Text)) (function (_ value) (if (n.even? value) - {#.Some (\ n.decimal encoded value)} - #.None)))] + {.#Some (\ n.decimal encoded value)} + {.#None})))] (do [! random.monad] [sample ..random] ($_ _.and @@ -366,10 +366,10 @@ (/\each (\ n.decimal encoded)) /.head) (/.one choose sample)] - [{#.Some expected} {#.Some actual}] + [{.#Some expected} {.#Some actual}] (text\= expected actual) - [#.None #.None] + [{.#None} {.#None}] true _ @@ -382,10 +382,10 @@ (/.all choose sample))) (_.cover [/.example] (case (/.example n.even? sample) - {#.Some found} + {.#Some found} (n.even? found) - #.None + {.#None} (not (/.any? n.even? sample)))) )))) @@ -419,8 +419,8 @@ (/\= (/.indices size) (/.iterations (function (_ index) (if (n.< size index) - {#.Some (++ index)} - #.None)) + {.#Some (++ index)} + {.#None})) 0))))) (_.cover [/.mixes] (/\= (/\each (function (_ index) diff --git a/stdlib/source/test/lux/data/collection/queue.lux b/stdlib/source/test/lux/data/collection/queue.lux index 795806329..45053e52b 100644 --- a/stdlib/source/test/lux/data/collection/queue.lux +++ b/stdlib/source/test/lux/data/collection/queue.lux @@ -60,10 +60,10 @@ all_empty_queues_look_the_same!))) (_.cover [/.front] (case [members (/.front sample)] - [{#.Item head tail} {#.Some first}] + [{.#Item head tail} {.#Some first}] (n.= head first) - [#.End #.None] + [{.#End} {.#None}] true _ @@ -95,7 +95,7 @@ has_expected_order!))) (_.cover [/.next] (case members - {#.Item target expected} + {.#Item target expected} (let [popped (/.next sample) size_decreases! @@ -113,7 +113,7 @@ popped_member_is_not_identified! has_expected_order!)) - #.End + {.#End} (and (/.empty? sample) (/.empty? (/.next sample))))) )))) diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux index 6ec5cb958..807ee4fd5 100644 --- a/stdlib/source/test/lux/data/collection/queue/priority.lux +++ b/stdlib/source/test/lux/data/collection/queue/priority.lux @@ -49,17 +49,17 @@ (/.empty? /.empty)) (_.cover [/.front] (case (/.front sample) - {#.Some first} + {.#Some first} (n.> 0 (/.size sample)) - #.None + {.#None} (/.empty? sample))) (_.cover [/.member?] (case (/.front sample) - {#.Some first} + {.#Some first} (/.member? n.equivalence sample first) - #.None + {.#None} (/.empty? sample))) (_.cover [/.end] (let [sample+ (/.end non_member_priority non_member sample)] diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux index 684619006..17e1d8192 100644 --- a/stdlib/source/test/lux/data/collection/row.lux +++ b/stdlib/source/test/lux/data/collection/row.lux @@ -93,10 +93,10 @@ ($_ _.and (_.cover [/.item] (case (/.item good_index sample) - {#try.Success member} + {try.#Success member} (/.member? n.equivalence sample member) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.has] (<| (try.else false) @@ -118,10 +118,10 @@ (let [fails! (: (All (_ a) (-> (Try a) Bit)) (function (_ situation) (case situation - {#try.Success member} + {try.#Success member} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.index_out_of_bounds error))))] (and (fails! (/.item bad_index sample)) (fails! (/.has bad_index non_member sample)) diff --git a/stdlib/source/test/lux/data/collection/set/ordered.lux b/stdlib/source/test/lux/data/collection/set/ordered.lux index 89ad780c7..383c5c747 100644 --- a/stdlib/source/test/lux/data/collection/set/ordered.lux +++ b/stdlib/source/test/lux/data/collection/set/ordered.lux @@ -74,10 +74,10 @@ (~~ (template [<coverage> <comparison>] [(_.cover [<coverage>] (case (<coverage> setL) - {#.Some value} + {.#Some value} (|> setL /.list (list.every? (<comparison> value))) - #.None + {.#None} (/.empty? setL)))] [/.min n.>=] diff --git a/stdlib/source/test/lux/data/collection/stack.lux b/stdlib/source/test/lux/data/collection/stack.lux index 928dc475a..97e69923f 100644 --- a/stdlib/source/test/lux/data/collection/stack.lux +++ b/stdlib/source/test/lux/data/collection/stack.lux @@ -45,26 +45,26 @@ (/.empty? /.empty)) (_.cover [/.value] (case (/.value sample) - #.None + {.#None} (/.empty? sample) - {#.Some _} + {.#Some _} (not (/.empty? sample)))) (_.cover [/.next] (case (/.next sample) - #.None + {.#None} (/.empty? sample) - {#.Some [top remaining]} + {.#Some [top remaining]} (\ (/.equivalence n.equivalence) = sample (/.top top remaining)))) (_.cover [/.top] (case (/.next (/.top expected_top sample)) - {#.Some [actual_top actual_sample]} + {.#Some [actual_top actual_sample]} (and (same? expected_top actual_top) (same? sample actual_sample)) - #.None + {.#None} false)) )))) diff --git a/stdlib/source/test/lux/data/collection/tree.lux b/stdlib/source/test/lux/data/collection/tree.lux index 0e18e595e..fef8c14f6 100644 --- a/stdlib/source/test/lux/data/collection/tree.lux +++ b/stdlib/source/test/lux/data/collection/tree.lux @@ -28,8 +28,8 @@ (in [(|> children (list\each product.left) (list\mix n.+ 1)) - [#/.value value - #/.children (list\each product.right children)]]))) + [/.#value value + /.#children (list\each product.right children)]]))) (def: .public test Test diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux index c067ba36c..e00a0773b 100644 --- a/stdlib/source/test/lux/data/collection/tree/finger.lux +++ b/stdlib/source/test/lux/data/collection/tree/finger.lux @@ -51,21 +51,21 @@ (\ ..builder leaf tag_right expected_right)))))) (_.cover [/.root] (and (case (/.root (\ ..builder leaf tag_left expected_left)) - {#.Left actual} + {.#Left actual} (n.= expected_left actual) - {#.Right _} + {.#Right _} false) (case (/.root (\ ..builder branch (\ ..builder leaf tag_left expected_left) (\ ..builder leaf tag_right expected_right))) - {#.Left _} + {.#Left _} false - {#.Right [left right]} + {.#Right [left right]} (case [(/.root left) (/.root right)] - [{#.Left actual_left} {#.Left actual_right}] + [{.#Left actual_left} {.#Left actual_right}] (and (n.= expected_left actual_left) (n.= expected_right actual_right)) diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 0b6a33e05..f71def6fe 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -77,7 +77,7 @@ (\ bit.equivalence = (/.null? sample) (case sample - #/.Null true + {/.#Null} true _ false)))) (do random.monad [expected ..random] @@ -91,17 +91,17 @@ [keys (random.set text.hash 3 (random.ascii/alpha 1)) values (random.set frac.hash 3 random.safe_frac) .let [expected (list.zipped/2 (set.list keys) - (list\each (|>> #/.Number) (set.list values))) + (list\each (|>> {/.#Number}) (set.list values))) object (/.object expected)]] ($_ _.and (_.cover [/.object /.fields] (case (/.fields object) - {#try.Success actual} + {try.#Success actual} (\ (list.equivalence text.equivalence) = (list\each product.left expected) actual) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.field] (list.every? (function (_ [key expected]) @@ -118,19 +118,19 @@ (_.cover [/.has] (<| (try.else false) (do try.monad - [object (/.has key {#/.Number expected} (/.object (list))) + [object (/.has key {/.#Number expected} (/.object (list))) .let [can_find_known_key! (|> object (/.field key) - (try\each (\= {#/.Number expected})) + (try\each (\= {/.#Number expected})) (try.else false)) cannot_find_unknown_key! (case (/.field unknown object) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} true)]] (in (and can_find_known_key! cannot_find_unknown_key!)))))) @@ -144,19 +144,19 @@ (try\each (\ <equivalence> = value)) (try.else false))))] - [/.Boolean /.boolean_field #/.Boolean random.bit bit.equivalence] - [/.Number /.number_field #/.Number random.safe_frac frac.equivalence] - [/.String /.string_field #/.String (random.ascii/alpha 1) text.equivalence] - [/.Array /.array_field #/.Array (random.row 3 ..random) (row.equivalence /.equivalence)] - [/.Object /.object_field #/.Object (random.dictionary text.hash 3 (random.ascii/alpha 1) ..random) (dictionary.equivalence /.equivalence)] + [/.Boolean /.boolean_field /.#Boolean random.bit bit.equivalence] + [/.Number /.number_field /.#Number random.safe_frac frac.equivalence] + [/.String /.string_field /.#String (random.ascii/alpha 1) text.equivalence] + [/.Array /.array_field /.#Array (random.row 3 ..random) (row.equivalence /.equivalence)] + [/.Object /.object_field /.#Object (random.dictionary text.hash 3 (random.ascii/alpha 1) ..random) (dictionary.equivalence /.equivalence)] )) (with_expansions [<boolean> (boolean) <number> (number) <string> (string) - <array_row> (row.row #/.Null - {#/.Boolean <boolean>} - {#/.Number <number>} - {#/.String <string>}) + <array_row> (row.row {/.#Null} + {/.#Boolean <boolean>} + {/.#Number <number>} + {/.#String <string>}) <key0> (string) <key1> (string) <key2> (string) @@ -165,20 +165,20 @@ <key5> (string) <key6> (string)] (_.cover [/.json] - (and (\= #/.Null (/.json #null)) + (and (\= {/.#Null} (/.json ())) (~~ (template [<tag> <value>] [(\= {<tag> <value>} (/.json <value>))] - [#/.Boolean <boolean>] - [#/.Number <number>] - [#/.String <string>] + [/.#Boolean <boolean>] + [/.#Number <number>] + [/.#String <string>] )) - (\= {#/.Array <array_row>} (/.json [#null <boolean> <number> <string>])) - (let [object (/.json {<key0> #null + (\= {/.#Array <array_row>} (/.json [() <boolean> <number> <string>])) + (let [object (/.json {<key0> () <key1> <boolean> <key2> <number> <key3> <string> - <key4> [#null <boolean> <number> <string>] + <key4> [() <boolean> <number> <string>] <key5> {<key6> <number>}})] (<| (try.else false) (do try.monad @@ -189,11 +189,11 @@ value4 (/.field <key4> object) value5 (/.field <key5> object) value6 (/.field <key6> value5)] - (in (and (\= #/.Null value0) - (\= {#/.Boolean <boolean>} value1) - (\= {#/.Number <number>} value2) - (\= {#/.String <string>} value3) - (\= {#/.Array <array_row>} value4) - (\= {#/.Number <number>} value6)))))) + (in (and (\= {/.#Null} value0) + (\= {/.#Boolean <boolean>} value1) + (\= {/.#Number <number>} value2) + (\= {/.#String <string>} value3) + (\= {/.#Array <array_row>} value4) + (\= {/.#Number <number>} value6)))))) ))) )))) diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index 835ce822e..1ed6821f6 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -47,27 +47,27 @@ (`` ($_ _.and (_.cover [/.path /.from_path] (case (/.path expected) - {#try.Success actual} + {try.#Success actual} (text\= expected (/.from_path actual)) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.no_path] (text\= "" (/.from_path /.no_path))) (_.cover [/.path_size /.path_is_too_long] (case (/.path invalid) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.path_is_too_long error))) (_.cover [/.not_ascii] (case (/.path not_ascii) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_ascii error))) ))))) @@ -82,25 +82,25 @@ (`` ($_ _.and (_.cover [/.name /.from_name] (case (/.name expected) - {#try.Success actual} + {try.#Success actual} (text\= expected (/.from_name actual)) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.name_size /.name_is_too_long] (case (/.name invalid) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.name_is_too_long error))) (_.cover [/.not_ascii] (case (/.name not_ascii) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_ascii error))) ))))) @@ -113,18 +113,18 @@ (`` ($_ _.and (_.cover [/.small /.from_small] (case (/.small expected) - {#try.Success actual} + {try.#Success actual} (n.= expected (/.from_small actual)) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.small_limit /.not_a_small_number] (case (/.small invalid) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_a_small_number error))) ))))) @@ -137,18 +137,18 @@ (`` ($_ _.and (_.cover [/.big /.from_big] (case (/.big expected) - {#try.Success actual} + {try.#Success actual} (n.= expected (/.from_big actual)) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.big_limit /.not_a_big_number] (case (/.big invalid) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_a_big_number error))) ))))) @@ -183,8 +183,8 @@ false))) (try.else false)))] - [/.Symbolic_Link #/.Symbolic_Link] - [/.Directory #/.Directory] + [/.Symbolic_Link /.#Symbolic_Link] + [/.Directory /.#Directory] )) (_.for [/.File /.Content /.content /.data] ($_ _.and @@ -196,10 +196,10 @@ tar (|> (row.row {<tag> [expected_path expected_moment /.none - [#/.user [#/.name /.anonymous - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name /.anonymous + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] expected_content]}) (format.result /.writer) (<b>.result /.parser))] @@ -218,8 +218,8 @@ false))) (try.else false)))] - [/.Normal #/.Normal] - [/.Contiguous #/.Contiguous] + [/.Normal /.#Normal] + [/.Contiguous /.#Contiguous] )))))))) (def: random_mode @@ -251,18 +251,18 @@ (|> (do try.monad [path (/.path path) content (/.content (binary.empty 0)) - tar (|> (row.row {#/.Normal [path + tar (|> (row.row {/.#Normal [path (instant.of_millis +0) expected_mode - [#/.user [#/.name /.anonymous - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name /.anonymous + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] content]}) (format.result /.writer) (<b>.result /.parser))] (in (case (row.list tar) - (^ (list {#/.Normal [_ _ actual_mode _ _]})) + (^ (list {/.#Normal [_ _ actual_mode _ _]})) (n.= (/.mode expected_mode) (/.mode actual_mode)) @@ -274,18 +274,18 @@ (|> (do try.monad [path (/.path path) content (/.content (binary.empty 0)) - tar (|> (row.row {#/.Normal [path + tar (|> (row.row {/.#Normal [path (instant.of_millis +0) <expected_mode> - [#/.user [#/.name /.anonymous - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name /.anonymous + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] content]}) (format.result /.writer) (<b>.result /.parser))] (in (case (row.list tar) - (^ (list {#/.Normal [_ _ actual_mode _ _]})) + (^ (list {/.#Normal [_ _ actual_mode _ _]})) (n.= (/.mode <expected_mode>) (/.mode actual_mode)) @@ -324,39 +324,39 @@ ($_ _.and (_.cover [/.name_size /.name_is_too_long] (case (/.name invalid) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.name_is_too_long error))) (_.cover [/.not_ascii] (case (/.name not_ascii) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_ascii error))) (_.cover [/.Name /.name /.from_name] (|> (do try.monad [path (/.path path) content (/.content (binary.empty 0)) expected (/.name expected) - tar (|> (row.row {#/.Normal [path + tar (|> (row.row {/.#Normal [path (instant.of_millis +0) /.none - [#/.user [#/.name expected - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name expected + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] content]}) (format.result /.writer) (<b>.result /.parser))] (in (case (row.list tar) - (^ (list {#/.Normal [_ _ _ actual_ownership _]})) + (^ (list {/.#Normal [_ _ _ actual_ownership _]})) (and (text\= (/.from_name expected) - (/.from_name (value@ [#/.user #/.name] actual_ownership))) + (/.from_name (value@ [/.#user /.#name] actual_ownership))) (text\= (/.from_name /.anonymous) - (/.from_name (value@ [#/.group #/.name] actual_ownership)))) + (/.from_name (value@ [/.#group /.#name] actual_ownership)))) _ false))) @@ -365,26 +365,26 @@ (|> (do try.monad [path (/.path path) content (/.content (binary.empty 0)) - tar (|> (row.row {#/.Normal [path + tar (|> (row.row {/.#Normal [path (instant.of_millis +0) /.none - [#/.user [#/.name /.anonymous - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name /.anonymous + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] content]}) (format.result /.writer) (<b>.result /.parser))] (in (case (row.list tar) - (^ (list {#/.Normal [_ _ _ actual_ownership _]})) + (^ (list {/.#Normal [_ _ _ actual_ownership _]})) (and (text\= (/.from_name /.anonymous) - (/.from_name (value@ [#/.user #/.name] actual_ownership))) + (/.from_name (value@ [/.#user /.#name] actual_ownership))) (n.= (/.from_small /.no_id) - (/.from_small (value@ [#/.user #/.id] actual_ownership))) + (/.from_small (value@ [/.#user /.#id] actual_ownership))) (text\= (/.from_name /.anonymous) - (/.from_name (value@ [#/.group #/.name] actual_ownership))) + (/.from_name (value@ [/.#group /.#name] actual_ownership))) (n.= (/.from_small /.no_id) - (/.from_small (value@ [#/.group #/.id] actual_ownership)))) + (/.from_small (value@ [/.#group /.#id] actual_ownership)))) _ false))) @@ -407,10 +407,10 @@ (_.cover [/.invalid_end_of_archive] (let [dump (format.result /.writer row.empty)] (case (<b>.result /.parser (binary\composite dump dump)) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_end_of_archive error)))) ..path diff --git a/stdlib/source/test/lux/data/name.lux b/stdlib/source/test/lux/data/name.lux index ca5201761..dd9171e99 100644 --- a/stdlib/source/test/lux/data/name.lux +++ b/stdlib/source/test/lux/data/name.lux @@ -65,10 +65,5 @@ (and (/\= [.prelude_module "yolo"] (.name_of .yolo)) (/\= ["test/lux/data/name" "yolo"] (.name_of ..yolo)) (/\= ["" "yolo"] (.name_of yolo)) - (/\= ["library/lux/test" "yolo"] (.name_of library/lux/test.yolo)))) - (_.test "Can obtain Name from tag." - (and (/\= [.prelude_module "yolo"] (.name_of #.yolo)) - (/\= ["test/lux/data/name" "yolo"] (.name_of #..yolo)) - (/\= ["" "yolo"] (.name_of #yolo)) - (/\= ["library/lux/test" "yolo"] (.name_of #library/lux/test.yolo))))))) + (/\= ["library/lux/test" "yolo"] (.name_of library/lux/test.yolo))))))) ))))) diff --git a/stdlib/source/test/lux/data/sum.lux b/stdlib/source/test/lux/data/sum.lux index bc1d9c70c..353c6f6c2 100644 --- a/stdlib/source/test/lux/data/sum.lux +++ b/stdlib/source/test/lux/data/sum.lux @@ -37,9 +37,9 @@ (_.cover [/.hash] (let [hash (/.hash i.hash n.hash)] (and (n.= (\ i.hash hash left) - (\ hash hash {#.Left left})) + (\ hash hash {.#Left left})) (n.= (\ n.hash hash right) - (\ hash hash {#.Right right})))))) + (\ hash hash {.#Right right})))))) (_.cover [/.left] (|> (/.left expected) diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index 305268a0b..b53d4b83b 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -152,15 +152,15 @@ expected (\ ! each (n.% size) random.nat)] (_.cover [/.char] (case (/.char expected sample) - {#.Some char} + {.#Some char} (case (/.index (/.of_char char) sample) - {#.Some actual} + {.#Some actual} (n.= expected actual) _ false) - #.None + {.#None} false))) (_.cover [/.space /.space?] (`` (and (~~ (template [<char>] @@ -210,11 +210,11 @@ (/.replaced/1 pre post (\ /.monoid composite pre static)))) (_.cover [/.split_by] (case (/.split_by static ($_ (\ /.monoid composite) pre static post)) - {#.Some [left right]} + {.#Some [left right]} (and (\ /.equivalence = pre left) (\ /.equivalence = post right)) - #.None + {.#None} false)) (_.cover [/.lower_cased] (let [effectiveness! @@ -290,7 +290,7 @@ ($_ _.and (_.cover [/.split_at] (|> (/.split_at sizeL sample) - (case> {#.Right [_l _r]} + (case> {.#Right [_l _r]} (and (/\= sampleL _l) (/\= sampleR _r) (/\= sample (/.together (list _l _r)))) @@ -302,7 +302,7 @@ (/.clip sizeL (n.- sizeL (/.size sample)) sample) (/.clip_since sizeL sample) (/.clip_since 0 sample)] - (case> [{#.Right _l} {#.Right _r} {#.Right _r'} {#.Right _f}] + (case> [{.#Right _l} {.#Right _r} {.#Right _r'} {.#Right _f}] (and (/\= sampleL _l) (/\= sampleR _r) (/\= _r _r') diff --git a/stdlib/source/test/lux/data/text/escape.lux b/stdlib/source/test/lux/data/text/escape.lux index 6a658d960..edce881aa 100644 --- a/stdlib/source/test/lux/data/text/escape.lux +++ b/stdlib/source/test/lux/data/text/escape.lux @@ -105,11 +105,11 @@ (/.escapable? right)) (let [escaped (/.escaped expected)] (case (/.un_escaped escaped) - {#try.Success un_escaped} + {try.#Success un_escaped} (and (not (text\= escaped expected)) (text\= un_escaped expected)) - {#try.Failure error} + {try.#Failure error} false)) (text\= expected (/.escaped expected)))))) (do [! random.monad] @@ -117,10 +117,10 @@ (\ ! each text.of_char))] (_.cover [/.dangling_escape] (case (/.un_escaped (format (/.escaped dummy) "\")) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.dangling_escape error)))) (do [! random.monad] [dummy (|> (random.char unicode.character) @@ -128,10 +128,10 @@ (\ ! each text.of_char))] (_.cover [/.invalid_escape] (case (/.un_escaped (format "\" dummy)) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_escape error)))) (do [! random.monad] [too_short (|> (random.char unicode.character) @@ -139,15 +139,15 @@ code (|> (random.unicode 4) (random.only (function (_ code) (case (\ n.hex decoded code) - {#try.Failure error} true - {#try.Success _} false))))] + {try.#Failure error} true + {try.#Success _} false))))] (_.cover [/.invalid_unicode_escape] (template.let [(!invalid <code>) [(case (/.un_escaped (format "\u" <code>)) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_unicode_escape error))]] (and (!invalid (\ n.hex encoded too_short)) (!invalid code))))) diff --git a/stdlib/source/test/lux/data/text/format.lux b/stdlib/source/test/lux/data/text/format.lux index ddd4d0afb..14883a7ff 100644 --- a/stdlib/source/test/lux/data/text/format.lux +++ b/stdlib/source/test/lux/data/text/format.lux @@ -167,10 +167,10 @@ [sample (random.maybe random.nat)] (_.cover [/.maybe] (case sample - #.None + {.#None} true - {#.Some value} + {.#Some value} (text.contains? (/.nat value) (/.maybe /.nat sample))))) (do [! random.monad] diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index 554a47eff..cb766f27b 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -26,7 +26,7 @@ (-> (Parser Text) Text Bit) (|> input (<text>.result regex) - (case> {#try.Success parsed} + (case> {try.#Success parsed} (text\= parsed input) _ @@ -36,7 +36,7 @@ (-> Text (Parser Text) Text Bit) (|> input (<text>.result regex) - (case> {#try.Success parsed} + (case> {try.#Success parsed} (text\= test parsed) _ @@ -46,7 +46,7 @@ (All (_ a) (-> (Parser a) Text Bit)) (|> input (<text>.result regex) - (case> {#try.Failure _} + (case> {try.#Failure _} true _ @@ -58,7 +58,7 @@ (macro.with_identifiers [g!message g!_] (in (list (` (|> (~ input) (<text>.result (~ regex)) - (case> (^ {#try.Success (~ pattern)}) + (case> (^ {try.#Success (~ pattern)}) true (~ g!_) @@ -274,11 +274,11 @@ (syntax: (expands? [form <code>.any]) (function (_ lux) - {#try.Success [lux (list (code.bit (case (macro.single_expansion form lux) - {#try.Success _} + {try.#Success [lux (list (code.bit (case (macro.single_expansion form lux) + {try.#Success _} true - {#try.Failure error} + {try.#Failure error} false)))]})) (def: .public test diff --git a/stdlib/source/test/lux/debug.lux b/stdlib/source/test/lux/debug.lux index 80f78b281..d912904ec 100644 --- a/stdlib/source/test/lux/debug.lux +++ b/stdlib/source/test/lux/debug.lux @@ -78,14 +78,14 @@ sample_frac random.frac] (in (`` (and (case (/.representation (type [Bit Int Frac]) [sample_bit sample_int sample_frac]) - {#try.Success actual} + {try.#Success actual} (text\= (format "[" (%.bit sample_bit) " " (%.int sample_int) " " (%.frac sample_frac) "]") actual) - {#try.Failure error} + {try.#Failure error} false) ... TODO: Uncomment after switching from the old (tag+last?) to the new (lefts+right?) representation for variants ... (~~ (template [<lefts> <right?> <value> <format>] @@ -179,16 +179,16 @@ (try\each (text\= (%.maybe %.nat <sample>))) (try.else false))] - [{#.Some sample_nat}] - [#.None] + [{.#Some sample_nat}] + [{.#None}] )) ))) (_.cover [/.cannot_represent_value] (case (/.representation (-> Nat Nat) (|>>)) - {#try.Success representation} + {try.#Success representation} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.cannot_represent_value error))) ))) @@ -219,11 +219,11 @@ (syntax: (macro_error [macro <code>.any]) (function (_ compiler) (case ((macro.expansion macro) compiler) - {#try.Failure error} - {#try.Success [compiler (list (code.text error))]} + {try.#Failure error} + {try.#Success [compiler (list (code.text error))]} - {#try.Success _} - {#try.Failure "OOPS!"}))) + {try.#Success _} + {try.#Failure "OOPS!"}))) (type: My_Text Text) diff --git a/stdlib/source/test/lux/documentation.lux b/stdlib/source/test/lux/documentation.lux index d4979d44e..2d651be8e 100644 --- a/stdlib/source/test/lux/documentation.lux +++ b/stdlib/source/test/lux/documentation.lux @@ -22,11 +22,11 @@ (syntax: (macro_error [macro <code>.any]) (function (_ compiler) - {#try.Success [compiler (list (code.bit (case ((macro.expansion macro) compiler) - {#try.Failure error} + {try.#Success [compiler (list (code.bit (case ((macro.expansion macro) compiler) + {try.#Failure error} true - {#try.Success _} + {try.#Success _} false)))]})) (syntax: (description []) @@ -55,10 +55,10 @@ (case (`` (/.default (~~ (template.identifier [.._] [g!default])))) (^ (list definition)) (and (|> definition - (value@ #/.definition) + (value@ /.#definition) (text\= (template.text [g!default]))) (|> definition - (value@ #/.documentation) + (value@ /.#documentation) md.markdown (text\= "") not)) @@ -69,10 +69,10 @@ (case ..documentation: (^ (list documentation:)) (and (|> documentation: - (value@ #/.definition) + (value@ /.#definition) (text\= (template.text [/.documentation:]))) (|> documentation: - (value@ #/.documentation) + (value@ /.#documentation) md.markdown (text.contains? 'definition_description'))) @@ -98,7 +98,7 @@ (/.documentation super)) (case ..documentation: (^ (list documentation:)) - (text.contains? (md.markdown (value@ #/.documentation documentation:)) + (text.contains? (md.markdown (value@ /.#documentation documentation:)) (/.documentation super)) _ diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux index 6076ca6ee..20b1a5357 100644 --- a/stdlib/source/test/lux/extension.lux +++ b/stdlib/source/test/lux/extension.lux @@ -64,7 +64,7 @@ (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) - (\ ! each (|>> {#analysis.Extension self}))))) + (\ ! each (|>> {analysis.#Extension self}))))) (synthesis: (..my_synthesis self phase archive [pass_through <analysis>.any]) (phase archive pass_through)) @@ -74,30 +74,30 @@ (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) - (\ ! each (|>> {#analysis.Extension self}))))) + (\ ! each (|>> {analysis.#Extension self}))))) (synthesis: (..my_generation self phase archive [parameters (<>.some <analysis>.any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) - (\ ! each (|>> {#synthesis.Extension self}))))) + (\ ! each (|>> {synthesis.#Extension self}))))) (generation: (..my_generation self phase archive [pass_through <synthesis>.any]) (for [@.jvm - (\ phase.monad each (|>> #jvm.Embedded row.row) + (\ phase.monad each (|>> {jvm.#Embedded} row.row) (phase archive pass_through))] (phase archive pass_through))) (analysis: (..dummy_generation self phase archive []) - (\ phase.monad in {#analysis.Extension self (list)})) + (\ phase.monad in {analysis.#Extension self (list)})) (synthesis: (..dummy_generation self phase archive []) - (\ phase.monad in {#synthesis.Extension self (list)})) + (\ phase.monad in {synthesis.#Extension self (list)})) (generation: (..dummy_generation self phase archive []) (\ phase.monad in (for [@.jvm - (row.row {#jvm.Constant {#jvm.LDC {#jvm.String self}}}) + (row.row {jvm.#Constant {jvm.#LDC {jvm.#String self}}}) @.js (js.string self) @.python (python.unicode self) diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 0e5933bbb..e94c61b39 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -62,11 +62,11 @@ (function (_ lux) (|> (macro.single_expansion expression) (meta.result lux) - (case> {#try.Success expansion} - {#try.Failure "OOPS!"} + (case> {try.#Success expansion} + {try.#Failure "OOPS!"} - {#try.Failure error} - {#try.Success [lux (list (code.text error))]})))) + {try.#Failure error} + {try.#Success [lux (list (code.text error))]})))) (def: for_conversions Test @@ -127,7 +127,7 @@ (|> array /.length ..macro_error - (text.contains? (value@ #exception.label /.cannot_convert_to_jvm_type)))))))) + (text.contains? (value@ exception.#label /.cannot_convert_to_jvm_type)))))))) (def: for_miscellaneous Test @@ -150,10 +150,10 @@ (random.ascii 1))] ($_ _.and (_.cover [/.check] - (and (case (/.check java/lang/String sample) {#.Some _} true #.None false) - (case (/.check java/lang/Long sample) {#.Some _} false #.None true) - (case (/.check java/lang/Object sample) {#.Some _} true #.None false) - (case (/.check java/lang/Object (/.null)) {#.Some _} false #.None true))) + (and (case (/.check java/lang/String sample) {.#Some _} true {.#None} false) + (case (/.check java/lang/Long sample) {.#Some _} false {.#None} true) + (case (/.check java/lang/Object sample) {.#Some _} true {.#None} false) + (case (/.check java/lang/Object (/.null)) {.#Some _} false {.#None} true))) (_.cover [/.synchronized] (/.synchronized sample #1)) (_.cover [/.class_for] @@ -164,12 +164,12 @@ (_.cover [/.???] (and (|> (/.??? (/.null)) (: (Maybe java/lang/Object)) - (case> #.None #1 - {#.Some _} #0)) + (case> {.#None} #1 + {.#Some _} #0)) (|> (/.??? sample) (: (Maybe java/lang/Object)) - (case> {#.Some _} #1 - #.None #0)))) + (case> {.#Some _} #1 + {.#None} #0)))) (_.cover [/.!!!] (and (|> (/.??? (/.null)) /.!!! @@ -198,7 +198,7 @@ [/.Character /.char character character\=] )) (_.cover [/.cannot_cast_to_non_object] - (text.contains? (value@ #exception.label /.cannot_cast_to_non_object) + (text.contains? (value@ exception.#label /.cannot_cast_to_non_object) (macro_error (/.:as boolean (: /.Boolean boolean))))) (_.cover [/.:as] (|> string @@ -287,17 +287,17 @@ expected)))) example/1! (and (case (test/TestInterface1::actual1 false object/1) - {#try.Success actual} + {try.#Success actual} (same? (: Any expected) (: Any actual)) - {#try.Failure error} + {try.#Failure error} false) (case (test/TestInterface1::actual1 true object/1) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} true)) object/2 (/.object [] [test/TestInterface2] @@ -508,17 +508,17 @@ object/1 (test/TestClass1::new (.int expected)) example/1! (and (case (test/TestInterface1::actual1 false object/1) - {#try.Success actual} + {try.#Success actual} (n.= expected (:as Nat actual)) - {#try.Failure error} + {try.#Failure error} false) (case (test/TestInterface1::actual1 true object/1) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} true)) object/2 (test/TestClass2::new) @@ -586,15 +586,15 @@ (function (_ lux) (|> (macro.single_expansion expression) (meta.result lux) - (case> {#try.Success expansion} + (case> {try.#Success expansion} true - {#try.Failure error} + {try.#Failure error} false) code.bit list [lux] - #try.Success))) + {try.#Success}))) (def: for_exception Test diff --git a/stdlib/source/test/lux/ffi.lua.lux b/stdlib/source/test/lux/ffi.lua.lux index 1e20f80ca..4b4bfcf1e 100644 --- a/stdlib/source/test/lux/ffi.lua.lux +++ b/stdlib/source/test/lux/ffi.lua.lux @@ -54,6 +54,6 @@ true)) (_.cover [/.import:] (case (io.run! (..os/getenv string)) - {#.Some _} true - #.None true)) + {.#Some _} true + {.#None} true)) ))))) diff --git a/stdlib/source/test/lux/ffi.old.lux b/stdlib/source/test/lux/ffi.old.lux index 7f53f7da4..9a1e0de54 100644 --- a/stdlib/source/test/lux/ffi.old.lux +++ b/stdlib/source/test/lux/ffi.old.lux @@ -179,10 +179,10 @@ (not (/.null? sample)))) (_.cover [/.???] (and (|> (: (Maybe java/lang/Object) (/.??? (/.null))) - (case> #.None #1 + (case> {.#None} #1 _ #0)) (|> (: (Maybe java/lang/Object) (/.??? sample)) - (case> {#.Some _} #1 + (case> {.#Some _} #1 _ #0)))) (_.cover [/.!!!] (and (/.null? (/.!!! (/.??? (/.null)))) @@ -197,10 +197,10 @@ increase random.int] ($_ _.and (_.cover [/.check] - (and (case (/.check java/lang/String sample) {#.Some _} true #.None false) - (case (/.check java/lang/Long sample) {#.Some _} false #.None true) - (case (/.check java/lang/Object sample) {#.Some _} true #.None false) - (case (/.check java/lang/Object (/.null)) {#.Some _} false #.None true))) + (and (case (/.check java/lang/String sample) {.#Some _} true {.#None} false) + (case (/.check java/lang/Long sample) {.#Some _} false {.#None} true) + (case (/.check java/lang/Object sample) {.#Some _} true {.#None} false) + (case (/.check java/lang/Object (/.null)) {.#Some _} false {.#None} true))) (_.cover [/.synchronized] (/.synchronized sample #1)) (_.cover [/.class_for /.import:] diff --git a/stdlib/source/test/lux/locale.lux b/stdlib/source/test/lux/locale.lux index f8856abca..e2214512c 100644 --- a/stdlib/source/test/lux/locale.lux +++ b/stdlib/source/test/lux/locale.lux @@ -43,7 +43,7 @@ [language ..random_language territory ..random_territory encoding ..random_encoding] - (in (/.locale language {#.Some territory} {#.Some encoding})))) + (in (/.locale language {.#Some territory} {.#Some encoding})))) (def: .public test Test @@ -60,15 +60,15 @@ ($_ _.and (|> ..random_language (\ ! each (function (_ language) - (/.locale language {#.Some fixed_territory} {#.Some fixed_encoding}))) + (/.locale language {.#Some fixed_territory} {.#Some fixed_encoding}))) ($hash.spec /.hash)) (|> ..random_territory (\ ! each (function (_ territory) - (/.locale fixed_language {#.Some territory} {#.Some fixed_encoding}))) + (/.locale fixed_language {.#Some territory} {.#Some fixed_encoding}))) ($hash.spec /.hash)) (|> ..random_encoding (\ ! each (function (_ encoding) - (/.locale fixed_language {#.Some fixed_territory} {#.Some encoding}))) + (/.locale fixed_language {.#Some fixed_territory} {.#Some encoding}))) ($hash.spec /.hash)) ))) @@ -76,10 +76,10 @@ [language ..random_language territory ..random_territory encoding ..random_encoding - .let [l_locale (/.locale language #.None #.None) - lt_locale (/.locale language {#.Some territory} #.None) - le_locale (/.locale language #.None {#.Some encoding}) - lte_locale (/.locale language {#.Some territory} {#.Some encoding})] + .let [l_locale (/.locale language {.#None} {.#None}) + lt_locale (/.locale language {.#Some territory} {.#None}) + le_locale (/.locale language {.#None} {.#Some encoding}) + lte_locale (/.locale language {.#Some territory} {.#Some encoding})] .let [language_check (and (text\= (language.code language) (/.code l_locale)) (list.every? (|>> /.code (text.starts_with? (language.code language))) diff --git a/stdlib/source/test/lux/macro.lux b/stdlib/source/test/lux/macro.lux index 2266d973a..db57938a1 100644 --- a/stdlib/source/test/lux/macro.lux +++ b/stdlib/source/test/lux/macro.lux @@ -39,7 +39,7 @@ (template: (!global <definition>) [(: [Text .Global] - [(template.text [<definition>]) {#.Definition [true .Macro <definition>]}])]) + [(template.text [<definition>]) {.#Definition [true .Macro <definition>]}])]) (syntax: (pow/2 [number <code>.any]) (in (list (` (nat.* (~ number) (~ number)))))) @@ -65,40 +65,40 @@ current_module (name.module (name_of .._))]] (in [seed identifier_prefix - [#.info [#.target "" - #.version "" - #.mode #.Build] - #.source [location.dummy 0 ""] - #.location location.dummy - #.current_module {#.Some current_module} - #.modules (list [macro_module - [#.module_hash 0 - #.module_aliases (list) - #.definitions (: (List [Text .Global]) + [.#info [.#target "" + .#version "" + .#mode {.#Build}] + .#source [location.dummy 0 ""] + .#location location.dummy + .#current_module {.#Some current_module} + .#modules (list [macro_module + [.#module_hash 0 + .#module_aliases (list) + .#definitions (: (List [Text .Global]) (list (!global /.log_single_expansion!) (!global /.log_expansion!) (!global /.log_full_expansion!))) - #.imports (list) - #.module_state #.Active]] + .#imports (list) + .#module_state {.#Active}]] [current_module - [#.module_hash 0 - #.module_aliases (list) - #.definitions (: (List [Text .Global]) + [.#module_hash 0 + .#module_aliases (list) + .#definitions (: (List [Text .Global]) (list (!global ..pow/2) (!global ..pow/4) (!global ..repeated))) - #.imports (list) - #.module_state #.Active]]) - #.scopes (list) - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected #.None - #.seed seed - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []]]))) + .#imports (list) + .#module_state {.#Active}]]) + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#None} + .#seed seed + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []]]))) (def: expander Test @@ -140,7 +140,7 @@ (bit\= (not (nat.= 1 repetitions)) (|> (/.one_expansion (` (..repeated (~ (code.nat repetitions)) (~ pow/1)))) (meta.result lux) - (!expect {#try.Failure _})))) + (!expect {try.#Failure _})))) )))) (def: .public test @@ -154,13 +154,13 @@ (|> (/.identifier identifier_prefix) (\ meta.monad each %.code) (meta.result lux) - (!expect (^multi {#try.Success actual_identifier} + (!expect (^multi {try.#Success actual_identifier} (and (text.contains? identifier_prefix actual_identifier) (text.contains? (%.nat seed) actual_identifier)))))) (_.cover [/.wrong_syntax_error] (|> (/.single_expansion (` (/.log_single_expansion!))) (meta.result lux) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (text.contains? (/.wrong_syntax_error (name_of /.log_single_expansion!)) error))))) (_.cover [/.with_identifiers] @@ -168,7 +168,7 @@ (|> (/.with_identifiers [<expected>] (\ meta.monad in <expected>)) (meta.result lux) - (!expect (^multi {#try.Success [_ {#.Identifier ["" actual]}]} + (!expect (^multi {try.#Success [_ {.#Identifier ["" actual]}]} (text.contains? (template.text [<expected>]) actual)))))) )) diff --git a/stdlib/source/test/lux/macro/code.lux b/stdlib/source/test/lux/macro/code.lux index f14970009..96657f706 100644 --- a/stdlib/source/test/lux/macro/code.lux +++ b/stdlib/source/test/lux/macro/code.lux @@ -53,7 +53,6 @@ (random\each /.frac random.safe_frac) (random\each /.text ..random_text) (random\each /.identifier ..random_name) - (random\each /.tag ..random_name) (random\each /.form (..random_sequence random)) (random\each /.variant (..random_sequence random)) (random\each /.tuple (..random_sequence random)) @@ -67,11 +66,11 @@ start (: Source [location.dummy 0 source_code])] (case (parse start) - {#.Left [end error]} - {#try.Failure error} + {.#Left [end error]} + {try.#Failure error} - {#.Right [end lux_code]} - {#try.Success lux_code}))) + {.#Right [end lux_code]} + {try.#Success lux_code}))) (def: (replacement_simulation [original substitute]) (-> [Code Code] (Random [Code Code])) @@ -94,8 +93,7 @@ (random\each /.rev random.rev) (random\each /.frac random.safe_frac) (random\each /.text ..random_text) - (random\each /.identifier ..random_name) - (random\each /.tag ..random_name)))] + (random\each /.identifier ..random_name)))] (in [sample sample])) (for_sequence /.form) (for_sequence /.variant) @@ -110,47 +108,45 @@ [expected <random>] (_.cover [<coverage>] (and (case (..read (/.format (<coverage> expected))) - {#try.Success actual} + {try.#Success actual} (\ /.equivalence = actual (<coverage> expected)) - {#try.Failure error} + {try.#Failure error} false) (\ /.equivalence = [location.dummy {<tag> expected}] (<coverage> expected)))))] - [/.bit random.bit #.Bit] - [/.nat random.nat #.Nat] - [/.int random.int #.Int] - [/.rev random.rev #.Rev] - [/.frac random.safe_frac #.Frac] - [/.text ..random_text #.Text] - [/.tag ..random_name #.Tag] - [/.identifier ..random_name #.Identifier] - [/.form (..random_sequence ..random) #.Form] - [/.variant (..random_sequence ..random) #.Variant] - [/.tuple (..random_sequence ..random) #.Tuple])) + [/.bit random.bit .#Bit] + [/.nat random.nat .#Nat] + [/.int random.int .#Int] + [/.rev random.rev .#Rev] + [/.frac random.safe_frac .#Frac] + [/.text ..random_text .#Text] + [/.identifier ..random_name .#Identifier] + [/.form (..random_sequence ..random) .#Form] + [/.variant (..random_sequence ..random) .#Variant] + [/.tuple (..random_sequence ..random) .#Tuple])) (~~ (template [<coverage> <random> <tag>] [(do [! random.monad] [expected <random>] (_.cover [<coverage>] (and (case (..read (/.format (<coverage> expected))) - {#try.Success actual} + {try.#Success actual} (\ /.equivalence = actual (<coverage> expected)) - {#try.Failure error} + {try.#Failure error} false) (\ /.equivalence = [location.dummy {<tag> ["" expected]}] (<coverage> expected))) ))] - [/.local_tag ..random_text #.Tag] - [/.local_identifier ..random_text #.Identifier] + [/.local_identifier ..random_text .#Identifier] ))))) (def: .public test diff --git a/stdlib/source/test/lux/macro/local.lux b/stdlib/source/test/lux/macro/local.lux index b36094399..26e003577 100644 --- a/stdlib/source/test/lux/macro/local.lux +++ b/stdlib/source/test/lux/macro/local.lux @@ -30,17 +30,17 @@ (syntax: (macro_error [macro <code>.any]) (function (_ compiler) (case ((macro.expansion macro) compiler) - {#try.Failure error} - {#try.Success [compiler (list (code.text error))]} + {try.#Failure error} + {try.#Success [compiler (list (code.text error))]} - {#try.Success _} - {#try.Failure "OOPS!"}))) + {try.#Success _} + {try.#Failure "OOPS!"}))) (def: (constant output) (-> Code Macro) ("lux macro" (function (_ inputs lux) - {#try.Success [lux (list output)]}))) + {try.#Success [lux (list output)]}))) (syntax: (with [name (<code>.tuple (<>.and <code>.text <code>.text)) constant <code>.any @@ -52,9 +52,9 @@ [module short] (meta.normal name) _ (if pre_remove (let [remove_macro! (: (-> .Module .Module) - (revised@ #.definitions (plist.lacks short)))] + (revised@ .#definitions (plist.lacks short)))] (function (_ lux) - {#try.Success [(revised@ #.modules (plist.revised module remove_macro!) lux) + {try.#Success [(revised@ .#modules (plist.revised module remove_macro!) lux) []]})) (in []))] (let [pre_expansion (` (let [(~ g!output) (~ body)] diff --git a/stdlib/source/test/lux/macro/syntax/check.lux b/stdlib/source/test/lux/macro/syntax/check.lux index de1e3fe56..0b315092e 100644 --- a/stdlib/source/test/lux/macro/syntax/check.lux +++ b/stdlib/source/test/lux/macro/syntax/check.lux @@ -38,11 +38,11 @@ [[type value] ..random] (_.cover [/.format /.parser] (case (<code>.result /.parser - (list (/.format [#/.type type - #/.value value]))) - {#try.Failure _} + (list (/.format [/.#type type + /.#value value]))) + {try.#Failure _} false - {#try.Success check} - (and (code\= type (value@ #/.type check)) - (code\= value (value@ #/.value check))))))))) + {try.#Success check} + (and (code\= type (value@ /.#type check)) + (code\= value (value@ /.#value check))))))))) diff --git a/stdlib/source/test/lux/macro/syntax/declaration.lux b/stdlib/source/test/lux/macro/syntax/declaration.lux index f14762ad6..f4dbee84b 100644 --- a/stdlib/source/test/lux/macro/syntax/declaration.lux +++ b/stdlib/source/test/lux/macro/syntax/declaration.lux @@ -40,8 +40,8 @@ (_.cover [/.format /.parser] (case (<code>.result /.parser (list (/.format expected))) - {#try.Failure _} + {try.#Failure _} false - {#try.Success actual} + {try.#Success actual} (\ /.equivalence = expected actual))))))) diff --git a/stdlib/source/test/lux/macro/syntax/definition.lux b/stdlib/source/test/lux/macro/syntax/definition.lux index b76f75cdb..d6881c287 100644 --- a/stdlib/source/test/lux/macro/syntax/definition.lux +++ b/stdlib/source/test/lux/macro/syntax/definition.lux @@ -34,23 +34,23 @@ )) (def: compiler - [#.info [#.target "FAKE" - #.version "0.0.0" - #.mode #.Build] - #.source [location.dummy 0 ""] - #.location location.dummy - #.current_module #.None - #.modules (list) - #.scopes (list) - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected #.None - #.seed 0 - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []]) + [.#info [.#target "FAKE" + .#version "0.0.0" + .#mode {.#Build}] + .#source [location.dummy 0 ""] + .#location location.dummy + .#current_module {.#None} + .#modules (list) + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#None} + .#seed 0 + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []]) (def: .public test Test @@ -69,28 +69,28 @@ (_.cover [/.format /.parser] (case (<code>.result (/.parser compiler) (list (/.format expected))) - {#try.Failure error} + {try.#Failure error} false - {#try.Success actual} + {try.#Success actual} (\ /.equivalence = expected actual))) (_.cover [/.typed] - (let [expected (with@ #/.value {#.Left [type untyped_value]} expected)] + (let [expected (with@ /.#value {.#Left [type untyped_value]} expected)] (case (<code>.result (/.typed compiler) (list (/.format expected))) - {#try.Failure error} + {try.#Failure error} false - {#try.Success actual} + {try.#Success actual} (\ /.equivalence = expected actual)))) (_.cover [/.lacks_type] - (let [expected (with@ #/.value {#.Right untyped_value} expected)] + (let [expected (with@ /.#value {.#Right untyped_value} expected)] (case (<code>.result (/.typed compiler) (list (/.format expected))) - {#try.Failure error} + {try.#Failure error} (exception.match? /.lacks_type error) - {#try.Success actual} + {try.#Success actual} false))) ))) )) diff --git a/stdlib/source/test/lux/macro/syntax/export.lux b/stdlib/source/test/lux/macro/syntax/export.lux index ac95210a2..0dcc94f69 100644 --- a/stdlib/source/test/lux/macro/syntax/export.lux +++ b/stdlib/source/test/lux/macro/syntax/export.lux @@ -33,10 +33,10 @@ [[expected_export_policy expected_un_exported] ..export] (_.cover [/.parser /.default_policy] (|> (case expected_export_policy - {#.Some expected_export_policy} + {.#Some expected_export_policy} (list expected_export_policy (code.nat expected_un_exported)) - #.None + {.#None} (list (code.nat expected_un_exported))) (<code>.result (/.parser <code>.nat)) (try\each (function (_ [actual_export_policy actual_un_exported]) diff --git a/stdlib/source/test/lux/macro/syntax/input.lux b/stdlib/source/test/lux/macro/syntax/input.lux index b822f1b94..9ac7d311b 100644 --- a/stdlib/source/test/lux/macro/syntax/input.lux +++ b/stdlib/source/test/lux/macro/syntax/input.lux @@ -41,8 +41,8 @@ [expected ..random] (_.cover [/.format /.parser] (case (<code>.result /.parser (list (/.format (list expected)))) - {#try.Failure _} + {try.#Failure _} false - {#try.Success actual} + {try.#Success actual} (\ (list.equivalence /.equivalence) = (list expected) actual))))))) diff --git a/stdlib/source/test/lux/macro/template.lux b/stdlib/source/test/lux/macro/template.lux index 74263e302..dd0a8ef06 100644 --- a/stdlib/source/test/lux/macro/template.lux +++ b/stdlib/source/test/lux/macro/template.lux @@ -31,11 +31,11 @@ (syntax: (macro_error [macro <code>.any]) (function (_ compiler) (case ((macro.expansion macro) compiler) - {#try.Failure error} - {#try.Success [compiler (list (code.text error))]} + {try.#Failure error} + {try.#Success [compiler (list (code.text error))]} - {#try.Success _} - {#try.Failure "OOPS!"}))) + {try.#Success _} + {try.#Failure "OOPS!"}))) (def: .public test Test @@ -44,9 +44,9 @@ [left random.nat mid random.nat right random.nat] - (with_expansions [<module> (as_is [.5 -4 +3 2 #1 #0 #c b "a"]) + (with_expansions [<module> (as_is [.5 -4 +3 2 #1 #0 c b "a"]) <module>' ".5-4+32#1#0cba" - <short> (as_is ["a" b #c #0 #1 2 +3 -4 .5]) + <short> (as_is ["a" b c #0 #1 2 +3 -4 .5]) <short>' "abc#0#12+3-4.5"] ($_ _.and (_.cover [/.spliced] @@ -69,14 +69,6 @@ [<module>' <short>'] true _ false) )) - (_.cover [/.tag] - (and (case (`` (name_of (~~ (/.tag <short>)))) - ["" <short>'] true - _ false) - (case (`` (name_of (~~ (/.tag <module> <short>)))) - [<module>' <short>'] true - _ false) - )) (_.cover [/.with_locals] (/.with_locals [var0 var1] (let [var0 left diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux index d4887967e..65474ff58 100644 --- a/stdlib/source/test/lux/math/logic/fuzzy.lux +++ b/stdlib/source/test/lux/math/logic/fuzzy.lux @@ -93,10 +93,10 @@ (random.one (function (_ thresholds) (case thresholds (^ (list threshold_0 threshold_1 threshold_2 threshold_3)) - {#.Some [threshold_0 threshold_1 threshold_2 threshold_3]} + {.#Some [threshold_0 threshold_1 threshold_2 threshold_3]} _ - #.None)))) + {.#None})))) .let [bottom_set (/.gradient bottom middle_bottom) top_set (/.gradient middle_top top)]] @@ -177,10 +177,10 @@ (random.one (function (_ thresholds) (case thresholds (^ (list threshold_0 threshold_1 threshold_2 threshold_3)) - {#.Some [threshold_0 threshold_1 threshold_2 threshold_3]} + {.#Some [threshold_0 threshold_1 threshold_2 threshold_3]} _ - #.None))))] + {.#None}))))] ($_ _.and (_.cover [/.triangle] (let [reference (/.triangle bottom middle_bottom top) diff --git a/stdlib/source/test/lux/math/modular.lux b/stdlib/source/test/lux/math/modular.lux index bee6e09a5..f9d17a318 100644 --- a/stdlib/source/test/lux/math/modular.lux +++ b/stdlib/source/test/lux/math/modular.lux @@ -66,10 +66,10 @@ (case (|> param (\ (/.codec param\\%) encoded) (\ (/.codec subject\\%) decoded)) - {#try.Failure error} + {try.#Failure error} (exception.match? /.incorrect_modulus error) - {#try.Success _} + {try.#Success _} false)) (_.cover [/.modulus] (and (type\= (:of (/.modulus subject)) @@ -96,13 +96,13 @@ co_prime? (i.co_prime? (//.divisor (/.modulus subject)) (/.value subject))] (case (/.inverse subject) - {#.Some subject^-1} + {.#Some subject^-1} (and co_prime? (|> subject (/.* subject^-1) (/.= one))) - #.None + {.#None} (not co_prime?)))) (_.cover [/.adapter] (<| (try.else false) @@ -116,9 +116,9 @@ (/.= subject)))))) (_.cover [/.moduli_are_not_equal] (case (/.adapter subject\\% param\\%) - {#try.Failure error} + {try.#Failure error} (exception.match? /.moduli_are_not_equal error) - {#try.Success _} + {try.#Success _} false)) ))))) diff --git a/stdlib/source/test/lux/math/modulus.lux b/stdlib/source/test/lux/math/modulus.lux index d13cb6817..8d79b95b1 100644 --- a/stdlib/source/test/lux/math/modulus.lux +++ b/stdlib/source/test/lux/math/modulus.lux @@ -42,17 +42,17 @@ ($_ _.and (_.cover [/.modulus /.divisor] (case (/.modulus divisor) - {#try.Success modulus} + {try.#Success modulus} (i.= divisor (/.divisor modulus)) - {#try.Failure error} + {try.#Failure error} (i.= +0 divisor))) (_.cover [/.zero_cannot_be_a_modulus] (case (/.modulus +0) - {#try.Failure error} + {try.#Failure error} (exception.match? /.zero_cannot_be_a_modulus error) - {#try.Success modulus} + {try.#Success modulus} false)) (_.cover [/.literal] (with_expansions [<divisor> (|divisor|)] diff --git a/stdlib/source/test/lux/math/number.lux b/stdlib/source/test/lux/math/number.lux index 6614235b4..be315bbcc 100644 --- a/stdlib/source/test/lux/math/number.lux +++ b/stdlib/source/test/lux/math/number.lux @@ -35,10 +35,10 @@ (_.cover [/.bin] (`` (and (~~ (template [<=> <codec> <number>] [(case (\ <codec> decoded (..clean_commas <number>)) - {#try.Success actual} + {try.#Success actual} (<=> (/.bin <number>) actual) - {#try.Failure error} + {try.#Failure error} false)] [n.= n.binary "11001001"] @@ -56,10 +56,10 @@ (_.cover [/.oct] (`` (and (~~ (template [<=> <codec> <number>] [(case (\ <codec> decoded (..clean_commas <number>)) - {#try.Success actual} + {try.#Success actual} (<=> (/.oct <number>) actual) - {#try.Failure error} + {try.#Failure error} false)] [n.= n.octal "615243"] @@ -77,10 +77,10 @@ (_.cover [/.hex] (`` (and (~~ (template [<=> <codec> <number>] [(case (\ <codec> decoded (..clean_commas <number>)) - {#try.Success actual} + {try.#Success actual} (<=> (/.hex <number>) actual) - {#try.Failure error} + {try.#Failure error} false)] [n.= n.hex "deadBEEF"] diff --git a/stdlib/source/test/lux/math/number/complex.lux b/stdlib/source/test/lux/math/number/complex.lux index 9e002f43a..d8097380a 100644 --- a/stdlib/source/test/lux/math/number/complex.lux +++ b/stdlib/source/test/lux/math/number/complex.lux @@ -43,8 +43,8 @@ (def: angle (Random /.Complex) (\ random.monad each - (|>> (revised@ #/.real (f.% +1.0)) - (revised@ #/.imaginary (f.% +1.0))) + (|>> (revised@ /.#real (f.% +1.0)) + (revised@ /.#imaginary (f.% +1.0))) ..random)) (def: construction @@ -55,11 +55,11 @@ ($_ _.and (_.cover [/.complex] (and (let [r+i (/.complex real imaginary)] - (and (f.= real (value@ #/.real r+i)) - (f.= imaginary (value@ #/.imaginary r+i)))) + (and (f.= real (value@ /.#real r+i)) + (f.= imaginary (value@ /.#imaginary r+i)))) (let [r+i (/.complex real)] - (and (f.= real (value@ #/.real r+i)) - (f.= +0.0 (value@ #/.imaginary r+i)))))) + (and (f.= real (value@ /.#real r+i)) + (f.= +0.0 (value@ /.#imaginary r+i)))))) (_.cover [/.approximately?] (/.approximately? ..margin_of_error (/.complex real imaginary) @@ -135,18 +135,18 @@ (_.cover [/.+] (let [z (/.+ y x)] (and (/.= z - (/.complex (f.+ (value@ #/.real y) - (value@ #/.real x)) - (f.+ (value@ #/.imaginary y) - (value@ #/.imaginary x))))))) + (/.complex (f.+ (value@ /.#real y) + (value@ /.#real x)) + (f.+ (value@ /.#imaginary y) + (value@ /.#imaginary x))))))) (_.cover [/.-] (let [normal! (let [z (/.- y x)] (and (/.= z - (/.complex (f.- (value@ #/.real y) - (value@ #/.real x)) - (f.- (value@ #/.imaginary y) - (value@ #/.imaginary x)))))) + (/.complex (f.- (value@ /.#real y) + (value@ /.#real x)) + (f.- (value@ /.#imaginary y) + (value@ /.#imaginary x)))))) inverse! (and (|> x (/.+ y) (/.- y) (/.approximately? ..margin_of_error x)) @@ -161,8 +161,8 @@ (let [rem (/.% y x) quotient (|> x (/.- rem) (/./ y)) floored (|> quotient - (revised@ #/.real math.floor) - (revised@ #/.imaginary math.floor))] + (revised@ /.#real math.floor) + (revised@ /.#imaginary math.floor))] (/.approximately? +0.000000000001 x (|> quotient (/.* y) (/.+ rem))))) @@ -175,10 +175,10 @@ ($_ _.and (_.cover [/.conjugate] (let [cx (/.conjugate x)] - (and (f.= (value@ #/.real x) - (value@ #/.real cx)) - (f.= (f.opposite (value@ #/.imaginary x)) - (value@ #/.imaginary cx))))) + (and (f.= (value@ /.#real x) + (value@ /.#real cx)) + (f.= (f.opposite (value@ /.#imaginary x)) + (value@ /.#imaginary cx))))) (_.cover [/.reciprocal] (let [reciprocal! (|> x (/.* (/.reciprocal x)) (/.approximately? ..margin_of_error /.+one)) diff --git a/stdlib/source/test/lux/math/number/i64.lux b/stdlib/source/test/lux/math/number/i64.lux index a9bde8474..d935d0d9e 100644 --- a/stdlib/source/test/lux/math/number/i64.lux +++ b/stdlib/source/test/lux/math/number/i64.lux @@ -124,13 +124,13 @@ (do [! random.monad] [size (\ ! each (n.% /.width) random.nat)] (case (/.sub size) - #.None + {.#None} (_.cover [/.sub] (n.= 0 size)) - {#.Some sub} + {.#Some sub} (do [! random.monad] - [.let [limit (|> (-- (\ sub width)) + [.let [limit (|> (-- (\ sub bits)) /.mask .int ++)] diff --git a/stdlib/source/test/lux/math/number/ratio.lux b/stdlib/source/test/lux/math/number/ratio.lux index 2bced4d50..a9b18cdf8 100644 --- a/stdlib/source/test/lux/math/number/ratio.lux +++ b/stdlib/source/test/lux/math/number/ratio.lux @@ -79,11 +79,11 @@ with_denominator! (case (/.nat (/.ratio numerator denominator)) - {#.Some factor} + {.#Some factor} (and (n.= 0 (n.% denominator numerator)) (n.= numerator (n.* factor denominator))) - #.None + {.#None} (not (n.= 0 (n.% denominator numerator))))] (and only_numerator! denominator_1! @@ -111,8 +111,8 @@ (and (/.= right (|> div (/.* left) (/.+ rem))) (case (/.nat div) - {#.Some _} true - #.None false))))) + {.#Some _} true + {.#None} false))))) (do random.monad [left ..random right ..random] diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index 86af8bc90..d20c3d22c 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -49,39 +49,39 @@ expected_seed random.nat expected random.nat dummy (random.only (|>> (n.= expected) not) random.nat) - .let [expected_lux [#.info [#.target target - #.version version - #.mode #.Build] - #.source [location.dummy 0 source_code] - #.location location.dummy - #.current_module {#.Some expected_current_module} - #.modules (list) - #.scopes (list) - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected {#.Some {#.Primitive primitive_type (list)}} - #.seed expected_seed - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []]]] + .let [expected_lux [.#info [.#target target + .#version version + .#mode {.#Build}] + .#source [location.dummy 0 source_code] + .#location location.dummy + .#current_module {.#Some expected_current_module} + .#modules (list) + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#Some {.#Primitive primitive_type (list)}} + .#seed expected_seed + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []]]] ($_ _.and (_.cover [/.result] (|> (\ /.monad in expected) (/.result expected_lux) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= expected actual))))) (_.cover [/.result'] (|> (\ /.monad in expected) (/.result' expected_lux) - (!expect (^multi {#try.Success [actual_lux actual]} + (!expect (^multi {try.#Success [actual_lux actual]} (and (same? expected_lux actual_lux) (n.= expected actual)))))) (_.cover [/.compiler_state] (|> /.compiler_state (/.result expected_lux) - (!expect (^multi {#try.Success actual_lux} + (!expect (^multi {try.#Success actual_lux} (same? expected_lux actual_lux))))) ))) @@ -97,65 +97,65 @@ expected random.nat dummy (random.only (|>> (n.= expected) not) random.nat) expected_error (random.ascii/upper 1) - .let [expected_lux [#.info [#.target target - #.version version - #.mode #.Build] - #.source [location.dummy 0 source_code] - #.location location.dummy - #.current_module {#.Some expected_current_module} - #.modules (list) - #.scopes (list) - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected {#.Some {#.Primitive primitive_type (list)}} - #.seed expected_seed - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []]]] + .let [expected_lux [.#info [.#target target + .#version version + .#mode {.#Build}] + .#source [location.dummy 0 source_code] + .#location location.dummy + .#current_module {.#Some expected_current_module} + .#modules (list) + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#Some {.#Primitive primitive_type (list)}} + .#seed expected_seed + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []]]] ($_ _.and (_.cover [/.failure] (|> (/.failure expected_error) (: (Meta Any)) (/.result expected_lux) - (!expect (^multi {#try.Failure actual_error} + (!expect (^multi {try.#Failure actual_error} (text\= (location.with location.dummy expected_error) actual_error))))) (_.cover [/.assertion] (and (|> (/.assertion expected_error true) (: (Meta Any)) (/.result expected_lux) - (!expect {#try.Success []})) + (!expect {try.#Success []})) (|> (/.assertion expected_error false) (/.result expected_lux) - (!expect (^multi {#try.Failure actual_error} + (!expect (^multi {try.#Failure actual_error} (text\= expected_error actual_error)))))) (_.cover [/.either] (and (|> (/.either (\ /.monad in expected) (: (Meta Nat) (/.failure expected_error))) (/.result expected_lux) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= expected actual)))) (|> (/.either (: (Meta Nat) (/.failure expected_error)) (\ /.monad in expected)) (/.result expected_lux) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= expected actual)))) (|> (/.either (: (Meta Nat) (/.failure expected_error)) (: (Meta Nat) (/.failure expected_error))) (/.result expected_lux) - (!expect (^multi {#try.Failure actual_error} + (!expect (^multi {try.#Failure actual_error} (text\= (location.with location.dummy expected_error) actual_error)))) (|> (/.either (\ /.monad in expected) (\ /.monad in dummy)) (/.result expected_lux) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= expected actual)))) )) ))) @@ -178,65 +178,65 @@ (not (or (text\= expected_current_module module) (text\= imported_module_name module)))) (random.ascii/upper 1)) - .let [imported_module [#.module_hash 0 - #.module_aliases (list) - #.definitions (list) - #.imports (list) - #.module_state #.Active] - expected_module [#.module_hash 0 - #.module_aliases (list) - #.definitions (list) - #.imports (list imported_module_name) - #.module_state #.Active] + .let [imported_module [.#module_hash 0 + .#module_aliases (list) + .#definitions (list) + .#imports (list) + .#module_state {.#Active}] + expected_module [.#module_hash 0 + .#module_aliases (list) + .#definitions (list) + .#imports (list imported_module_name) + .#module_state {.#Active}] expected_modules (list [expected_current_module expected_module] [imported_module_name imported_module]) - expected_lux [#.info [#.target target - #.version version - #.mode #.Build] - #.source [location.dummy 0 source_code] - #.location location.dummy - #.current_module {#.Some expected_current_module} - #.modules expected_modules - #.scopes (list) - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected {#.Some {#.Primitive primitive_type (list)}} - #.seed expected_seed - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []]]] + expected_lux [.#info [.#target target + .#version version + .#mode {.#Build}] + .#source [location.dummy 0 source_code] + .#location location.dummy + .#current_module {.#Some expected_current_module} + .#modules expected_modules + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#Some {.#Primitive primitive_type (list)}} + .#seed expected_seed + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []]]] (<| (_.for [.Module]) ($_ _.and (_.cover [/.current_module_name] (|> /.current_module_name (/.result expected_lux) - (!expect (^multi {#try.Success actual_current_module} + (!expect (^multi {try.#Success actual_current_module} (text\= expected_current_module actual_current_module))))) (_.cover [/.current_module] (|> /.current_module (/.result expected_lux) - (!expect (^multi {#try.Success actual_module} + (!expect (^multi {try.#Success actual_module} (same? expected_module actual_module))))) (_.cover [/.module] (|> (/.module expected_current_module) (/.result expected_lux) - (!expect (^multi {#try.Success actual_module} + (!expect (^multi {try.#Success actual_module} (same? expected_module actual_module))))) (_.cover [/.module_exists?] (and (|> (/.module_exists? expected_current_module) (/.result expected_lux) - (!expect {#try.Success #1})) + (!expect {try.#Success #1})) (|> (/.module_exists? dummy_module) (/.result expected_lux) - (!expect {#try.Success #0})))) + (!expect {try.#Success #0})))) (_.cover [/.modules] (|> /.modules (/.result expected_lux) - (!expect (^multi {#try.Success actual_modules} + (!expect (^multi {try.#Success actual_modules} (same? expected_modules actual_modules))))) (_.cover [/.imported_modules] (and (|> (/.imported_modules expected_current_module) @@ -260,12 +260,12 @@ (_.cover [/.normal] (and (|> (/.normal ["" expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success [actual_module actual_short]} + (!expect (^multi {try.#Success [actual_module actual_short]} (and (text\= expected_current_module actual_module) (same? expected_short actual_short))))) (|> (/.normal [dummy_module expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success [actual_module actual_short]} + (!expect (^multi {try.#Success [actual_module actual_short]} (and (text\= dummy_module actual_module) (same? expected_short actual_short))))))) )))) @@ -284,30 +284,30 @@ source_code (random.ascii/upper 1) expected_current_module (random.ascii/upper 1) expected_type (\ ! each (function (_ name) - {#.Primitive name (list)}) + {.#Primitive name (list)}) (random.ascii/upper 1)) expected_seed random.nat expected random.nat dummy (random.only (|>> (n.= expected) not) random.nat) expected_location ..random_location - .let [type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - expected_lux [#.info [#.target target - #.version version - #.mode #.Build] - #.source [location.dummy 0 source_code] - #.location expected_location - #.current_module {#.Some expected_current_module} - #.modules (list) - #.scopes (list) - #.type_context type_context - #.expected {#.Some expected_type} - #.seed expected_seed - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []]]] + .let [type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + expected_lux [.#info [.#target target + .#version version + .#mode {.#Build}] + .#source [location.dummy 0 source_code] + .#location expected_location + .#current_module {.#Some expected_current_module} + .#modules (list) + .#scopes (list) + .#type_context type_context + .#expected {.#Some expected_type} + .#seed expected_seed + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []]]] ($_ _.and (_.cover [/.seed] (|> (do /.monad @@ -315,18 +315,18 @@ post /.seed] (in [pre post])) (/.result expected_lux) - (!expect (^multi {#try.Success [actual_pre actual_post]} + (!expect (^multi {try.#Success [actual_pre actual_post]} (and (n.= expected_seed actual_pre) (n.= (++ expected_seed) actual_post)))))) (_.cover [/.location] (|> /.location (/.result expected_lux) - (!expect (^multi {#try.Success actual_location} + (!expect (^multi {try.#Success actual_location} (same? expected_location actual_location))))) (_.cover [/.expected_type] (|> /.expected_type (/.result expected_lux) - (!expect (^multi {#try.Success actual_type} + (!expect (^multi {try.#Success actual_type} (same? expected_type actual_type))))) (_.cover [.Type_Context /.type_context] (|> /.type_context @@ -343,7 +343,7 @@ (random.ascii/upper 1)) expected_short (random.ascii/upper 1) expected_type (\ ! each (function (_ name) - {#.Primitive name (list)}) + {.#Primitive name (list)}) (random.ascii/upper 1)) expected_value (random.either (in .def:) (in .macro:)) @@ -355,96 +355,96 @@ (function (_ exported? def_type) (let [current_globals (: (List [Text .Global]) (list [expected_short - {#.Alias [expected_macro_module expected_short]}])) + {.#Alias [expected_macro_module expected_short]}])) macro_globals (: (List [Text .Global]) (case def_type - {#.Some def_type} + {.#Some def_type} (list [expected_short - {#.Definition [exported? def_type expected_value]}]) + {.#Definition [exported? def_type expected_value]}]) - #.None + {.#None} (list)))] [current_globals macro_globals - [#.info [#.target "" - #.version "" - #.mode #.Build] - #.source [location.dummy 0 ""] - #.location location.dummy - #.current_module {#.Some expected_current_module} - #.modules (list [expected_current_module - [#.module_hash 0 - #.module_aliases (list) - #.definitions current_globals - #.imports (list) - #.module_state #.Active]] + [.#info [.#target "" + .#version "" + .#mode {.#Build}] + .#source [location.dummy 0 ""] + .#location location.dummy + .#current_module {.#Some expected_current_module} + .#modules (list [expected_current_module + [.#module_hash 0 + .#module_aliases (list) + .#definitions current_globals + .#imports (list) + .#module_state {.#Active}]] [expected_macro_module - [#.module_hash 0 - #.module_aliases (list) - #.definitions macro_globals - #.imports (list) - #.module_state #.Active]]) - #.scopes (list) - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected #.None - #.seed 0 - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []]])))]] + [.#module_hash 0 + .#module_aliases (list) + .#definitions macro_globals + .#imports (list) + .#module_state {.#Active}]]) + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#None} + .#seed 0 + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []]])))]] ($_ _.and (_.cover [.Global .Alias /.globals] (let [[current_globals macro_globals expected_lux] - (expected_lux true {#.Some .Macro}) + (expected_lux true {.#Some .Macro}) current_globals! (|> (/.globals expected_current_module) (/.result expected_lux) - (!expect (^multi {#try.Success actual_globals} + (!expect (^multi {try.#Success actual_globals} (same? current_globals actual_globals)))) macro_globals! (|> (/.globals expected_macro_module) (/.result expected_lux) - (!expect (^multi {#try.Success actual_globals} + (!expect (^multi {try.#Success actual_globals} (same? macro_globals actual_globals))))] (and current_globals! macro_globals!))) (_.cover [.Definition /.definitions] (let [[current_globals macro_globals expected_lux] - (expected_lux true {#.Some .Macro})] + (expected_lux true {.#Some .Macro})] (and (|> (/.definitions expected_current_module) (/.result expected_lux) - (!expect (^multi {#try.Success actual_definitions} + (!expect (^multi {try.#Success actual_definitions} (n.= 0 (list.size actual_definitions))))) (|> (/.definitions expected_macro_module) (/.result expected_lux) - (!expect (^multi {#try.Success actual_definitions} + (!expect (^multi {try.#Success actual_definitions} (n.= 1 (list.size actual_definitions))))) ))) (_.cover [/.exports] (and (let [[current_globals macro_globals expected_lux] - (expected_lux true {#.Some .Macro})] + (expected_lux true {.#Some .Macro})] (and (|> (/.exports expected_current_module) (/.result expected_lux) - (!expect (^multi {#try.Success actual_definitions} + (!expect (^multi {try.#Success actual_definitions} (n.= 0 (list.size actual_definitions))))) (|> (/.exports expected_macro_module) (/.result expected_lux) - (!expect (^multi {#try.Success actual_definitions} + (!expect (^multi {try.#Success actual_definitions} (n.= 1 (list.size actual_definitions))))) )) (let [[current_globals macro_globals expected_lux] - (expected_lux false {#.Some .Macro})] + (expected_lux false {.#Some .Macro})] (and (|> (/.exports expected_current_module) (/.result expected_lux) - (!expect (^multi {#try.Success actual_definitions} + (!expect (^multi {try.#Success actual_definitions} (n.= 0 (list.size actual_definitions))))) (|> (/.exports expected_macro_module) (/.result expected_lux) - (!expect (^multi {#try.Success actual_definitions} + (!expect (^multi {try.#Success actual_definitions} (n.= 0 (list.size actual_definitions))))) )))) ))) @@ -458,7 +458,7 @@ (random.ascii/upper 1)) expected_short (random.ascii/upper 1) expected_type (\ ! each (function (_ name) - {#.Primitive name (list)}) + {.#Primitive name (list)}) (random.ascii/upper 1)) expected_value (random.either (in .def:) (in .macro:)) @@ -470,86 +470,86 @@ (function (_ exported? def_type) (let [current_globals (: (List [Text .Global]) (list [expected_short - {#.Alias [expected_macro_module expected_short]}])) + {.#Alias [expected_macro_module expected_short]}])) macro_globals (: (List [Text .Global]) (case def_type - {#.Some def_type} + {.#Some def_type} (list [expected_short - {#.Definition [exported? def_type expected_value]}]) + {.#Definition [exported? def_type expected_value]}]) - #.None + {.#None} (list)))] [current_globals macro_globals - [#.info [#.target "" - #.version "" - #.mode #.Build] - #.source [location.dummy 0 ""] - #.location location.dummy - #.current_module {#.Some expected_current_module} - #.modules (list [expected_current_module - [#.module_hash 0 - #.module_aliases (list) - #.definitions current_globals - #.imports (list) - #.module_state #.Active]] + [.#info [.#target "" + .#version "" + .#mode {.#Build}] + .#source [location.dummy 0 ""] + .#location location.dummy + .#current_module {.#Some expected_current_module} + .#modules (list [expected_current_module + [.#module_hash 0 + .#module_aliases (list) + .#definitions current_globals + .#imports (list) + .#module_state {.#Active}]] [expected_macro_module - [#.module_hash 0 - #.module_aliases (list) - #.definitions macro_globals - #.imports (list) - #.module_state #.Active]]) - #.scopes (list) - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected #.None - #.seed 0 - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []]])))]] + [.#module_hash 0 + .#module_aliases (list) + .#definitions macro_globals + .#imports (list) + .#module_state {.#Active}]]) + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#None} + .#seed 0 + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []]])))]] ($_ _.and (_.cover [/.export] (and (let [[current_globals macro_globals expected_lux] - (expected_lux true {#.Some expected_type})] + (expected_lux true {.#Some expected_type})] (|> (/.export [expected_macro_module expected_short]) (/.result expected_lux) - (!expect {#try.Success _}))) + (!expect {try.#Success _}))) (let [[current_globals macro_globals expected_lux] - (expected_lux false {#.Some expected_type})] + (expected_lux false {.#Some expected_type})] (|> (/.export [expected_macro_module expected_short]) (/.result expected_lux) - (!expect {#try.Failure _}))))) + (!expect {try.#Failure _}))))) (_.cover [/.macro] (let [same_module! (let [[current_globals macro_globals expected_lux] - (expected_lux true {#.Some .Macro})] + (expected_lux true {.#Some .Macro})] (|> (/.macro [expected_macro_module expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success {#.Some actual_value}} + (!expect (^multi {try.#Success {.#Some actual_value}} (same? expected_value actual_value))))) not_macro! (let [[current_globals macro_globals expected_lux] - (expected_lux true {#.Some expected_type})] + (expected_lux true {.#Some expected_type})] (|> (/.macro [expected_macro_module expected_short]) (/.result expected_lux) - (!expect {#try.Success #.None}))) + (!expect {try.#Success {.#None}}))) not_found! (let [[current_globals macro_globals expected_lux] - (expected_lux true #.None)] + (expected_lux true {.#None})] (|> (/.macro [expected_macro_module expected_short]) (/.result expected_lux) - (!expect {#try.Success #.None}))) + (!expect {try.#Success {.#None}}))) aliasing! (let [[current_globals macro_globals expected_lux] - (expected_lux true {#.Some .Macro})] + (expected_lux true {.#Some .Macro})] (|> (/.macro [expected_current_module expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success {#.Some actual_value}} + (!expect (^multi {try.#Success {.#Some actual_value}} (same? expected_value actual_value)))))] (and same_module! not_macro! @@ -557,7 +557,7 @@ aliasing!))) (_.cover [/.de_aliased] (let [[current_globals macro_globals expected_lux] - (expected_lux true {#.Some .Macro})] + (expected_lux true {.#Some .Macro})] (and (|> (/.de_aliased [expected_macro_module expected_short]) (/.result expected_lux) (try\each (name\= [expected_macro_module expected_short])) @@ -568,12 +568,12 @@ (try.else false))))) (_.cover [/.definition] (let [[current_globals macro_globals expected_lux] - (expected_lux expected_exported? {#.Some expected_type}) + (expected_lux expected_exported? {.#Some expected_type}) definition! (|> (/.definition [expected_macro_module expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success {#.Definition [actual_exported? actual_type actual_value]}} + (!expect (^multi {try.#Success {.#Definition [actual_exported? actual_type actual_value]}} (and (bit\= expected_exported? actual_exported?) (same? expected_type actual_type) (same? (:as Any expected_value) actual_value))))) @@ -581,42 +581,42 @@ alias! (|> (/.definition [expected_current_module expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success {#.Alias [actual_module actual_short]}} + (!expect (^multi {try.#Success {.#Alias [actual_module actual_short]}} (and (same? expected_macro_module actual_module) (same? expected_short actual_short)))))] (and definition! alias!))) (_.cover [/.definition_type] (let [[current_globals macro_globals expected_lux] - (expected_lux expected_exported? {#.Some expected_type}) + (expected_lux expected_exported? {.#Some expected_type}) definition! (|> (/.definition_type [expected_macro_module expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success actual_type} + (!expect (^multi {try.#Success actual_type} (same? expected_type actual_type)))) alias! (|> (/.definition_type [expected_current_module expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success actual_type} + (!expect (^multi {try.#Success actual_type} (same? expected_type actual_type))))] (and definition! alias!))) (_.cover [/.type_definition] (let [[current_globals macro_globals expected_lux] - (expected_lux expected_exported? {#.Some .Type}) + (expected_lux expected_exported? {.#Some .Type}) definition! (|> (/.type_definition [expected_macro_module expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success actual_value} + (!expect (^multi {try.#Success actual_value} (same? (:as .Type expected_value) actual_value)))) alias! (|> (/.type_definition [expected_current_module expected_short]) (/.result expected_lux) - (!expect (^multi {#try.Success actual_value} + (!expect (^multi {try.#Success actual_value} (same? (:as .Type expected_value) actual_value))))] (and definition! alias!))) @@ -644,52 +644,54 @@ (\ ! each set.list) (random.and (in head)))))] tags_0 random_labels - tags_1 (let [set/0 (set.of_list text.hash {#.Item tags_0})] - (random.only (|>> #.Item (list.any? (set.member? set/0))not) + tags_1 (let [set/0 (set.of_list text.hash {.#Item tags_0})] + (random.only (|>> {.#Item} + (list.any? (set.member? set/0)) + not) random_labels)) - .let [type_0 {#.Primitive name_0 (list)} - type_1 {#.Primitive name_1 (list)} + .let [type_0 {.#Primitive name_0 (list)} + type_1 {.#Primitive name_1 (list)} expected_lux (: Lux - [#.info [#.target "" - #.version "" - #.mode #.Build] - #.source [location.dummy 0 ""] - #.location location.dummy - #.current_module {#.Some current_module} - #.modules (list [current_module - [#.module_hash 0 - #.module_aliases (list) - #.definitions (list) - #.imports (list tag_module) - #.module_state #.Active]] + [.#info [.#target "" + .#version "" + .#mode {.#Build}] + .#source [location.dummy 0 ""] + .#location location.dummy + .#current_module {.#Some current_module} + .#modules (list [current_module + [.#module_hash 0 + .#module_aliases (list) + .#definitions (list) + .#imports (list tag_module) + .#module_state {.#Active}]] [tag_module - [#.module_hash 0 - #.module_aliases (list) - #.definitions (list& [name_0 {#.Type [false type_0 {#.Left tags_0}]}] - [name_1 {#.Type [true type_1 {#.Right tags_1}]}] + [.#module_hash 0 + .#module_aliases (list) + .#definitions (list& [name_0 {.#Type [false type_0 {.#Left tags_0}]}] + [name_1 {.#Type [true type_1 {.#Right tags_1}]}] ($_ list\composite - (|> {#.Item tags_0} + (|> {.#Item tags_0} list.enumeration (list\each (function (_ [index short]) - [(format "#" short) {#.Label [false type_0 {#.Item tags_0} index]}]))) - (|> {#.Item tags_1} + [short {.#Label [false type_0 {.#Item tags_0} index]}]))) + (|> {.#Item tags_1} list.enumeration (list\each (function (_ [index short]) - [(format "#" short) {#.Slot [true type_1 {#.Item tags_1} index]}]))))) - #.imports (list) - #.module_state #.Active]]) - #.scopes (list) - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected #.None - #.seed 0 - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []])]] + [short {.#Slot [true type_1 {.#Item tags_1} index]}]))))) + .#imports (list) + .#module_state {.#Active}]]) + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#None} + .#seed 0 + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []])]] ($_ _.and (_.cover [/.tag_lists] (let [equivalence (list.equivalence @@ -698,29 +700,29 @@ type.equivalence))] (|> (/.tag_lists tag_module) (/.result expected_lux) - (try\each (\ equivalence = (list [(list\each (|>> [tag_module]) {#.Item tags_1}) + (try\each (\ equivalence = (list [(list\each (|>> [tag_module]) {.#Item tags_1}) type_1]))) (try.else false)))) (_.cover [/.tags_of] (|> (/.tags_of [tag_module name_1]) (/.result expected_lux) - (try\each (\ (maybe.equivalence (list.equivalence name.equivalence)) = {#.Some (list\each (|>> [tag_module]) {#.Item tags_1})})) + (try\each (\ (maybe.equivalence (list.equivalence name.equivalence)) = {.#Some (list\each (|>> [tag_module]) {.#Item tags_1})})) (try.else false))) (_.cover [/.slot] - (|> {#.Item tags_1} + (|> {.#Item tags_1} list.enumeration (list.every? (function (_ [expected_index tag]) (|> [tag_module tag] /.slot (/.result expected_lux) - (!expect (^multi {#try.Success [actual_index actual_tags actual_type]} + (!expect (^multi {try.#Success [actual_index actual_tags actual_type]} (let [correct_index! (n.= expected_index actual_index) correct_tags! (\ (list.equivalence name.equivalence) = - (list\each (|>> [tag_module]) {#.Item tags_1}) + (list\each (|>> [tag_module]) {.#Item tags_1}) actual_tags) correct_type! @@ -742,63 +744,63 @@ (random.one (function (_ values) (case values (^ (list name_0 name_1 name_2 name_3 name_4)) - {#.Some [name_0 name_1 name_2 name_3 name_4]} + {.#Some [name_0 name_1 name_2 name_3 name_4]} _ - #.None)))) - .let [type_0 {#.Primitive name_0 (list)} - type_1 {#.Primitive name_1 (list)} - type_2 {#.Primitive name_2 (list)} - type_3 {#.Primitive name_3 (list)} - type_4 {#.Primitive name_4 (list)} + {.#None})))) + .let [type_0 {.#Primitive name_0 (list)} + type_1 {.#Primitive name_1 (list)} + type_2 {.#Primitive name_2 (list)} + type_3 {.#Primitive name_3 (list)} + type_4 {.#Primitive name_4 (list)} globals (: (List [Text .Global]) (list [name_4 - {#.Definition [false type_4 []]}])) - - scopes (list [#.name (list) - #.inner 0 - #.locals [#.counter 1 - #.mappings (list [name_3 [type_3 3]])] - #.captured [#.counter 0 - #.mappings (list)]] - [#.name (list) - #.inner 0 - #.locals [#.counter 2 - #.mappings (list [name_1 [type_1 1]] + {.#Definition [false type_4 []]}])) + + scopes (list [.#name (list) + .#inner 0 + .#locals [.#counter 1 + .#mappings (list [name_3 [type_3 3]])] + .#captured [.#counter 0 + .#mappings (list)]] + [.#name (list) + .#inner 0 + .#locals [.#counter 2 + .#mappings (list [name_1 [type_1 1]] [name_2 [type_2 2]])] - #.captured [#.counter 0 - #.mappings (list)]] - [#.name (list) - #.inner 0 - #.locals [#.counter 1 - #.mappings (list [name_0 [type_0 0]])] - #.captured [#.counter 0 - #.mappings (list)]])] + .#captured [.#counter 0 + .#mappings (list)]] + [.#name (list) + .#inner 0 + .#locals [.#counter 1 + .#mappings (list [name_0 [type_0 0]])] + .#captured [.#counter 0 + .#mappings (list)]])] .let [expected_lux (: Lux - [#.info [#.target "" - #.version "" - #.mode #.Build] - #.source [location.dummy 0 ""] - #.location location.dummy - #.current_module {#.Some current_module} - #.modules (list [current_module - [#.module_hash 0 - #.module_aliases (list) - #.definitions globals - #.imports (list) - #.module_state #.Active]]) - #.scopes scopes - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected #.None - #.seed 0 - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []])]] + [.#info [.#target "" + .#version "" + .#mode {.#Build}] + .#source [location.dummy 0 ""] + .#location location.dummy + .#current_module {.#Some current_module} + .#modules (list [current_module + [.#module_hash 0 + .#module_aliases (list) + .#definitions globals + .#imports (list) + .#module_state {.#Active}]]) + .#scopes scopes + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#None} + .#seed 0 + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []])]] ($_ _.and (_.cover [.Scope /.locals] (let [equivalence (: (Equivalence (List (List [Text Type]))) @@ -866,7 +868,7 @@ (function (_ == left right) (case [(/.result init left) (/.result init right)] - [{#try.Success left} {#try.Success right}] + [{try.#Success left} {try.#Success right}] (== left right) _ @@ -883,29 +885,29 @@ source_code (random.ascii/upper 1) expected_current_module (random.ascii/upper 1) expected_type (\ ! each (function (_ name) - {#.Primitive name (list)}) + {.#Primitive name (list)}) (random.ascii/upper 1)) expected_seed random.nat expected random.nat dummy (random.only (|>> (n.= expected) not) random.nat) expected_location ..random_location - .let [expected_lux [#.info [#.target target - #.version version - #.mode #.Build] - #.source [expected_location 0 source_code] - #.location expected_location - #.current_module {#.Some expected_current_module} - #.modules (list) - #.scopes (list) - #.type_context [#.ex_counter 0 - #.var_counter 0 - #.var_bindings (list)] - #.expected {#.Some expected_type} - #.seed expected_seed - #.scope_type_vars (list) - #.extensions [] - #.eval (:as (-> Type Code (Meta Any)) []) - #.host []]]] + .let [expected_lux [.#info [.#target target + .#version version + .#mode {.#Build}] + .#source [expected_location 0 source_code] + .#location expected_location + .#current_module {.#Some expected_current_module} + .#modules (list) + .#scopes (list) + .#type_context [.#ex_counter 0 + .#var_counter 0 + .#var_bindings (list)] + .#expected {.#Some expected_type} + .#seed expected_seed + .#scope_type_vars (list) + .#extensions [] + .#eval (:as (-> Type Code (Meta Any)) []) + .#host []]]] ($_ _.and (_.for [/.functor] ($functor.spec ..injection (..comparison expected_lux) /.functor)) @@ -919,19 +921,19 @@ expected_error (random.ascii/upper 1)] (_.cover [/.lifted] (and (|> expected_error - #try.Failure + {try.#Failure} (: (Try Nat)) /.lifted (/.result expected_lux) - (!expect (^multi {#try.Failure actual} + (!expect (^multi {try.#Failure actual} (text\= (location.with expected_location expected_error) actual)))) (|> expected_value - #try.Success + {try.#Success} (: (Try Nat)) /.lifted (/.result expected_lux) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (same? expected_value actual))))))) ..compiler_related diff --git a/stdlib/source/test/lux/program.lux b/stdlib/source/test/lux/program.lux index 18bc932e8..b80b2aa90 100644 --- a/stdlib/source/test/lux/program.lux +++ b/stdlib/source/test/lux/program.lux @@ -66,8 +66,8 @@ (case (try ((: (-> (List Text) (io.IO Any)) (..actual_program <program>)) inputs)) - {#try.Success _} + {try.#Success _} false - {#try.Failure _} + {try.#Failure _} true)))))))) diff --git a/stdlib/source/test/lux/static.lux b/stdlib/source/test/lux/static.lux index d603b4d85..e048503ba 100644 --- a/stdlib/source/test/lux/static.lux +++ b/stdlib/source/test/lux/static.lux @@ -37,16 +37,16 @@ _ false)))] - [/.nat /.random_nat n.= n.+ #.Nat] - [/.int /.random_int i.= i.+ #.Int] - [/.rev /.random_rev r.= r.+ #.Rev] + [/.nat /.random_nat n.= n.+ .#Nat] + [/.int /.random_int i.= i.+ .#Int] + [/.rev /.random_rev r.= r.+ .#Rev] )) (_.cover [/.frac /.random_frac] (with_expansions [<left> (/.random_frac) <right> (/.random_frac) <l+r> (/.frac (f.+ <left> <right>))] (case (' <l+r>) - [_ {#.Frac l+r}] + [_ {.#Frac l+r}] (or (f.= l+r (f.+ <left> <right>)) (and (f.not_a_number? l+r) (f.not_a_number? (f.+ <left> <right>)) @@ -60,7 +60,7 @@ <right> (/.random code.text (random.ascii/alpha_num 1)) <l+r> (/.text (format <left> <right>))] (case (' <l+r>) - [_ {#.Text l+r}] + [_ {.#Text l+r}] (text\= l+r (format <left> <right>)) _ @@ -70,7 +70,7 @@ <right> (/.random code.text (random.ascii/alpha_num 1)) <l+r> (/.literal code.text (format <left> <right>))] (case (' <l+r>) - [_ {#.Text l+r}] + [_ {.#Text l+r}] (text\= l+r (format <left> <right>)) _ diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index 0d17df0ff..9c834c5dc 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -117,7 +117,7 @@ method_name (/type.method [(list) (list) ..$Object (list)]) (list) - {#.Some (do /.monad + {.#Some (do /.monad [_ bytecode] /.areturn)})) (row.row)) @@ -127,10 +127,10 @@ class (io.run! (/loader.load class_name loader)) method (try (get_method method_name class))] (java/lang/reflect/Method::invoke (ffi.null) (ffi.array java/lang/Object 0) method)) - {#try.Success actual} + {try.#Success actual} (test actual) - {#try.Failure error} + {try.#Failure error} false)))) (type: (Primitive a) @@ -861,7 +861,7 @@ constructor constructor::type (list) - {#.Some (do /.monad + {.#Some (do /.monad [_ /.aload_0 _ (/.invokespecial ..$Object constructor (/type.method [(list) (list) /type.void (list)])) _ (..$Long::literal part0) @@ -876,7 +876,7 @@ static_method (/type.method [(list) (list) ..$Long (list)]) (list) - {#.Some (do /.monad + {.#Some (do /.monad [_ (/.new $Self) _ /.dup _ (..$Long::literal part1) @@ -897,10 +897,10 @@ method (try (get_method static_method class)) output (java/lang/reflect/Method::invoke (ffi.null) (ffi.array java/lang/Object 0) method)] (in (:as Int output))) - {#try.Success actual} + {try.#Success actual} (i.= (:as Int expected) (:as Int actual)) - {#try.Failure error} + {try.#Failure error} false)))) (def: array @@ -1031,7 +1031,7 @@ (..bytecode (|>> (:as Nat) (n.= sizesH))) (do [! /.monad] [_ (monad.each ! (|>> (:as java/lang/Long) ffi.long_to_int ..$Integer::literal) - {#.Item sizesH sizesT}) + {.#Item sizesH sizesT}) _ (/.multianewarray type (|> dimensions /unsigned.u1 try.trusted)) _ ?length] $Long::wrap)))) @@ -1337,20 +1337,20 @@ primitive_method_name primitive_method_type (list) - {#.Some (do /.monad + {.#Some (do /.monad [_ ((value@ #literal primitive) expected)] return)}) (/method.method ..method_modifier object_method_name (/type.method [(list) (list) (value@ #boxed primitive) (list)]) (list) - {#.Some (do /.monad + {.#Some (do /.monad [_ (/.invokestatic $Self primitive_method_name primitive_method_type) _ (case substitute - #.None + {.#None} (in []) - {#.Some substitute} + {.#Some substitute} (substitute expected)) _ (value@ #wrap primitive)] /.areturn)})) @@ -1361,18 +1361,18 @@ class (io.run! (/loader.load class_name loader)) method (try (get_method object_method_name class))] (java/lang/reflect/Method::invoke (ffi.null) (ffi.array java/lang/Object 0) method)) - {#try.Success actual} + {try.#Success actual} (test expected actual) - {#try.Failure error} + {try.#Failure error} false) ))))] ($_ _.and - (_.lifted "IRETURN" (primitive_return ..$Integer::primitive /.ireturn #.None (!::= java/lang/Integer "jvm ieq" "jvm int ="))) - (_.lifted "LRETURN" (primitive_return ..$Long::primitive /.lreturn #.None (!::= java/lang/Long "jvm leq" "jvm long ="))) - (_.lifted "FRETURN" (primitive_return ..$Float::primitive /.freturn #.None (!::= java/lang/Float "jvm feq" "jvm float ="))) - (_.lifted "DRETURN" (primitive_return ..$Double::primitive /.dreturn #.None (!::= java/lang/Double "jvm deq" "jvm double ="))) - (_.lifted "ARETURN" (primitive_return ..$String::primitive /.areturn #.None (function (_ expected actual) (text\= (:as Text expected) (:as Text actual))))) + (_.lifted "IRETURN" (primitive_return ..$Integer::primitive /.ireturn {.#None} (!::= java/lang/Integer "jvm ieq" "jvm int ="))) + (_.lifted "LRETURN" (primitive_return ..$Long::primitive /.lreturn {.#None} (!::= java/lang/Long "jvm leq" "jvm long ="))) + (_.lifted "FRETURN" (primitive_return ..$Float::primitive /.freturn {.#None} (!::= java/lang/Float "jvm feq" "jvm float ="))) + (_.lifted "DRETURN" (primitive_return ..$Double::primitive /.dreturn {.#None} (!::= java/lang/Double "jvm deq" "jvm double ="))) + (_.lifted "ARETURN" (primitive_return ..$String::primitive /.areturn {.#None} (function (_ expected actual) (text\= (:as Text expected) (:as Text actual))))) (_.lifted "RETURN" (primitive_return (: (Primitive java/lang/String) [#unboxed /type.void #boxed ..$String @@ -1380,7 +1380,7 @@ #random ..$String::random #literal (function.constant /.nop)]) /.return - {#.Some ..$String::literal} + {.#Some ..$String::literal} (function (_ expected actual) (text\= (:as Text expected) (:as Text actual))))) ))) @@ -1623,7 +1623,7 @@ name method::type (list) - {#.Some (do /.monad + {.#Some (do /.monad [_ (..$Long::literal value)] /.lreturn)}))) @@ -1633,7 +1633,7 @@ (list) (list) (list (/method.method ($_ /modifier\composite /method.public /method.abstract) - interface_method method::type (list) #.None)) + interface_method method::type (list) {.#None})) (row.row)) try.trusted (format.result /class.writer)) @@ -1646,14 +1646,14 @@ "<init>" constructor::type (list) - {#.Some (do /.monad + {.#Some (do /.monad [_ /.aload_0 _ (/.invokespecial ..$Object "<init>" constructor::type)] /.return)}) (method inherited_method part0) (method overriden_method fake_part2) (/method.method ($_ /modifier\composite /method.public /method.abstract) - abstract_method method::type (list) #.None)) + abstract_method method::type (list) {.#None})) (row.row)) try.trusted (format.result /class.writer)) @@ -1671,7 +1671,7 @@ "<init>" constructor::type (list) - {#.Some (do /.monad + {.#Some (do /.monad [_ /.aload_0 _ (/.invokespecial $Abstract "<init>" constructor::type)] /.return)}) @@ -1685,7 +1685,7 @@ static_method (/type.method [(list) (list) ..$Long (list)]) (list) - {#.Some (do /.monad + {.#Some (do /.monad [_ (/.new $Concrete) _ /.dup _ (/.invokespecial $Concrete "<init>" constructor::type) @@ -1714,10 +1714,10 @@ method (try (get_method static_method class)) output (java/lang/reflect/Method::invoke (ffi.null) (ffi.array java/lang/Object 0) method)] (in (:as Int output))) - {#try.Success actual} + {try.#Success actual} (i.= (:as Int expected) (:as Int actual)) - {#try.Failure error} + {try.#Failure error} false)))) (def: .public test diff --git a/stdlib/source/test/lux/test.lux b/stdlib/source/test/lux/test.lux index 60176aadc..d8dfd6e88 100644 --- a/stdlib/source/test/lux/test.lux +++ b/stdlib/source/test/lux/test.lux @@ -25,8 +25,8 @@ (-> Text Text Nat Nat [/.Tally Text] Bit) (and (text.contains? expected_message/0 message) (text.contains? expected_message/1 message) - (n.= successes (value@ #/.successes tally)) - (n.= failures (value@ #/.failures tally)))) + (n.= successes (value@ /.#successes tally)) + (n.= failures (value@ /.#failures tally)))) (def: assertion /.Test @@ -41,10 +41,10 @@ (/.cover' [/.assertion /.Tally] (and (text.ends_with? expected_message/0 success_message) (text.ends_with? expected_message/0 failure_message) - (and (n.= 1 (value@ #/.successes success_tally)) - (n.= 0 (value@ #/.failures success_tally))) - (and (n.= 0 (value@ #/.successes failure_tally)) - (n.= 1 (value@ #/.failures failure_tally))))))) + (and (n.= 1 (value@ /.#successes success_tally)) + (n.= 0 (value@ /.#failures success_tally))) + (and (n.= 0 (value@ /.#successes failure_tally)) + (n.= 1 (value@ /.#failures failure_tally))))))) (in (do async.monad [tt (/.and' (/.assertion expected_message/0 true) (/.assertion expected_message/1 true)) @@ -82,10 +82,10 @@ [[pre_tally pre_message] pre [post_tally post_message] post] (/.cover' [/.seed] - (and (and (n.= 1 (value@ #/.successes pre_tally)) - (n.= 0 (value@ #/.failures pre_tally))) - (and (n.= 1 (value@ #/.successes post_tally)) - (n.= 0 (value@ #/.failures post_tally))))))))) + (and (and (n.= 1 (value@ /.#successes pre_tally)) + (n.= 0 (value@ /.#failures pre_tally))) + (and (n.= 1 (value@ /.#successes post_tally)) + (n.= 0 (value@ /.#failures post_tally))))))))) (def: times /.Test @@ -95,9 +95,9 @@ (in (do async.monad [[tally error] times_assertion] (/.cover' [/.must_try_test_at_least_once] - (and (text.contains? (value@ #exception.label /.must_try_test_at_least_once) error) - (n.= 0 (value@ #/.successes tally)) - (n.= 1 (value@ #/.failures tally))))))) + (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] [expected (\ ! each (|>> (n.% 10) ++) random.nat) .let [counter (: (Atom Nat) @@ -112,8 +112,8 @@ actual (async.future (atom.read! counter))] (/.cover' [/.times] (and (n.= expected actual) - (n.= 1 (value@ #/.successes tally)) - (n.= 0 (value@ #/.failures tally))))))) + (n.= 1 (value@ /.#successes tally)) + (n.= 0 (value@ /.#failures tally))))))) )) (def: in_parallel @@ -135,8 +135,8 @@ actual (async.future (atom.read! counter))] (/.cover' [/.in_parallel] (and (n.= expected actual) - (n.= expected (value@ #/.successes tally)) - (n.= 0 (value@ #/.failures tally))))))) + (n.= expected (value@ /.#successes tally)) + (n.= 0 (value@ /.#failures tally))))))) (do [! random.monad] [expected (\ ! each (|>> (n.% 10) ++) random.nat) .let [counter (: (Atom Nat) @@ -153,10 +153,10 @@ [[tally error] assertion actual (async.future (atom.read! counter))] (/.cover' [/.error_during_execution] - (let [correct_error! (text.contains? (value@ #exception.label /.error_during_execution) error) + (let [correct_error! (text.contains? (value@ exception.#label /.error_during_execution) error) no_complete_run! (n.= 0 actual) - no_successes! (n.= 0 (value@ #/.successes tally)) - ran_all_tests! (n.= expected (value@ #/.failures tally))] + no_successes! (n.= 0 (value@ /.#successes tally)) + ran_all_tests! (n.= expected (value@ /.#failures tally))] (and correct_error! no_complete_run! no_successes! @@ -176,10 +176,10 @@ [[not_covering _] not_covering [covering _] covering] (/.cover' [/.covering] - (and (and (set.empty? (value@ #/.expected_coverage not_covering)) - (set.empty? (value@ #/.actual_coverage not_covering))) - (and (not (set.empty? (value@ #/.expected_coverage covering))) - (set.empty? (value@ #/.actual_coverage covering)))))))) + (and (and (set.empty? (value@ /.#expected_coverage not_covering)) + (set.empty? (value@ /.#actual_coverage not_covering))) + (and (not (set.empty? (value@ /.#expected_coverage covering))) + (set.empty? (value@ /.#actual_coverage covering)))))))) (do random.monad [not_covering (/.covering .._ (/.test "" true)) covering (/.covering .._ (/.cover [..dummy_target] true))] @@ -187,10 +187,10 @@ [[not_covering _] not_covering [covering _] covering] (/.cover' [/.cover] - (and (and (not (set.empty? (value@ #/.expected_coverage not_covering))) - (not (set.member? (value@ #/.actual_coverage not_covering) (name_of ..dummy_target)))) - (and (not (set.empty? (value@ #/.expected_coverage covering))) - (set.member? (value@ #/.actual_coverage covering) (name_of ..dummy_target)))))))) + (and (and (not (set.empty? (value@ /.#expected_coverage not_covering))) + (not (set.member? (value@ /.#actual_coverage not_covering) (name_of ..dummy_target)))) + (and (not (set.empty? (value@ /.#expected_coverage covering))) + (set.member? (value@ /.#actual_coverage covering) (name_of ..dummy_target)))))))) (do random.monad [not_covering (/.covering .._ (/.test "" true)) covering (/.covering .._ (in (/.cover' [..dummy_target] true)))] @@ -198,10 +198,10 @@ [[not_covering _] not_covering [covering _] covering] (/.cover' [/.cover'] - (and (and (not (set.empty? (value@ #/.expected_coverage not_covering))) - (not (set.member? (value@ #/.actual_coverage not_covering) (name_of ..dummy_target)))) - (and (not (set.empty? (value@ #/.expected_coverage covering))) - (set.member? (value@ #/.actual_coverage covering) (name_of ..dummy_target)))))))) + (and (and (not (set.empty? (value@ /.#expected_coverage not_covering))) + (not (set.member? (value@ /.#actual_coverage not_covering) (name_of ..dummy_target)))) + (and (not (set.empty? (value@ /.#expected_coverage covering))) + (set.member? (value@ /.#actual_coverage covering) (name_of ..dummy_target)))))))) (do random.monad [not_covering (/.covering .._ (/.test "" true)) covering (/.covering .._ (/.for [..dummy_target] (/.test "" true)))] @@ -209,10 +209,10 @@ [[not_covering _] not_covering [covering _] covering] (/.cover' [/.for] - (and (and (not (set.empty? (value@ #/.expected_coverage not_covering))) - (not (set.member? (value@ #/.actual_coverage not_covering) (name_of ..dummy_target)))) - (and (not (set.empty? (value@ #/.expected_coverage covering))) - (set.member? (value@ #/.actual_coverage covering) (name_of ..dummy_target)))))))) + (and (and (not (set.empty? (value@ /.#expected_coverage not_covering))) + (not (set.member? (value@ /.#actual_coverage not_covering) (name_of ..dummy_target)))) + (and (not (set.empty? (value@ /.#expected_coverage covering))) + (set.member? (value@ /.#actual_coverage covering) (name_of ..dummy_target)))))))) )) (def: .public test @@ -239,10 +239,10 @@ (/.cover' [/.test] (and (text.ends_with? expected_message/0 success_message) (text.ends_with? expected_message/0 failure_message) - (and (n.= 1 (value@ #/.successes success_tally)) - (n.= 0 (value@ #/.failures success_tally))) - (and (n.= 0 (value@ #/.successes failure_tally)) - (n.= 1 (value@ #/.failures failure_tally)))))))) + (and (n.= 1 (value@ /.#successes success_tally)) + (n.= 0 (value@ /.#failures success_tally))) + (and (n.= 0 (value@ /.#successes failure_tally)) + (n.= 1 (value@ /.#failures failure_tally)))))))) (do ! [tt (/.and (/.test expected_message/0 true) (/.test expected_message/1 true)) @@ -273,18 +273,18 @@ (text.contains? expected_message/0 success_message)) (and (text.contains? expected_context failure_message) (text.contains? expected_message/0 failure_message)) - (and (n.= 1 (value@ #/.successes success_tally)) - (n.= 0 (value@ #/.failures success_tally))) - (and (n.= 0 (value@ #/.successes failure_tally)) - (n.= 1 (value@ #/.failures failure_tally)))))))) + (and (n.= 1 (value@ /.#successes success_tally)) + (n.= 0 (value@ /.#failures success_tally))) + (and (n.= 0 (value@ /.#successes failure_tally)) + (n.= 1 (value@ /.#failures failure_tally)))))))) (do ! [failure_assertion (/.failure expected_message/0)] (in (do async.monad [[failure_tally failure_message] failure_assertion] (/.cover' [/.failure] (and (text.contains? expected_message/0 failure_message) - (and (n.= 0 (value@ #/.successes failure_tally)) - (n.= 1 (value@ #/.failures failure_tally)))))))) + (and (n.= 0 (value@ /.#successes failure_tally)) + (n.= 1 (value@ /.#failures failure_tally)))))))) (do ! [success_assertion (/.lifted expected_message/0 (in true)) failure_assertion (/.lifted expected_message/0 (in false))] @@ -294,10 +294,10 @@ (/.cover' [/.lifted] (and (text.contains? expected_message/0 success_message) (text.contains? expected_message/0 failure_message) - (and (n.= 1 (value@ #/.successes success_tally)) - (n.= 0 (value@ #/.failures success_tally))) - (and (n.= 0 (value@ #/.successes failure_tally)) - (n.= 1 (value@ #/.failures failure_tally)))))))) + (and (n.= 1 (value@ /.#successes success_tally)) + (n.= 0 (value@ /.#failures success_tally))) + (and (n.= 0 (value@ /.#successes failure_tally)) + (n.= 1 (value@ /.#failures failure_tally)))))))) ..times ..in_parallel ..coverage diff --git a/stdlib/source/test/lux/time.lux b/stdlib/source/test/lux/time.lux index 32bb9d67c..2e2ce39c5 100644 --- a/stdlib/source/test/lux/time.lux +++ b/stdlib/source/test/lux/time.lux @@ -76,8 +76,8 @@ (text.prefix <prefix>) (text.suffix <suffix>) (\ /.codec decoded) - (case> {#try.Success _} true - {#try.Failure error} false)) + (case> {try.#Success _} true + {try.#Failure error} false)) invalid! (|> <invalid> @@ -85,10 +85,10 @@ (text.prefix <prefix>) (text.suffix <suffix>) (\ /.codec decoded) - (case> {#try.Success _} + (case> {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? <exception> error)))] (and valid! invalid!)))] @@ -102,8 +102,8 @@ %.nat (format "00:00:00.") (\ /.codec decoded) - (case> {#try.Success _} true - {#try.Failure error} false))) + (case> {try.#Success _} true + {try.#Failure error} false))) )))) (def: .public test @@ -127,10 +127,10 @@ (try.else false))) (_.cover [/.time_exceeds_a_day] (case (/.of_millis out_of_bounds) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.time_exceeds_a_day error))) (_.cover [/.midnight] (|> /.midnight diff --git a/stdlib/source/test/lux/time/date.lux b/stdlib/source/test/lux/time/date.lux index 24d18c5b9..975131f1c 100644 --- a/stdlib/source/test/lux/time/date.lux +++ b/stdlib/source/test/lux/time/date.lux @@ -53,10 +53,10 @@ (case (/.date (/.year expected) (/.month expected) (n.+ 31 (/.day_of_month expected))) - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_day error) - {#try.Success _} + {try.#Success _} false))) (do random.monad [expected random.date] @@ -88,9 +88,9 @@ "-" (%.nat day))]] (_.cover [/.invalid_month] (case (<text>.result /.parser input) - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_month error) - {#try.Success _} + {try.#Success _} false))) ))) diff --git a/stdlib/source/test/lux/time/day.lux b/stdlib/source/test/lux/time/day.lux index 04d267d79..c6f953334 100644 --- a/stdlib/source/test/lux/time/day.lux +++ b/stdlib/source/test/lux/time/day.lux @@ -27,13 +27,13 @@ (def: .public random (Random /.Day) - (random.either (random.either (random.either (random\in #/.Sunday) - (random\in #/.Monday)) - (random.either (random\in #/.Tuesday) - (random\in #/.Wednesday))) - (random.either (random.either (random\in #/.Thursday) - (random\in #/.Friday)) - (random\in #/.Saturday)))) + (random.either (random.either (random.either (random\in {/.#Sunday}) + (random\in {/.#Monday})) + (random.either (random\in {/.#Tuesday}) + (random\in {/.#Wednesday}))) + (random.either (random.either (random\in {/.#Thursday}) + (random\in {/.#Friday})) + (random\in {/.#Saturday})))) (def: .public test Test @@ -41,8 +41,8 @@ (_.for [/.Day]) (do random.monad [expected ..random - invalid (random.only (predicate.or (n.< (/.number #/.Sunday)) - (n.> (/.number #/.Saturday))) + invalid (random.only (predicate.or (n.< (/.number {/.#Sunday})) + (n.> (/.number {/.#Saturday}))) random.nat)] ($_ _.and (_.for [/.equivalence] @@ -60,10 +60,10 @@ [not_a_day (random.ascii/upper 1)] (_.cover [/.not_a_day_of_the_week] (case (\ /.codec decoded not_a_day) - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_a_day_of_the_week error) - {#try.Success _} + {try.#Success _} false))) (_.cover [/.number /.by_number] (|> expected @@ -73,15 +73,15 @@ (try.else false))) (_.cover [/.invalid_day] (case (/.by_number invalid) - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_day error) - {#try.Success _} + {try.#Success _} false)) (_.cover [/.week] (let [all (list.size /.week) uniques (set.size (set.of_list /.hash /.week))] - (and (n.= (/.number #/.Saturday) + (and (n.= (/.number {/.#Saturday}) all) (n.= all uniques)))) diff --git a/stdlib/source/test/lux/time/instant.lux b/stdlib/source/test/lux/time/instant.lux index 57050174e..aba4914bf 100644 --- a/stdlib/source/test/lux/time/instant.lux +++ b/stdlib/source/test/lux/time/instant.lux @@ -98,9 +98,9 @@ (apply duration.inverse day\pred 7))))) (_.cover [/.now] (case (try (io.run! /.now)) - {#try.Success _} + {try.#Success _} true - {#try.Failure _} + {try.#Failure _} false)) ))) diff --git a/stdlib/source/test/lux/time/month.lux b/stdlib/source/test/lux/time/month.lux index 4db1303b3..354441828 100644 --- a/stdlib/source/test/lux/time/month.lux +++ b/stdlib/source/test/lux/time/month.lux @@ -29,7 +29,7 @@ (def: .public random (Random /.Month) - (let [december (/.number #/.December)] + (let [december (/.number {/.#December})] (|> random.nat (\ random.monad each (|>> (n.% december) ++)) (random.one (|>> /.by_number try.maybe))))) @@ -52,8 +52,8 @@ (do random.monad [expected ..random - invalid (random.only (predicate.or (n.< (/.number #/.January)) - (n.> (/.number #/.December))) + invalid (random.only (predicate.or (n.< (/.number {/.#January})) + (n.> (/.number {/.#December}))) random.nat)] ($_ _.and (_.cover [/.number /.by_number] @@ -64,15 +64,15 @@ (try.else false))) (_.cover [/.invalid_month] (case (/.by_number invalid) - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_month error) - {#try.Success _} + {try.#Success _} false)) (_.cover [/.year] (let [all (list.size /.year) uniques (set.size (set.of_list /.hash /.year))] - (and (n.= (/.number #/.December) + (and (n.= (/.number {/.#December}) all) (n.= all uniques)))) @@ -92,9 +92,9 @@ [not_a_month (random.ascii/upper 1)] (_.cover [/.not_a_month_of_the_year] (case (\ /.codec decoded not_a_month) - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_a_month_of_the_year error) - {#try.Success _} + {try.#Success _} false))) ))))) diff --git a/stdlib/source/test/lux/time/year.lux b/stdlib/source/test/lux/time/year.lux index 1d949bf44..f2b12e776 100644 --- a/stdlib/source/test/lux/time/year.lux +++ b/stdlib/source/test/lux/time/year.lux @@ -49,25 +49,25 @@ (_.cover [/.year] (bit\= (i.= +0 expected) (case (/.year expected) - {#try.Success _} + {try.#Success _} false - {#try.Failure _} + {try.#Failure _} true))) (_.cover [/.value] (case (/.year expected) - {#try.Success year} + {try.#Success year} (i.= expected (/.value year)) - {#try.Failure _} + {try.#Failure _} (i.= +0 expected))) )) (_.cover [/.there_is_no_year_0] (case (/.year +0) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.there_is_no_year_0 error))) (_.cover [/.days] (n.= (.nat (//duration.ticks //duration.day //duration.normal_year)) 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 481f8a73e..4e8a2c28b 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 @@ -41,22 +41,22 @@ (def: (exhaustive_weaving branchings) (-> (List (List Code)) (List (List Code))) (case branchings - #.End - #.End + {.#End} + {.#End} - {#.Item head+ #.End} + {.#Item head+ {.#End}} (list\each (|>> list) head+) - {#.Item head+ tail++} + {.#Item head+ tail++} (do list.monad [tail+ (exhaustive_weaving tail++) head head+] - (in {#.Item head tail+})))) + (in {.#Item head tail+})))) (def: .public (exhaustive_branches allow_literals? variantTC inputC) (-> Bit (List [Code Code]) Code (Random (List Code))) (case inputC - [_ {#.Bit _}] + [_ {.#Bit _}] (r\in (list (' #0) (' #1))) (^template [<tag> <gen> <wrapper>] @@ -65,34 +65,34 @@ (do [! r.monad] [?sample (r.maybe <gen>)] (case ?sample - {#.Some sample} + {.#Some sample} (do ! [else (exhaustive_branches allow_literals? variantTC inputC)] (in (list& (<wrapper> sample) else))) - #.None + {.#None} (in (list (' _))))) (r\in (list (' _))))]) - ([#.Nat r.nat code.nat] - [#.Int r.int code.int] - [#.Rev r.rev code.rev] - [#.Frac r.frac code.frac] - [#.Text (r.unicode 5) code.text]) + ([.#Nat r.nat code.nat] + [.#Int r.int code.int] + [.#Rev r.rev code.rev] + [.#Frac r.frac code.frac] + [.#Text (r.unicode 5) code.text]) - (^ [_ {#.Tuple (list)}]) + (^ [_ {.#Tuple (list)}]) (r\in (list (' []))) - [_ {#.Tuple members}] + [_ {.#Tuple members}] (do [! r.monad] [member_wise_patterns (monad.each ! (exhaustive_branches allow_literals? variantTC) members)] (in (|> member_wise_patterns exhaustive_weaving (list\each code.tuple)))) - (^ [_ {#.Record (list)}]) + (^ [_ {.#Record (list)}]) (r\in (list (' {}))) - [_ {#.Record kvs}] + [_ {.#Record kvs}] (do [! r.monad] [.let [ks (list\each product.left kvs) vs (list\each product.right kvs)] @@ -101,7 +101,7 @@ exhaustive_weaving (list\each (|>> (list.zipped/2 ks) code.record))))) - (^ [_ {#.Form (list [_ {#.Tag _}] _)}]) + (^ [_ {.#Form (list [_ {.#Tag _}] _)}]) (do [! r.monad] [bundles (monad.each ! (function (_ [_tag _code]) @@ -163,10 +163,10 @@ ////analysis.with_scope (do phase.monad [_ (//module.declare_tags variant_tags false - {#.Named [module_name variant_name] + {.#Named [module_name variant_name] (type.variant primitivesT)}) _ (//module.declare_tags record_tags false - {#.Named [module_name record_name] + {.#Named [module_name record_name] (type.tuple primitivesT)})]) (//module.with_module 0 module_name)))] exhaustive_patterns (exhaustive_branches true variantTC inputC) 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 73ef650e6..4236d6022 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 @@ -43,11 +43,11 @@ (|> analysis (//type.with_type expectedT) (phase.result _primitive.state) - (case> {#try.Success applyA} + (case> {try.#Success applyA} (let [[funcA argsA] (////analysis.application applyA)] (n.= num_args (list.size argsA))) - {#try.Failure _} + {try.#Failure _} false))) (def: abstraction @@ -90,7 +90,7 @@ [outputT outputC] _primitive.primitive .let [funcT (type.function inputsT outputT) partialT (type.function (list.after partial_args inputsT) outputT) - varT {#.Parameter 1} + varT {.#Parameter 1} polyT (<| (type.univ_q 1) (type.function (list.together (list (list.first var_idx inputsT) (list varT) @@ -101,9 +101,9 @@ partial_polyT1 (<| (type.function partial_poly_inputsT) poly_inputT) partial_polyT2 (<| (type.univ_q 1) - (type.function {#.Item varT partial_poly_inputsT}) + (type.function {.#Item varT partial_poly_inputsT}) varT) - dummy_function {#////analysis.Function (list) {#////analysis.Reference (////reference.local 1)}}]] + dummy_function {////analysis.#Function (list) {////analysis.#Reference (////reference.local 1)}}]] (<| (_.context (%.name (name_of /.apply))) ($_ _.and (_.test "Can analyse monomorphic type application." diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/primitive.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/primitive.lux index 1ca30c317..c81b5a62a 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/primitive.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/primitive.lux @@ -34,12 +34,12 @@ (def: .public (expander macro inputs state) Expander - {#try.Failure "NOPE"}) + {try.#Failure "NOPE"}) (def: .public (eval archive count type expression) Eval (function (_ state) - {#try.Failure "NO!"})) + {try.#Failure "NO!"})) (def: .public phase ////analysis.Phase @@ -76,20 +76,20 @@ (|> analysis //type.with_inference (phase.result ..state) - (case> {#try.Success [inferred_type output]} + (case> {try.#Success [inferred_type output]} (if (same? expected_type inferred_type) - {#try.Success output} + {try.#Success output} (exception.except wrong_inference [expected_type inferred_type])) - {#try.Failure error} - {#try.Failure error}))) + {try.#Failure error} + {try.#Failure error}))) (def: .public test (<| (_.context (name.module (name_of /._))) (`` ($_ _.and - (_.test (%.name (name_of #////analysis.Unit)) + (_.test (%.name (name_of ////analysis.#Unit)) (|> (infer Any (..phase archive.empty (' []))) - (case> (^ {#try.Success {#////analysis.Primitive {#////analysis.Unit output}}}) + (case> (^ {try.#Success {////analysis.#Primitive {////analysis.#Unit output}}}) (same? [] output) _ @@ -99,16 +99,16 @@ [sample <random>] (_.test (%.name (name_of <tag>)) (|> (infer <type> (..phase archive.empty (<constructor> sample))) - (case> {#try.Success {#////analysis.Primitive {<tag> output}}} + (case> {try.#Success {////analysis.#Primitive {<tag> output}}} (same? sample output) _ false))))] - [Bit #////analysis.Bit r.bit code.bit] - [Nat #////analysis.Nat r.nat code.nat] - [Int #////analysis.Int r.int code.int] - [Rev #////analysis.Rev r.rev code.rev] - [Frac #////analysis.Frac r.frac code.frac] - [Text #////analysis.Text (r.unicode 5) code.text] + [Bit ////analysis.#Bit r.bit code.bit] + [Nat ////analysis.#Nat r.nat code.nat] + [Int ////analysis.#Int r.int code.int] + [Rev ////analysis.#Rev r.rev code.rev] + [Frac ////analysis.#Frac r.frac code.frac] + [Text ////analysis.#Text (r.unicode 5) code.text] )))))) 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 981b2604f..7fcc0f9e0 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 @@ -38,10 +38,10 @@ (template [<name> <on_success> <on_failure>] [(def: <name> Check - (|>> (case> {#try.Success _} + (|>> (case> {try.#Success _} <on_success> - {#try.Failure _} + {try.#Failure _} <on_failure>)))] [success? true false] @@ -52,7 +52,7 @@ (-> Text [Bit Text] [Bit Text] Check Bit) (|> (do [! phase.monad] [_ (//module.with_module 0 def_module - (//module.define var_name {#.Right [export? Any []]}))] + (//module.define var_name {.#Right [export? Any []]}))] (//module.with_module 0 dependent_module (do ! [_ (if import? @@ -79,7 +79,7 @@ (//type.with_inference (_primitive.phase archive.empty (code.local_identifier var_name))))) (phase.result _primitive.state) - (case> (^ {#try.Success [inferredT {#////analysis.Reference (////reference.local var)}]}) + (case> (^ {try.#Success [inferredT {////analysis.#Reference (////reference.local var)}]}) (and (type\= expectedT inferredT) (n.= 0 var)) @@ -88,12 +88,12 @@ (_.test "Can analyse definition (in the same module)." (let [def_name [def_module var_name]] (|> (do phase.monad - [_ (//module.define var_name {#.Right [false expectedT []]})] + [_ (//module.define var_name {.#Right [false expectedT []]})] (//type.with_inference (_primitive.phase archive.empty (code.identifier def_name)))) (//module.with_module 0 def_module) (phase.result _primitive.state) - (case> (^ {#try.Success [_ inferredT {#////analysis.Reference (////reference.constant constant_name)}]}) + (case> (^ {try.#Success [_ inferredT {////analysis.#Reference (////reference.constant constant_name)}]}) (and (type\= expectedT inferredT) (name\= def_name constant_name)) 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 9d276e070..9d3665427 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 @@ -43,7 +43,7 @@ [(def: .public <name> (All (_ a) (-> (Operation a) Bit)) (|>> (phase.result _primitive.state) - (case> {#try.Success _} + (case> {try.#Success _} <on_success> _ @@ -59,8 +59,8 @@ expected//lefts (if expected//right? (-- tag) tag) - actual//right? (value@ #////analysis.right? variant) - actual//lefts (value@ #////analysis.lefts variant)] + actual//right? (value@ ////analysis.#right? variant) + actual//lefts (value@ ////analysis.#lefts variant)] (and (n.= expected//lefts actual//lefts) (bit\= expected//right? @@ -71,7 +71,7 @@ (|> analysis (//type.with_type type) (phase.result _primitive.state) - (case> (^ {#try.Success (////analysis.variant variant)}) + (case> (^ {try.#Success (////analysis.variant variant)}) (check_sum' tag size variant) _ @@ -89,7 +89,7 @@ (with_tags module tags variantT) (//type.with_type expectedT) (phase.result _primitive.state) - (case> (^ {#try.Success [_ (////analysis.variant variant)]}) + (case> (^ {try.#Success [_ (////analysis.variant variant)]}) (check_sum' tag (list.size tags) variant) _ @@ -111,7 +111,7 @@ (with_tags module tags recordT) (//type.with_type expectedT) (phase.result _primitive.state) - (case> {#try.Success [_ productA]} + (case> {try.#Success [_ productA]} (correct_size? size productA) _ @@ -128,7 +128,7 @@ [valueT valueC] (maybe.trusted (list.item choice primitives)) +size (++ size) +primitives (list.together (list (list.first choice primitives) - (list [{#.Parameter 1} +valueC]) + (list [{.#Parameter 1} +valueC]) (list.after choice primitives))) [+valueT +valueC] (maybe.trusted (list.item +choice +primitives)) +variantT (type.variant (list\each product.left +primitives))]] @@ -145,7 +145,7 @@ (//type.with_type varT (/.sum _primitive.phase choice archive.empty valueC))) (phase.result _primitive.state) - (case> (^ {#try.Success (////analysis.variant variant)}) + (case> (^ {try.#Success (////analysis.variant variant)}) (check_sum' choice size variant) _ @@ -178,7 +178,7 @@ .let [tupleT (type.tuple (list\each product.left primitives)) [singletonT singletonC] (|> primitives (list.item choice) maybe.trusted) +primitives (list.together (list (list.first choice primitives) - (list [{#.Parameter 1} +valueC]) + (list [{.#Parameter 1} +valueC]) (list.after choice primitives))) +tupleT (type.tuple (list\each product.left +primitives))]] (<| (_.context (%.name (name_of /.product))) @@ -187,7 +187,7 @@ (|> (//type.with_type tupleT (/.product archive.empty _primitive.phase (list\each product.right primitives))) (phase.result _primitive.state) - (case> {#try.Success tupleA} + (case> {try.#Success tupleA} (correct_size? size tupleA) _ @@ -196,7 +196,7 @@ (|> (//type.with_inference (/.product archive.empty _primitive.phase (list\each product.right primitives))) (phase.result _primitive.state) - (case> {#try.Success [_type tupleA]} + (case> {try.#Success [_type tupleA]} (and (check.subsumes? tupleT _type) (correct_size? size tupleA)) @@ -214,7 +214,7 @@ (//type.with_type varT (/.product archive.empty _primitive.phase (list\each product.right primitives)))) (phase.result _primitive.state) - (case> {#try.Success tupleA} + (case> {try.#Success tupleA} (correct_size? size tupleA) _ @@ -238,8 +238,8 @@ primitives (r.list size _primitive.primitive) module_name (r.unicode 5) type_name (r.unicode 5) - .let [with_name (|>> {#.Named [module_name type_name]}) - varT {#.Parameter 1} + .let [with_name (|>> {.#Named [module_name type_name]}) + varT {.#Parameter 1} primitivesT (list\each product.left primitives) [choiceT choiceC] (maybe.trusted (list.item choice primitives)) [other_choiceT other_choiceC] (maybe.trusted (list.item other_choice primitives)) @@ -283,17 +283,17 @@ module_name (r.unicode 5) type_name (r.unicode 5) choice (|> r.nat (\ ! each (n.% size))) - .let [varT {#.Parameter 1} + .let [varT {.#Parameter 1} tagsC (list\each (|>> [module_name] code.tag) tags) primitivesT (list\each product.left primitives) primitivesC (list\each product.right primitives) - monoT {#.Named [module_name type_name] (type.tuple primitivesT)} + monoT {.#Named [module_name type_name] (type.tuple primitivesT)} recordC (list.zipped/2 tagsC primitivesC) polyT (|> (type.tuple (list.together (list (list.first choice primitivesT) (list varT) (list.after (++ choice) primitivesT)))) (type.univ_q 1) - {#.Named [module_name type_name]})]] + {.#Named [module_name type_name]})]] (<| (_.context (%.name (name_of /.record))) (_.test "Can infer." (|> (/.record archive.empty _primitive.phase recordC) 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 166aa24f6..528cc4ca9 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 @@ -39,10 +39,10 @@ (////type.with_type output_type (_primitive.phase archive.empty (` ((~ (code.text procedure)) (~+ params)))))) (phase.result _primitive.state) - (case> {#try.Success _} + (case> {try.#Success _} <success> - {#try.Failure _} + {try.#Failure _} <failure>)))] [check_success+ true false] 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 2c59172e6..9ef9354cf 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 @@ -46,8 +46,8 @@ temp (|> random.nat (\ ! each (n.% 100))) .let [maskA (analysis.control/case [maskedA - [[{#analysis.Bind temp} - {#analysis.Reference (////reference.local temp)}] + [[{analysis.#Bind temp} + {analysis.#Reference (////reference.local temp)}] (list)]])]] (_.cover [/.synthesize_masking] (|> maskA @@ -64,14 +64,14 @@ outputA //primitive.primitive .let [letA (analysis.control/case [inputA - [[{#analysis.Bind registerA} + [[{analysis.#Bind registerA} outputA] (list)]])]] (_.cover [/.synthesize_let] (|> letA (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (case> (^ {#try.Success (synthesis.branch/let [inputS registerS outputS])}) + (case> (^ {try.#Success (synthesis.branch/let [inputS registerS outputS])}) (and (n.= registerA registerS) (//primitive.corresponds? inputA inputS) (//primitive.corresponds? outputA outputS)) @@ -87,10 +87,10 @@ thenA //primitive.primitive elseA //primitive.primitive .let [thenB (: Branch - [{#analysis.Simple {#analysis.Bit true}} + [{analysis.#Simple {analysis.#Bit true}} thenA]) elseB (: Branch - [{#analysis.Simple {#analysis.Bit false}} + [{analysis.#Simple {analysis.#Bit false}} elseA]) ifA (if then|else (analysis.control/case [inputA [thenB (list elseB)]]) @@ -99,7 +99,7 @@ (|> ifA (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (case> (^ {#try.Success (synthesis.branch/if [inputS thenS elseS])}) + (case> (^ {try.#Success (synthesis.branch/if [inputS thenS elseS])}) (and (//primitive.corresponds? inputA inputS) (//primitive.corresponds? thenA thenS) (//primitive.corresponds? elseA elseS)) @@ -113,8 +113,8 @@ [lefts (|> random.nat (\ ! each (n.% 10))) right? random.bit] (in (if right? - {#.Right lefts} - {#.Left lefts})))) + {.#Right lefts} + {.#Left lefts})))) (def: random_path (Random (analysis.Tuple synthesis.Member)) @@ -129,16 +129,16 @@ [@member random.nat] (in [(list\mix (function (_ member inner) (case member - {#.Left lefts} + {.#Left lefts} (analysis.pattern/tuple (list\composite (list.repeated lefts (analysis.pattern/unit)) (list inner (analysis.pattern/unit)))) - {#.Right lefts} + {.#Right lefts} (analysis.pattern/tuple (list\composite (list.repeated (++ lefts) (analysis.pattern/unit)) (list inner))))) - {#analysis.Bind @member} + {analysis.#Bind @member} (list.reversed path)) @member]))) @@ -152,13 +152,13 @@ pathA ..random_path [pattern @member] (get_pattern pathA) .let [getA (analysis.control/case [recordA [[pattern - {#analysis.Reference (////reference.local @member)}] + {analysis.#Reference (////reference.local @member)}] (list)]])]] (_.cover [/.synthesize_get] (|> getA (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (case> (^ {#try.Success (synthesis.branch/get [pathS recordS])}) + (case> (^ {try.#Success (synthesis.branch/get [pathS recordS])}) (and (\ (list.equivalence (sum.equivalence n.= n.=)) = pathA pathS) (//primitive.corresponds? recordA recordS)) @@ -171,14 +171,14 @@ [test random.bit then random.nat else random.nat] - (in [{#synthesis.Alt {#synthesis.Seq (synthesis.path/bit test) - {#synthesis.Then (synthesis.i64 (.i64 then))}} - {#synthesis.Seq (synthesis.path/bit (not test)) - {#synthesis.Then (synthesis.i64 (.i64 else))}}} - [[#analysis.when (analysis.pattern/bit test) - #analysis.then (analysis.nat then)] - (list [#analysis.when (analysis.pattern/bit (not test)) - #analysis.then (analysis.nat else)])]]))) + (in [{synthesis.#Alt {synthesis.#Seq (synthesis.path/bit test) + {synthesis.#Then (synthesis.i64 (.i64 then))}} + {synthesis.#Seq (synthesis.path/bit (not test)) + {synthesis.#Then (synthesis.i64 (.i64 else))}}} + [[analysis.#when (analysis.pattern/bit test) + analysis.#then (analysis.nat then)] + (list [analysis.#when (analysis.pattern/bit (not test)) + analysis.#then (analysis.nat else)])]]))) (def: (random_five hash random_element) (All (_ a) (-> (Hash a) (Random a) (Random [a a a a a]))) @@ -197,17 +197,17 @@ (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 - {#synthesis.Seq (<path> test/0) {#synthesis.Then (<synthesis> body/0)}} - {#synthesis.Seq (<path> test/1) {#synthesis.Then (<synthesis> body/1)}} - {#synthesis.Seq (<path> test/2) {#synthesis.Then (<synthesis> body/2)}} - {#synthesis.Seq (<path> test/3) {#synthesis.Then (<synthesis> body/3)}} - {#synthesis.Seq (<path> test/4) {#synthesis.Then (<synthesis> body/4)}}) - [[#analysis.when (<pattern> test/0) #analysis.then (<analysis> body/0)] - (list [#analysis.when (<pattern> test/1) #analysis.then (<analysis> body/1)] - [#analysis.when (<pattern> test/2) #analysis.then (<analysis> body/2)] - [#analysis.when (<pattern> test/3) #analysis.then (<analysis> body/3)] - [#analysis.when (<pattern> test/4) #analysis.then (<analysis> body/4)])]])))] + (in [($_ {synthesis.#Alt} + {synthesis.#Seq (<path> test/0) {synthesis.#Then (<synthesis> body/0)}} + {synthesis.#Seq (<path> test/1) {synthesis.#Then (<synthesis> body/1)}} + {synthesis.#Seq (<path> test/2) {synthesis.#Then (<synthesis> body/2)}} + {synthesis.#Seq (<path> test/3) {synthesis.#Then (<synthesis> body/3)}} + {synthesis.#Seq (<path> test/4) {synthesis.#Then (<synthesis> body/4)}}) + [[analysis.#when (<pattern> test/0) analysis.#then (<analysis> body/0)] + (list [analysis.#when (<pattern> test/1) analysis.#then (<analysis> body/1)] + [analysis.#when (<pattern> test/2) analysis.#then (<analysis> body/2)] + [analysis.#when (<pattern> test/3) analysis.#then (<analysis> body/3)] + [analysis.#when (<pattern> test/4) analysis.#then (<analysis> body/4)])]])))] [random_nat n.hash random.nat (|>> .i64 synthesis.path/i64) (|>> .i64 synthesis.i64) analysis.pattern/nat analysis.nat] [random_int int.hash random.int (|>> .i64 synthesis.path/i64) (|>> .i64 synthesis.i64) analysis.pattern/int analysis.int] @@ -235,19 +235,19 @@ [body/0 body/1 body/2 body/3 body/4] (random_five frac.hash random.frac) .let [path (: (-> Nat Bit Text Frac Path) (function (_ lefts right? value body) - ($_ #synthesis.Seq + ($_ {synthesis.#Seq} (synthesis.path/side (if right? - {#.Right lefts} - {#.Left lefts})) + {.#Right lefts} + {.#Left lefts})) (synthesis.path/text value) - {#synthesis.Then (synthesis.f64 body)}))) + {synthesis.#Then (synthesis.f64 body)}))) branch (: (-> Nat Bit Text Frac Branch) (function (_ lefts right? value body) - [#analysis.when (analysis.pattern/variant [#analysis.lefts lefts - #analysis.right? right? - #analysis.value (analysis.pattern/text value)]) - #analysis.then (analysis.frac body)]))]] - (in [($_ #synthesis.Alt + [analysis.#when (analysis.pattern/variant [analysis.#lefts lefts + analysis.#right? right? + analysis.#value (analysis.pattern/text value)]) + analysis.#then (analysis.frac body)]))]] + (in [($_ {synthesis.#Alt} (path lefts/0 false value/0 body/0) (path lefts/1 false value/1 body/1) (path lefts/2 false value/2 body/2) @@ -274,34 +274,34 @@ .let [path (: (-> Nat Bit Text Frac Path) (function (_ lefts right? value body) (if right? - ($_ #synthesis.Seq + ($_ {synthesis.#Seq} (synthesis.path/member (if right? - {#.Right lefts} - {#.Left lefts})) + {.#Right lefts} + {.#Left lefts})) (synthesis.path/text value) - {#synthesis.Then (synthesis.f64 body)}) - ($_ #synthesis.Seq + {synthesis.#Then (synthesis.f64 body)}) + ($_ {synthesis.#Seq} (synthesis.path/member (if right? - {#.Right lefts} - {#.Left lefts})) + {.#Right lefts} + {.#Left lefts})) (synthesis.path/text value) - #synthesis.Pop - {#synthesis.Then (synthesis.f64 body)})))) + {synthesis.#Pop} + {synthesis.#Then (synthesis.f64 body)})))) branch (: (-> Nat Bit Text Frac Branch) (function (_ lefts right? value body) - [#analysis.when (if right? + [analysis.#when (if right? (analysis.pattern/tuple (list\composite (list.repeated (++ lefts) (analysis.pattern/unit)) (list (analysis.pattern/text value)))) (analysis.pattern/tuple ($_ list\composite (list.repeated lefts (analysis.pattern/unit)) (list (analysis.pattern/text value) (analysis.pattern/unit))))) - #analysis.then (analysis.frac body)]))]] + analysis.#then (analysis.frac body)]))]] (in [(list\mix (function (_ left right) - {#synthesis.Alt left right}) + {synthesis.#Alt left right}) (path (++ mid_size) true value/last body/last) (|> (list.zipped/2 value/mid body/mid) - {#.Item [value/first body/first]} + {.#Item [value/first body/first]} list.enumeration (list\each (function (_ [lefts' [value body]]) (path lefts' false value body))) @@ -333,7 +333,7 @@ (_.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])}) + (case> (^ {try.#Success (synthesis.branch/case [actual_input actual_path])}) (and (\ synthesis.equivalence = expected_input actual_input) (\ synthesis.path_equivalence = expected_path actual_path)) 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 687fc849c..dcc48735f 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 @@ -39,24 +39,24 @@ (def: (n_function loop? arity body) (-> Bit Arity Synthesis Synthesis) (synthesis.function/abstraction - [#synthesis.environment (list) - #synthesis.arity arity - #synthesis.body (if loop? + [synthesis.#environment (list) + synthesis.#arity arity + synthesis.#body (if loop? (synthesis.loop/scope - [#synthesis.start 1 - #synthesis.inits (list) - #synthesis.iteration body]) + [synthesis.#start 1 + synthesis.#inits (list) + synthesis.#iteration body]) body)])) (def: (n_abstraction arity body) (-> Arity Analysis Analysis) (list\mix (function (_ arity_1 body) (case arity_1 - 0 {#analysis.Function (list) body} - _ {#analysis.Function ($_ list\composite - (list\each (|>> #variable.Foreign) + 0 {analysis.#Function (list) body} + _ {analysis.#Function ($_ list\composite + (list\each (|>> {variable.#Foreign}) (list.indices arity_1)) - (list {#variable.Local 1})) + (list {variable.#Local 1})) body})) body (list.reversed (list.indices arity)))) @@ -120,13 +120,13 @@ [loop? expected_value actual_value] (random_value false)] (in [loop? (synthesis.variant - [#analysis.lefts lefts - #analysis.right? right? - #analysis.value expected_value]) + [analysis.#lefts lefts + analysis.#right? right? + analysis.#value expected_value]) (analysis.variant - [#analysis.lefts lefts - #analysis.right? right? - #analysis.value actual_value])]))) + [analysis.#lefts lefts + analysis.#right? right? + analysis.#value actual_value])]))) (def: (random_tuple random_value output?) (-> Scenario Scenario) @@ -151,8 +151,8 @@ (in [(not (n.= 0 register)) (synthesis.variable/local register) (if (n.= arity register) - {#analysis.Reference (reference.local 1)} - {#analysis.Reference (reference.foreign register)})]))) + {analysis.#Reference (reference.local 1)} + {analysis.#Reference (reference.foreign register)})]))) (def: (random_constant output?) Scenario @@ -161,7 +161,7 @@ short (random.unicode 1)] (in [true (synthesis.constant [module short]) - {#analysis.Reference (reference.constant [module short])}]))) + {analysis.#Reference (reference.constant [module short])}]))) (def: (random_reference arity output?) (-> Arity Scenario) @@ -180,8 +180,8 @@ lefts (|> random.nat (\ ! each (n.% 10))) right? random.bit .let [side|member (if right? - {#.Right lefts} - {#.Left lefts})]] + {.#Right lefts} + {.#Left lefts})]] (in [(and loop?_input loop?_output) (synthesis.branch/case [expected_input @@ -211,30 +211,30 @@ (synthesis.path/bind (++ arity)) synthesis.path/pop (synthesis.path/then expected_output))))]) - {#analysis.Case actual_input - [[#analysis.when (analysis.pattern/unit) - #analysis.then actual_output] - (list [#analysis.when (analysis.pattern/bit bit_test) - #analysis.then actual_output] - [#analysis.when (analysis.pattern/nat (.nat i64_test)) - #analysis.then actual_output] - [#analysis.when (analysis.pattern/frac f64_test) - #analysis.then actual_output] - [#analysis.when (analysis.pattern/text text_test) - #analysis.then actual_output] - [#analysis.when {#analysis.Bind 2} - #analysis.then actual_output] - [#analysis.when (analysis.pattern/variant - [#analysis.lefts lefts - #analysis.right? right? - #analysis.value {#analysis.Bind 2}]) - #analysis.then actual_output] - [#analysis.when (analysis.pattern/tuple + {analysis.#Case actual_input + [[analysis.#when (analysis.pattern/unit) + analysis.#then actual_output] + (list [analysis.#when (analysis.pattern/bit bit_test) + analysis.#then actual_output] + [analysis.#when (analysis.pattern/nat (.nat i64_test)) + analysis.#then actual_output] + [analysis.#when (analysis.pattern/frac f64_test) + analysis.#then actual_output] + [analysis.#when (analysis.pattern/text text_test) + analysis.#then actual_output] + [analysis.#when {analysis.#Bind 2} + analysis.#then actual_output] + [analysis.#when (analysis.pattern/variant + [analysis.#lefts lefts + analysis.#right? right? + analysis.#value {analysis.#Bind 2}]) + analysis.#then actual_output] + [analysis.#when (analysis.pattern/tuple (list\composite (list.repeated lefts (analysis.pattern/unit)) (if right? - (list (analysis.pattern/unit) {#analysis.Bind 2}) - (list {#analysis.Bind 2} (analysis.pattern/unit))))) - #analysis.then actual_output])]}]))) + (list (analysis.pattern/unit) {analysis.#Bind 2}) + (list {analysis.#Bind 2} (analysis.pattern/unit))))) + analysis.#then actual_output])]}]))) (def: (random_let arity random_value output?) (-> Arity Scenario Scenario) @@ -246,9 +246,9 @@ (synthesis.branch/let [expected_input (++ arity) expected_output]) - {#analysis.Case actual_input - [[#analysis.when {#analysis.Bind 2} - #analysis.then actual_output] + {analysis.#Case actual_input + [[analysis.#when {analysis.#Bind 2} + analysis.#then actual_output] (list)]}]))) (def: (random_if random_value output?) @@ -265,16 +265,16 @@ expected_then expected_else]) (if flip? - {#analysis.Case actual_test - [[#analysis.when (analysis.pattern/bit false) - #analysis.then actual_else] - (list [#analysis.when (analysis.pattern/bit true) - #analysis.then actual_then])]} - {#analysis.Case actual_test - [[#analysis.when (analysis.pattern/bit true) - #analysis.then actual_then] - (list [#analysis.when (analysis.pattern/bit false) - #analysis.then actual_else])]})]))) + {analysis.#Case actual_test + [[analysis.#when (analysis.pattern/bit false) + analysis.#then actual_else] + (list [analysis.#when (analysis.pattern/bit true) + analysis.#then actual_then])]} + {analysis.#Case actual_test + [[analysis.#when (analysis.pattern/bit true) + analysis.#then actual_then] + (list [analysis.#when (analysis.pattern/bit false) + analysis.#then actual_else])]})]))) (def: (random_get random_value output?) (-> Scenario Scenario) @@ -284,16 +284,16 @@ [loop?_record expected_record actual_record] (random_value false)] (in [loop?_record (synthesis.branch/get [(list (if right? - {#.Right lefts} - {#.Left lefts})) + {.#Right lefts} + {.#Left lefts})) expected_record]) - {#analysis.Case actual_record - [[#analysis.when (analysis.pattern/tuple + {analysis.#Case actual_record + [[analysis.#when (analysis.pattern/tuple (list\composite (list.repeated lefts (analysis.pattern/unit)) (if right? - (list (analysis.pattern/unit) {#analysis.Bind 2}) - (list {#analysis.Bind 2} (analysis.pattern/unit))))) - #analysis.then {#analysis.Reference (reference.local 2)}] + (list (analysis.pattern/unit) {analysis.#Bind 2}) + (list {analysis.#Bind 2} (analysis.pattern/unit))))) + analysis.#then {analysis.#Reference (reference.local 2)}] (list)]}]))) (def: (random_branch arity random_value output?) @@ -309,7 +309,7 @@ [resets (random.list arity (random_value false))] (in [true (synthesis.loop/recur (list\each (|>> product.right product.left) resets)) - (analysis.apply [{#analysis.Reference (case arity + (analysis.apply [{analysis.#Reference (case arity 1 (reference.local 0) _ (reference.foreign 0))} (list\each (|>> product.right product.right) resets)])]))) @@ -324,9 +324,9 @@ true (list\each product.left resets)) (synthesis.loop/scope - [#synthesis.start (++ arity) - #synthesis.inits (list\each (|>> product.right product.left) resets) - #synthesis.iteration expected_output]) + [synthesis.#start (++ arity) + synthesis.#inits (list\each (|>> product.right product.left) resets) + synthesis.#iteration expected_output]) (analysis.apply [(..n_abstraction arity actual_output) (list\each (|>> product.right product.right) resets)])]))) @@ -345,18 +345,18 @@ [[loop?_output expected_output actual_output] (..random_nat output?) arity (|> random.nat (\ ! each (|>> (n.% 5) ++))) .let [environment ($_ list\composite - (list\each (|>> #variable.Foreign) + (list\each (|>> {variable.#Foreign}) (list.indices arity)) - (list {#variable.Local 1}))]] + (list {variable.#Local 1}))]] (in [true (synthesis.function/abstraction - [#synthesis.environment environment - #synthesis.arity 1 - #synthesis.body (synthesis.loop/scope - [#synthesis.start 1 - #synthesis.inits (list) - #synthesis.iteration expected_output])]) - {#analysis.Function environment + [synthesis.#environment environment + synthesis.#arity 1 + synthesis.#body (synthesis.loop/scope + [synthesis.#start 1 + synthesis.#inits (list) + synthesis.#iteration expected_output])]) + {analysis.#Function environment actual_output}]))) (def: (random_apply random_value output?) @@ -401,8 +401,8 @@ (in [(and loop?_first loop?_second loop?_third) - {#synthesis.Extension name (list expected_first expected_second expected_third)} - {#analysis.Extension name (list actual_first actual_second actual_third)}]))) + {synthesis.#Extension name (list expected_first expected_second expected_third)} + {analysis.#Extension name (list actual_first actual_second actual_third)}]))) (def: (random_body arity) (-> Arity Scenario) @@ -432,7 +432,7 @@ (|> input (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ synthesis.equivalence = expected actual))))))) (def: application @@ -445,14 +445,14 @@ (and (|> (analysis.apply [funcA argsA]) (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (!expect (^multi (^ {#try.Success (synthesis.function/apply [funcS argsS])}) + (!expect (^multi (^ {try.#Success (synthesis.function/apply [funcS argsS])}) (and (//primitive.corresponds? funcA funcS) (list.every? (product.uncurried //primitive.corresponds?) (list.zipped/2 argsA argsS)))))) (|> (analysis.apply [funcA (list)]) (//.phase archive.empty) (phase.result [///bundle.empty synthesis.init]) - (!expect (^multi {#try.Success funcS} + (!expect (^multi {try.#Success funcS} (//primitive.corresponds? funcA funcS)))))))) (def: .public test 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 c27d08c14..f34540102 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 @@ -57,8 +57,8 @@ (let [local (do [! random.monad] [register (\ ! each (|>> (n.% arity) ++) random.nat)] (in [next - [{#variable.Local (/.register_optimization offset register)} - {#variable.Local register}]]))] + [{variable.#Local (/.register_optimization offset register)} + {variable.#Local register}]]))] (case offset 0 local _ ($_ random.either @@ -66,8 +66,8 @@ (do [! random.monad] [foreign (\ ! each (n.% offset) random.nat)] (in [next - [{#variable.Local foreign} - {#variable.Foreign foreign}]])))))) + [{variable.#Local foreign} + {variable.#Foreign foreign}]])))))) (def: (reference offset arity next) (Scenario Synthesis) @@ -92,13 +92,13 @@ [next [valueE valueA]] (..reference offset arity next)] (in [next [(//.variant - [#analysis.lefts lefts - #analysis.right? right? - #analysis.value valueE]) + [analysis.#lefts lefts + analysis.#right? right? + analysis.#value valueE]) (//.variant - [#analysis.lefts lefts - #analysis.right? right? - #analysis.value valueA])]])) + [analysis.#lefts lefts + analysis.#right? right? + analysis.#value valueA])]])) (do [! random.monad] [[next [leftE leftA]] (..reference offset arity next) [next [rightE rightA]] (..reference offset arity next)] @@ -204,13 +204,13 @@ [next [iterationE iterationA]] (..reference offset arity next)] (in [next [(//.loop/scope - [#//.start (/.register_optimization offset next) - #//.inits (list firstE secondE) - #//.iteration iterationE]) + [//.#start (/.register_optimization offset next) + //.#inits (list firstE secondE) + //.#iteration iterationE]) (//.loop/scope - [#//.start next - #//.inits (list firstA secondA) - #//.iteration iterationA])]])) + [//.#start next + //.#inits (list firstA secondA) + //.#iteration iterationA])]])) )) (def: (function offset arity next) @@ -223,13 +223,13 @@ [next [bodyE bodyA]] (..primitive 0 arity next)] (in [next [(//.function/abstraction - [#//.environment (list firstE secondE) - #//.arity arity - #//.body bodyE]) + [//.#environment (list firstE secondE) + //.#arity arity + //.#body bodyE]) (//.function/abstraction - [#//.environment (list firstA secondA) - #//.arity arity - #//.body bodyA])]])) + [//.#environment (list firstA secondA) + //.#arity arity + //.#body bodyA])]])) )) (def: (control offset arity next) @@ -248,8 +248,8 @@ [next [secondE secondA]] (..reference offset arity next) [next [thirdE thirdA]] (..reference offset arity next)] (in [next - [{#//.Extension name (list firstE secondE thirdE)} - {#//.Extension name (list firstA secondA thirdA)}]]))) + [{//.#Extension name (list firstE secondE thirdE)} + {//.#Extension name (list firstA secondA thirdA)}]]))) (def: (scenario offset arity next) (Scenario Synthesis) @@ -274,12 +274,12 @@ [_ [expected iteration]] (..scenario expected_offset arity 0)] (_.cover [/.Transform /.optimization /.register_optimization] (case (/.optimization true expected_offset expected_inits - [#//.environment (|> expected_offset + [//.#environment (|> expected_offset list.indices - (list\each (|>> #variable.Local))) - #//.arity arity - #//.body iteration]) - (^ {#.Some (//.loop/scope [actual_offset actual_inits + (list\each (|>> {variable.#Local}))) + //.#arity arity + //.#body iteration]) + (^ {.#Some (//.loop/scope [actual_offset actual_inits actual])}) (and (n.= expected_offset actual_offset) 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 79e26221b..107cae01d 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 @@ -39,24 +39,24 @@ r.rev r.frac (r.unicode 5)))] - (in {#////analysis.Primitive primitive}))) + (in {////analysis.#Primitive primitive}))) (def: .public (corresponds? analysis synthesis) (-> Analysis Synthesis Bit) (`` (case [analysis synthesis] (~~ (template [<analysis> <post_analysis> <synthesis> <post_synthesis>] - [[{#////analysis.Primitive (<analysis> expected)} - {#////synthesis.Primitive (<synthesis> actual)}] + [[{////analysis.#Primitive {<analysis> expected}} + {////synthesis.#Primitive {<synthesis> actual}}] (same? (|> expected <post_analysis>) (|> actual <post_synthesis>))] - [#////analysis.Unit (:as Text) #////synthesis.Text (|>)] - [#////analysis.Bit (|>) #////synthesis.Bit (|>)] - [#////analysis.Nat .i64 #////synthesis.I64 .i64] - [#////analysis.Int .i64 #////synthesis.I64 .i64] - [#////analysis.Rev .i64 #////synthesis.I64 .i64] - [#////analysis.Frac (|>) #////synthesis.F64 (|>)] - [#////analysis.Text (|>) #////synthesis.Text (|>)] + [////analysis.#Unit (:as Text) ////synthesis.#Text (|>)] + [////analysis.#Bit (|>) ////synthesis.#Bit (|>)] + [////analysis.#Nat .i64 ////synthesis.#I64 .i64] + [////analysis.#Int .i64 ////synthesis.#I64 .i64] + [////analysis.#Rev .i64 ////synthesis.#I64 .i64] + [////analysis.#Frac (|>) ////synthesis.#F64 (|>)] + [////analysis.#Text (|>) ////synthesis.#Text (|>)] )) (^ [(////analysis.tuple expected) @@ -72,25 +72,25 @@ (def: .public test Test - (<| (_.context (%.name (name_of #////synthesis.Primitive))) + (<| (_.context (%.name (name_of ////synthesis.#Primitive))) (`` ($_ _.and (~~ (template [<analysis> <synthesis> <generator>] [(do r.monad [expected <generator>] (_.test (%.name (name_of <synthesis>)) - (|> {#////analysis.Primitive (<analysis> expected)} + (|> {////analysis.#Primitive {<analysis> expected}} (//.phase archive.empty) (phase.result [///bundle.empty ////synthesis.init]) - (case> {#try.Success {#////synthesis.Primitive (<synthesis> actual)}} + (case> {try.#Success {////synthesis.#Primitive {<synthesis> actual}}} (same? expected actual) _ false))))] - [#////analysis.Unit #////synthesis.Text (r\in ////synthesis.unit)] - [#////analysis.Bit #////synthesis.Bit r.bit] - [#////analysis.Nat #////synthesis.I64 (r\each .i64 r.nat)] - [#////analysis.Int #////synthesis.I64 (r\each .i64 r.int)] - [#////analysis.Rev #////synthesis.I64 (r\each .i64 r.rev)] - [#////analysis.Frac #////synthesis.F64 r.frac] - [#////analysis.Text #////synthesis.Text (r.unicode 5)])))))) + [////analysis.#Unit ////synthesis.#Text (r\in ////synthesis.unit)] + [////analysis.#Bit ////synthesis.#Bit r.bit] + [////analysis.#Nat ////synthesis.#I64 (r\each .i64 r.nat)] + [////analysis.#Int ////synthesis.#I64 (r\each .i64 r.int)] + [////analysis.#Rev ////synthesis.#I64 (r\each .i64 r.rev)] + [////analysis.#Frac ////synthesis.#F64 r.frac] + [////analysis.#Text ////synthesis.#Text (r.unicode 5)])))))) 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 c9334a880..898187283 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 @@ -47,7 +47,7 @@ (|> (////analysis.variant [lefts right? memberA]) (//.phase archive.empty) (phase.result [///bundle.empty ////synthesis.init]) - (case> (^ {#try.Success (////synthesis.variant [leftsS right?S valueS])}) + (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)) @@ -65,7 +65,7 @@ (|> (////analysis.tuple membersA) (//.phase archive.empty) (phase.result [///bundle.empty ////synthesis.init]) - (case> (^ {#try.Success (////synthesis.tuple membersS)}) + (case> (^ {try.#Success (////synthesis.tuple membersS)}) (and (n.= size (list.size membersS)) (list.every? (product.uncurried //primitive.corresponds?) (list.zipped/2 membersA membersS))) @@ -75,7 +75,7 @@ (def: .public test Test - (<| (_.context (%.name (name_of #////synthesis.Structure))) + (<| (_.context (%.name (name_of ////synthesis.#Structure))) ($_ _.and ..variant ..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 85fef40c0..dbfa2ea78 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 @@ -74,14 +74,14 @@ (dictionary.size (value@ #necessary context)))] [expected_output actual_output] (scenario (revised@ #redundants ++ context))] (in [(synthesis.branch/case [expected_input - {#synthesis.Seq #synthesis.Pop - {#synthesis.Then expected_output}}]) + {synthesis.#Seq {synthesis.#Pop} + {synthesis.#Then expected_output}}]) (if let? (synthesis.branch/let [actual_input fake_register actual_output]) (synthesis.branch/case [actual_input - {#synthesis.Seq {#synthesis.Bind fake_register} - {#synthesis.Seq #synthesis.Pop - {#synthesis.Then actual_output}}}]))])) + {synthesis.#Seq {synthesis.#Bind fake_register} + {synthesis.#Seq {synthesis.#Pop} + {synthesis.#Then actual_output}}}]))])) (scenario context)))) (def: (variant_scenario scenario context) @@ -137,8 +137,8 @@ [lefts random.nat right? random.bit] (in (if right? - {#.Right lefts} - {#.Left lefts})))) + {.#Right lefts} + {.#Left lefts})))) (def: (get_scenario scenario context) (-> (Scenario Synthesis) (Scenario Synthesis)) @@ -160,58 +160,58 @@ (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}}])) + (in [{synthesis.#Seq {synthesis.#Pop} + {synthesis.#Then expected_then}} + {synthesis.#Seq {synthesis.#Pop} + {synthesis.#Then actual_then}}])) (do [! random.monad] [_ (in []) .let [real_register (dictionary.size (value@ #necessary context)) fake_register (n.+ (value@ #redundants context) (dictionary.size (value@ #necessary context)))] [expected_then actual_then] (scenario (revised@ #necessary (dictionary.has real_register fake_register) context))] - (in [{#synthesis.Seq {#synthesis.Bind real_register} - {#synthesis.Seq #synthesis.Pop - {#synthesis.Then expected_then}}} - {#synthesis.Seq {#synthesis.Bind fake_register} - {#synthesis.Seq #synthesis.Pop - {#synthesis.Then actual_then}}}]))) + (in [{synthesis.#Seq {synthesis.#Bind real_register} + {synthesis.#Seq {synthesis.#Pop} + {synthesis.#Then expected_then}}} + {synthesis.#Seq {synthesis.#Bind fake_register} + {synthesis.#Seq {synthesis.#Pop} + {synthesis.#Then actual_then}}}]))) ($_ random.either (~~ (template [<tag> <random>] [(do [! random.monad] [test <random> [expected_then actual_then] (scenario context)] - (in [{#synthesis.Seq {#synthesis.Test {<tag> test}} - {#synthesis.Then expected_then}} - {#synthesis.Seq {#synthesis.Test {<tag> test}} - {#synthesis.Then actual_then}}]))] + (in [{synthesis.#Seq {synthesis.#Test {<tag> test}} + {synthesis.#Then expected_then}} + {synthesis.#Seq {synthesis.#Test {<tag> test}} + {synthesis.#Then actual_then}}]))] - [#synthesis.Bit random.bit] - [#synthesis.I64 (\ ! each .i64 random.nat)] - [#synthesis.F64 random.frac] - [#synthesis.Text (random.unicode 1)] + [synthesis.#Bit random.bit] + [synthesis.#I64 (\ ! each .i64 random.nat)] + [synthesis.#F64 random.frac] + [synthesis.#Text (random.unicode 1)] ))) ($_ random.either (do [! random.monad] [side ..random_side [expected_next actual_next] (path_scenario scenario context)] - (in [{#synthesis.Seq {#synthesis.Access {#synthesis.Side side}} + (in [{synthesis.#Seq {synthesis.#Access {synthesis.#Side side}} expected_next} - {#synthesis.Seq {#synthesis.Access {#synthesis.Side side}} + {synthesis.#Seq {synthesis.#Access {synthesis.#Side side}} actual_next}])) (do [! random.monad] [member ..random_member [expected_next actual_next] (path_scenario scenario context)] - (in [{#synthesis.Seq {#synthesis.Access {#synthesis.Member member}} + (in [{synthesis.#Seq {synthesis.#Access {synthesis.#Member member}} expected_next} - {#synthesis.Seq {#synthesis.Access {#synthesis.Member member}} + {synthesis.#Seq {synthesis.#Access {synthesis.#Member member}} actual_next}]))) (do [! random.monad] [_ (in []) [expected_left actual_left] (path_scenario scenario context) [expected_right actual_right] (path_scenario scenario context)] - (in [{#synthesis.Alt expected_left expected_right} - {#synthesis.Alt actual_left actual_right}])) + (in [{synthesis.#Alt expected_left expected_right} + {synthesis.#Alt actual_left actual_right}])) ))) (def: (case_scenario scenario context) @@ -274,8 +274,8 @@ (do [! random.monad] [_ (in []) .let [registers (dictionary.entries (value@ #necessary context)) - expected_environment (list\each (|>> product.left #variable.Local) registers) - actual_environment (list\each (|>> product.right #variable.Local) registers)] + expected_environment (list\each (|>> product.left {variable.#Local}) registers) + actual_environment (list\each (|>> product.right {variable.#Local}) registers)] [expected_body actual_body] (..primitive_scenario context)] (in [(synthesis.function/abstraction [expected_environment 1 expected_body]) (synthesis.function/abstraction [actual_environment 1 actual_body])]))) @@ -330,6 +330,6 @@ [[expected input] (..scenario ..default)] (_.cover [/.optimization] (|> (/.optimization input) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ synthesis.equivalence = expected actual)))))) ))) 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 e9daa8e53..6683f7d8c 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux @@ -80,10 +80,10 @@ (case (let [source_code (%.code sample)] (/.parse "" (dictionary.empty text.hash) (text.size source_code) [location.dummy 0 source_code])) - {#.Left error} + {.#Left error} false - {#.Right [_ parsed]} + {.#Right [_ parsed]} (\ code.equivalence = parsed sample))) (do ! [other code^] @@ -92,16 +92,16 @@ source_code//size (text.size source_code)] (case (/.parse "" (dictionary.empty text.hash) source_code//size [location.dummy 0 source_code]) - {#.Left error} + {.#Left error} false - {#.Right [remaining =sample]} + {.#Right [remaining =sample]} (case (/.parse "" (dictionary.empty text.hash) source_code//size remaining) - {#.Left error} + {.#Left error} false - {#.Right [_ =other]} + {.#Right [_ =other]} (and (\ code.equivalence = sample =sample) (\ code.equivalence = other =other))))))) ))) @@ -130,10 +130,10 @@ source_code//size (text.size source_code)] (/.parse "" (dictionary.empty text.hash) source_code//size [location.dummy 0 source_code])) - {#.Left error} + {.#Left error} false - {#.Right [_ parsed]} + {.#Right [_ parsed]} (\ code.equivalence = parsed sample))) ))) diff --git a/stdlib/source/test/lux/type.lux b/stdlib/source/test/lux/type.lux index 65bcf2d81..82798e7f3 100644 --- a/stdlib/source/test/lux/type.lux +++ b/stdlib/source/test/lux/type.lux @@ -52,17 +52,17 @@ (let [pairG (random.and recur recur) un_parameterized (: (Random Type) ($_ random.either - (random\each (|>> #.Primitive) (random.and ..short (random.list 0 recur))) - (random\each (|>> #.Primitive) (random.and ..short (random.list 1 recur))) - (random\each (|>> #.Primitive) (random.and ..short (random.list 2 recur))) - (random\each (|>> #.Sum) pairG) - (random\each (|>> #.Product) pairG) - (random\each (|>> #.Function) pairG) + (random\each (|>> {.#Primitive}) (random.and ..short (random.list 0 recur))) + (random\each (|>> {.#Primitive}) (random.and ..short (random.list 1 recur))) + (random\each (|>> {.#Primitive}) (random.and ..short (random.list 2 recur))) + (random\each (|>> {.#Sum}) pairG) + (random\each (|>> {.#Product}) pairG) + (random\each (|>> {.#Function}) pairG) ))] (case parameters 0 un_parameterized _ (|> random.nat - (random\each (|>> (n.% parameters) #.Parameter)) + (random\each (|>> (n.% parameters) {.#Parameter})) (random.either un_parameterized))))))) (def: .public (random parameters) @@ -80,13 +80,13 @@ ($equivalence.spec /.equivalence (..random 0))) (do [! random.monad] - [anonymousT (random.only (|>> (case> {#.Named _ _} false + [anonymousT (random.only (|>> (case> {.#Named _ _} false _ true)) (..random 0)) name/0 ..name name/1 ..name - .let [namedT {#.Named name/0 anonymousT} - aliasedT {#.Named name/1 namedT}]] + .let [namedT {.#Named name/0 anonymousT} + aliasedT {.#Named name/1 namedT}]] ($_ _.and (_.cover [/.de_aliased] (\ /.equivalence = namedT (/.de_aliased aliasedT))) @@ -97,7 +97,7 @@ members (|> (..random 0) (random.only (function (_ type) (case type - (^or {#.Sum _} {#.Product _}) + (^or {.#Sum _} {.#Product _}) #0 _ @@ -123,16 +123,16 @@ (do maybe.monad [partial (/.applied (list Bit) Ann) full (/.applied (list Int) partial)] - (in (\ /.equivalence = full {#.Product Bit Int})))) + (in (\ /.equivalence = full {.#Product Bit Int})))) (|> (/.applied (list Bit) Text) - (case> #.None #1 _ #0)))) + (case> {.#None} #1 _ #0)))) (do [! random.monad] [size (|> random.nat (\ ! each (n.% 3))) members (monad.all ! (list.repeated size (..random 0))) extra (|> (..random 0) (random.only (function (_ type) (case type - (^or {#.Function _} {#.Apply _}) + (^or {.#Function _} {.#Apply _}) #0 _ @@ -153,7 +153,7 @@ body_type (|> (..random 0) (random.only (function (_ type) (case type - (^or {#.UnivQ _} {#.ExQ _}) + (^or {.#UnivQ _} {.#ExQ _}) #0 _ @@ -179,7 +179,7 @@ element_type (|> (..random 0) (random.only (function (_ type) (case type - (^ {#.Primitive name (list element_type)}) + (^ {.#Primitive name (list element_type)}) (not (text\= array.type_name name)) _ @@ -196,7 +196,7 @@ )) (_.cover [/.:by_example] (let [example (: (Maybe Nat) - #.None)] + {.#None})] (/\= (.type (List Nat)) (/.:by_example [a] (Maybe a) diff --git a/stdlib/source/test/lux/type/abstract.lux b/stdlib/source/test/lux/type/abstract.lux index 479b08d68..3f0e20752 100644 --- a/stdlib/source/test/lux/type/abstract.lux +++ b/stdlib/source/test/lux/type/abstract.lux @@ -28,7 +28,7 @@ [(syntax: (<syntax> []) (do meta.monad [frame <meta>] - (in (list (code.text (value@ #/.name frame))))))] + (in (list (code.text (value@ /.#name frame))))))] [current /.current] [specific (/.specific (template.text [g!Foo]))] @@ -37,12 +37,12 @@ (syntax: (with_no_active_frames [macro <code>.any]) (function (_ compiler) (let [verdict (case ((macro.expansion macro) compiler) - {#try.Failure error} + {try.#Failure error} (exception.match? /.no_active_frames error) - {#try.Success _} + {try.#Success _} false)] - {#try.Success [compiler (list (code.bit verdict))]}))) + {try.#Success [compiler (list (code.bit verdict))]}))) (with_expansions [no_current! (..with_no_active_frames (..current)) no_specific! (..with_no_active_frames (..specific))] diff --git a/stdlib/source/test/lux/type/check.lux b/stdlib/source/test/lux/type/check.lux index ed52a7d78..628b45d63 100644 --- a/stdlib/source/test/lux/type/check.lux +++ b/stdlib/source/test/lux/type/check.lux @@ -44,24 +44,24 @@ (function (_ recur) (let [pairG (random.and recur recur) quantifiedG (random.and (random\in (list)) (type' (++ num_vars))) - random_pair (random.either (random.either (random\each (|>> #.Sum) pairG) - (random\each (|>> #.Product) pairG)) - (random.either (random\each (|>> #.Function) pairG) - (random\each (|>> #.Apply) pairG))) - random_id (let [random_id (random.either (random\each (|>> #.Var) random.nat) - (random\each (|>> #.Ex) random.nat))] + random_pair (random.either (random.either (random\each (|>> {.#Sum}) pairG) + (random\each (|>> {.#Product}) pairG)) + (random.either (random\each (|>> {.#Function}) pairG) + (random\each (|>> {.#Apply}) pairG))) + random_id (let [random_id (random.either (random\each (|>> {.#Var}) random.nat) + (random\each (|>> {.#Ex}) random.nat))] (case num_vars 0 random_id - _ (random.either (random\each (|>> (n.% num_vars) (n.* 2) ++ #.Parameter) random.nat) + _ (random.either (random\each (|>> (n.% num_vars) (n.* 2) ++ {.#Parameter}) random.nat) random_id))) - random_quantified (random.either (random\each (|>> #.UnivQ) quantifiedG) - (random\each (|>> #.ExQ) quantifiedG))] + random_quantified (random.either (random\each (|>> {.#UnivQ}) quantifiedG) + (random\each (|>> {.#ExQ}) quantifiedG))] ($_ random.either - (random\each (|>> #.Primitive) (random.and ..short (random\in (list)))) + (random\each (|>> {.#Primitive}) (random.and ..short (random\in (list)))) random_pair random_id random_quantified - (random\each (|>> #.Named) (random.and ..name (type' 0))) + (random\each (|>> {.#Named}) (random.and ..name (type' 0))) ))))) (def: type @@ -71,19 +71,19 @@ (def: (valid_type? type) (-> Type Bit) (case type - {#.Primitive name params} + {.#Primitive name params} (list.every? valid_type? params) - {#.Ex id} + {.#Ex id} #1 (^template [<tag>] [{<tag> left right} (and (valid_type? left) (valid_type? right))]) - ([#.Sum] [#.Product] [#.Function]) + ([.#Sum] [.#Product] [.#Function]) - {#.Named name type'} + {.#Named name type'} (valid_type? type') _ @@ -97,7 +97,7 @@ (Comparison (All (_ a) (/.Check a))) (function (_ == left right) (case [(/.result /.fresh_context left) (/.result /.fresh_context right)] - [{#try.Success left} {#try.Success right}] + [{try.#Success left} {try.#Success right}] (== left right) _ @@ -125,25 +125,25 @@ (case (/.result /.fresh_context (: (/.Check Any) (/.failure expected))) - {#try.Success _} false - {#try.Failure actual} (same? expected actual)))) + {try.#Success _} false + {try.#Failure actual} (same? expected actual)))) (do random.monad [expected (random.ascii/upper 10)] (_.cover [/.assertion] (and (case (/.result /.fresh_context (: (/.Check Any) (/.assertion expected true))) - {#try.Success _} true - {#try.Failure actual} false) + {try.#Success _} true + {try.#Failure actual} false) (case (/.result /.fresh_context (/.assertion expected false)) - {#try.Success _} false - {#try.Failure actual} (same? expected actual))))) + {try.#Success _} false + {try.#Failure actual} (same? expected actual))))) (_.cover [/.except] (case (/.result /.fresh_context (: (/.Check Any) (/.except ..yolo []))) - {#try.Success _} false - {#try.Failure error} (exception.match? ..yolo error))) + {try.#Success _} false + {try.#Failure error} (exception.match? ..yolo error))) )) (def: var @@ -154,27 +154,27 @@ (case (/.result /.fresh_context (do /.monad [[var_id var_type] /.var] - (in (type\= var_type {#.Var var_id})))) - {#try.Success verdict} verdict - {#try.Failure error} false)) + (in (type\= var_type {.#Var var_id})))) + {try.#Success verdict} verdict + {try.#Failure error} false)) (do random.monad [nominal (random.ascii/upper 10)] (_.cover [/.bind] (case (/.result /.fresh_context (do /.monad [[var_id var_type] /.var - _ (/.bind {#.Primitive nominal (list)} + _ (/.bind {.#Primitive nominal (list)} var_id)] (in true))) - {#try.Success _} true - {#try.Failure error} false))) + {try.#Success _} true + {try.#Failure error} false))) (do random.monad [nominal (random.ascii/upper 10)] (_.cover [/.bound?] (and (|> (do /.monad [[var_id var_type] /.var pre (/.bound? var_id) - _ (/.bind {#.Primitive nominal (list)} + _ (/.bind {.#Primitive nominal (list)} var_id) post (/.bound? var_id)] (in (and (not pre) @@ -197,36 +197,36 @@ (case (/.result /.fresh_context (do /.monad [[var_id var_type] /.var - _ (/.bind {#.Primitive nominal (list)} + _ (/.bind {.#Primitive nominal (list)} var_id)] - (/.bind {#.Primitive nominal (list)} + (/.bind {.#Primitive nominal (list)} var_id))) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.cannot_rebind_var error)))) (do random.monad [nominal (random.ascii/upper 10) var_id random.nat] (_.cover [/.unknown_type_var] (case (/.result /.fresh_context - (/.bind {#.Primitive nominal (list)} + (/.bind {.#Primitive nominal (list)} var_id)) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.unknown_type_var error)))) (do random.monad [nominal (random.ascii/upper 10) - .let [expected {#.Primitive nominal (list)}]] + .let [expected {.#Primitive nominal (list)}]] (_.cover [/.peek] (and (|> (do /.monad [[var_id var_type] /.var] (/.peek var_id)) (/.result /.fresh_context) - (case> {#try.Success #.None} true + (case> {try.#Success {.#None}} true _ false)) (|> (do /.monad [[var_id var/0] /.var @@ -234,41 +234,41 @@ _ (/.check var/0 var/1)] (/.peek var_id)) (/.result /.fresh_context) - (case> {#try.Success #.None} true + (case> {try.#Success {.#None}} true _ false)) (|> (do /.monad [[var_id var_type] /.var _ (/.bind expected var_id)] (/.peek var_id)) (/.result /.fresh_context) - (case> {#try.Success {#.Some actual}} + (case> {try.#Success {.#Some actual}} (same? expected actual) _ false))))) (do random.monad [nominal (random.ascii/upper 10) - .let [expected {#.Primitive nominal (list)}]] + .let [expected {.#Primitive nominal (list)}]] (_.cover [/.read] (case (/.result /.fresh_context (do /.monad [[var_id var_type] /.var _ (/.bind expected var_id)] (/.read var_id))) - {#try.Success actual} + {try.#Success actual} (same? expected actual) _ false))) (do random.monad [nominal (random.ascii/upper 10) - .let [expected {#.Primitive nominal (list)}]] + .let [expected {.#Primitive nominal (list)}]] (_.cover [/.unbound_type_var] (case (/.result /.fresh_context (do /.monad [[var_id var_type] /.var] (/.read var_id))) - {#try.Failure error} + {try.#Failure error} (exception.match? /.unbound_type_var error) _ @@ -279,48 +279,48 @@ Test ($_ _.and (_.cover [/.fresh_context] - (and (n.= 0 (value@ #.var_counter /.fresh_context)) - (n.= 0 (value@ #.ex_counter /.fresh_context)) - (list.empty? (value@ #.var_bindings /.fresh_context)))) + (and (n.= 0 (value@ .#var_counter /.fresh_context)) + (n.= 0 (value@ .#ex_counter /.fresh_context)) + (list.empty? (value@ .#var_bindings /.fresh_context)))) (_.cover [/.context] (and (case (/.result /.fresh_context /.context) - {#try.Success actual} + {try.#Success actual} (same? /.fresh_context actual) - {#try.Failure error} + {try.#Failure error} false) (case (/.result /.fresh_context (do /.monad [_ /.var] /.context)) - {#try.Success actual} - (and (n.= 1 (value@ #.var_counter actual)) - (n.= 0 (value@ #.ex_counter actual)) - (n.= 1 (list.size (value@ #.var_bindings actual)))) + {try.#Success actual} + (and (n.= 1 (value@ .#var_counter actual)) + (n.= 0 (value@ .#ex_counter actual)) + (n.= 1 (list.size (value@ .#var_bindings actual)))) - {#try.Failure error} + {try.#Failure error} false))) (_.cover [/.existential] (case (/.result /.fresh_context (do /.monad [_ /.existential] /.context)) - {#try.Success actual} - (and (n.= 0 (value@ #.var_counter actual)) - (n.= 1 (value@ #.ex_counter actual)) - (n.= 0 (list.size (value@ #.var_bindings actual)))) + {try.#Success actual} + (and (n.= 0 (value@ .#var_counter actual)) + (n.= 1 (value@ .#ex_counter actual)) + (n.= 0 (list.size (value@ .#var_bindings actual)))) - {#try.Failure error} + {try.#Failure error} false)) )) (def: succeeds? (All (_ a) (-> (/.Check a) Bit)) (|>> (/.result /.fresh_context) - (case> {#try.Success _} + (case> {try.#Success _} true - {#try.Failure error} + {try.#Failure error} false))) (def: fails? @@ -332,7 +332,7 @@ (Random Type) (do random.monad [name (random.ascii/upper 10)] - (in {#.Primitive name (list)}))) + (in {.#Primitive name (list)}))) (def: (non_twins = random) (All (_ a) (-> (-> a a Bit) (Random a) (Random [a a]))) @@ -350,22 +350,22 @@ (def: (handles_nominal_types! name/0 name/1 parameter/0 parameter/1) (-> Text Text Type Type Bit) (let [names_matter! - (and (..succeeds? (/.check {#.Primitive name/0 (list)} - {#.Primitive name/0 (list)})) - (..fails? (/.check {#.Primitive name/0 (list)} - {#.Primitive name/1 (list)}))) + (and (..succeeds? (/.check {.#Primitive name/0 (list)} + {.#Primitive name/0 (list)})) + (..fails? (/.check {.#Primitive name/0 (list)} + {.#Primitive name/1 (list)}))) parameters_matter! - (and (..succeeds? (/.check {#.Primitive name/0 (list parameter/0)} - {#.Primitive name/0 (list parameter/0)})) - (..fails? (/.check {#.Primitive name/0 (list parameter/0)} - {#.Primitive name/0 (list parameter/1)}))) + (and (..succeeds? (/.check {.#Primitive name/0 (list parameter/0)} + {.#Primitive name/0 (list parameter/0)})) + (..fails? (/.check {.#Primitive name/0 (list parameter/0)} + {.#Primitive name/0 (list parameter/1)}))) covariant_parameters! - (and (..succeeds? (/.check {#.Primitive name/0 (list Super)} - {#.Primitive name/0 (list Sub)})) - (..fails? (/.check {#.Primitive name/0 (list Sub)} - {#.Primitive name/0 (list Super)})))] + (and (..succeeds? (/.check {.#Primitive name/0 (list Super)} + {.#Primitive name/0 (list Sub)})) + (..fails? (/.check {.#Primitive name/0 (list Sub)} + {.#Primitive name/0 (list Super)})))] (and names_matter! parameters_matter! covariant_parameters!))) @@ -373,8 +373,8 @@ (template [<assertion> <combinator>] [(def: (<assertion> name/0 name/1) (-> Text Text Bit) - (let [pair/0 {<combinator> {#.Primitive name/0 (list)} {#.Primitive name/0 (list)}} - pair/1 {<combinator> {#.Primitive name/1 (list)} {#.Primitive name/1 (list)}} + (let [pair/0 {<combinator> {.#Primitive name/0 (list)} {.#Primitive name/0 (list)}} + pair/1 {<combinator> {.#Primitive name/1 (list)} {.#Primitive name/1 (list)}} invariant! (and (..succeeds? (/.check pair/0 pair/0)) @@ -389,28 +389,28 @@ (and invariant! covariant!)))] - [handles_products! #.Product] - [handles_sums! #.Sum] + [handles_products! .#Product] + [handles_sums! .#Sum] ) (def: (handles_function_variance! nominal) (-> Type Bit) (let [functions_have_contravariant_inputs! - (..succeeds? (/.check {#.Function Sub nominal} {#.Function Super nominal})) + (..succeeds? (/.check {.#Function Sub nominal} {.#Function Super nominal})) functions_have_covariant_outputs! - (..succeeds? (/.check {#.Function nominal Super} {#.Function nominal Sub}))] + (..succeeds? (/.check {.#Function nominal Super} {.#Function nominal Sub}))] (and functions_have_contravariant_inputs! functions_have_covariant_outputs!))) (def: (verdict check) (All (_ _) (-> (/.Check _) (/.Check Bit))) (function (_ context) - {#try.Success [context (case (check context) - {#try.Success _} + {try.#Success [context (case (check context) + {try.#Success _} true - {#try.Failure _} + {try.#Failure _} false)]})) (def: (build_ring tail_size) @@ -578,9 +578,9 @@ (def: (names_do_not_affect_types! left_name right_name nominal) (-> Name Name Type Bit) - (and (..succeeds? (/.check {#.Named left_name Any} nominal)) - (..succeeds? (/.check Any {#.Named right_name nominal})) - (..succeeds? (/.check {#.Named left_name Any} {#.Named right_name nominal})))) + (and (..succeeds? (/.check {.#Named left_name Any} nominal)) + (..succeeds? (/.check Any {.#Named right_name nominal})) + (..succeeds? (/.check {.#Named left_name Any} {.#Named right_name nominal})))) ... TODO: Test all the crazy corner cases from /.check_apply (def: (handles_application! nominal/0 nominal/1) @@ -638,14 +638,14 @@ (function (_ dirty_type) (`` ($_ random.either (random\each (function (_ id) - (function.constant {#.Ex id})) + (function.constant {.#Ex id})) random.nat) (do random.monad [module (random.ascii/upper 10) short (random.ascii/upper 10) anonymousT dirty_type] (in (function (_ holeT) - {#.Named [module short] (anonymousT holeT)}))) + {.#Named [module short] (anonymousT holeT)}))) (~~ (template [<tag>] [(do random.monad [leftT dirty_type @@ -653,16 +653,16 @@ (in (function (_ holeT) {<tag> (leftT holeT) (rightT holeT)})))] - [#.Sum] - [#.Product] - [#.Function] - [#.Apply] + [.#Sum] + [.#Product] + [.#Function] + [.#Apply] )) (do [! random.monad] [name (random.ascii/upper 10) parameterT dirty_type] (in (function (_ holeT) - {#.Primitive name (list (parameterT holeT))}))) + {.#Primitive name (list (parameterT holeT))}))) (~~ (template [<tag>] [(do [! random.monad] [funcT dirty_type @@ -670,10 +670,10 @@ body random.nat] (in (function (_ holeT) {<tag> (list (funcT holeT) (argT holeT)) - {#.Parameter body}})))] + {.#Parameter body}})))] - [#.UnivQ] - [#.ExQ] + [.#UnivQ] + [.#ExQ] )) ))))) @@ -705,7 +705,7 @@ (do random.monad [primitive (random.ascii/upper 3) parameters (random.list parameters (primitive_type (-- parameters)))] - (in {#.Primitive primitive parameters}))) + (in {.#Primitive primitive parameters}))) (def: clean_type (Random Type) @@ -727,16 +727,16 @@ (do random.monad [primitive (random.ascii/upper 10) example ..clean_type] - (in (and (/.subsumes? {#.Primitive primitive (list)} - {#.Primitive primitive (list)}) - (/.subsumes? {#.Primitive primitive (list .Any)} - {#.Primitive primitive (list example)}) - (not (/.subsumes? {#.Primitive primitive (list example)} - {#.Primitive primitive (list .Any)})) - (/.subsumes? {#.Primitive primitive (list example)} - {#.Primitive primitive (list .Nothing)}) - (not (/.subsumes? {#.Primitive primitive (list .Nothing)} - {#.Primitive primitive (list example)})) + (in (and (/.subsumes? {.#Primitive primitive (list)} + {.#Primitive primitive (list)}) + (/.subsumes? {.#Primitive primitive (list .Any)} + {.#Primitive primitive (list example)}) + (not (/.subsumes? {.#Primitive primitive (list example)} + {.#Primitive primitive (list .Any)})) + (/.subsumes? {.#Primitive primitive (list example)} + {.#Primitive primitive (list .Nothing)}) + (not (/.subsumes? {.#Primitive primitive (list .Nothing)} + {.#Primitive primitive (list example)})) )))) (def: for_subsumption|sum @@ -744,14 +744,14 @@ (do random.monad [left ..clean_type right ..clean_type] - (in (and (/.subsumes? {#.Sum .Any .Any} - {#.Sum left right}) - (not (/.subsumes? {#.Sum left right} - {#.Sum .Any .Any})) - (/.subsumes? {#.Sum left right} - {#.Sum .Nothing .Nothing}) - (not (/.subsumes? {#.Sum .Nothing .Nothing} - {#.Sum left right})) + (in (and (/.subsumes? {.#Sum .Any .Any} + {.#Sum left right}) + (not (/.subsumes? {.#Sum left right} + {.#Sum .Any .Any})) + (/.subsumes? {.#Sum left right} + {.#Sum .Nothing .Nothing}) + (not (/.subsumes? {.#Sum .Nothing .Nothing} + {.#Sum left right})) )))) (def: for_subsumption|product @@ -759,14 +759,14 @@ (do random.monad [left ..clean_type right ..clean_type] - (in (and (/.subsumes? {#.Product .Any .Any} - {#.Product left right}) - (not (/.subsumes? {#.Product left right} - {#.Product .Any .Any})) - (/.subsumes? {#.Product left right} - {#.Product .Nothing .Nothing}) - (not (/.subsumes? {#.Product .Nothing .Nothing} - {#.Product left right})) + (in (and (/.subsumes? {.#Product .Any .Any} + {.#Product left right}) + (not (/.subsumes? {.#Product left right} + {.#Product .Any .Any})) + (/.subsumes? {.#Product left right} + {.#Product .Nothing .Nothing}) + (not (/.subsumes? {.#Product .Nothing .Nothing} + {.#Product left right})) )))) (def: for_subsumption|function @@ -774,12 +774,12 @@ (do random.monad [left ..clean_type right ..clean_type] - (in (and (/.subsumes? {#.Function .Nothing .Any} - {#.Function left right}) - (not (/.subsumes? {#.Function left right} - {#.Function .Nothing .Any})) - (not (/.subsumes? {#.Function .Any .Nothing} - {#.Function left right})) + (in (and (/.subsumes? {.#Function .Nothing .Any} + {.#Function left right}) + (not (/.subsumes? {.#Function left right} + {.#Function .Nothing .Any})) + (not (/.subsumes? {.#Function .Any .Nothing} + {.#Function left right})) )))) (template [<tag> <name>] @@ -791,8 +791,8 @@ (in (not (or (/.subsumes? {<tag> id} example) (/.subsumes? example {<tag> id}))))))] - [#.Var for_subsumption|variable] - [#.Ex for_subsumption|existential] + [.#Var for_subsumption|variable] + [.#Ex for_subsumption|existential] ) (def: for_subsumption|quantification+application @@ -810,10 +810,10 @@ [module (random.ascii/upper 10) short (random.ascii/upper 10) example ..clean_type] - (in (and (/.subsumes? {#.Named [module short] example} + (in (and (/.subsumes? {.#Named [module short] example} example) (/.subsumes? example - {#.Named [module short] example}) + {.#Named [module short] example}) )))) (def: for_subsumption @@ -851,8 +851,8 @@ (_.cover [/.result] (case (/.result /.fresh_context (\ /.monad in expected)) - {#try.Success actual} (same? expected actual) - {#try.Failure error} false))) + {try.#Success actual} (same? expected actual) + {try.#Failure error} false))) ..error_handling ..var ..context diff --git a/stdlib/source/test/lux/type/dynamic.lux b/stdlib/source/test/lux/type/dynamic.lux index 695caa566..0a85b8631 100644 --- a/stdlib/source/test/lux/type/dynamic.lux +++ b/stdlib/source/test/lux/type/dynamic.lux @@ -26,23 +26,23 @@ ($_ _.and (_.cover [/.:dynamic /.:static] (case (/.:static Nat (/.:dynamic expected)) - {#try.Success actual} + {try.#Success actual} (n.= expected actual) - {#try.Failure _} + {try.#Failure _} false)) (_.cover [/.wrong_type] (case (/.:static Text (/.:dynamic expected)) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.wrong_type error))) (_.cover [/.format] (case (/.format (/.:dynamic expected)) - {#try.Success actual} + {try.#Success actual} (text\= (%.nat expected) actual) - {#try.Failure _} + {try.#Failure _} false)) )))) diff --git a/stdlib/source/test/lux/type/poly/json.lux b/stdlib/source/test/lux/type/poly/json.lux index 0332e7d00..2be75b3e8 100644 --- a/stdlib/source/test/lux/type/poly/json.lux +++ b/stdlib/source/test/lux/type/poly/json.lux @@ -86,7 +86,7 @@ (def: qty (All (_ unit) (Random (unit.Qty unit))) - (\ random.monad each (debug.private unit.in) random.int)) + (\ random.monad each (debug.private unit.in') random.int)) (def: gen_record (Random Record) diff --git a/stdlib/source/test/lux/type/refinement.lux b/stdlib/source/test/lux/type/refinement.lux index bebde21e2..de7b0070b 100644 --- a/stdlib/source/test/lux/type/refinement.lux +++ b/stdlib/source/test/lux/type/refinement.lux @@ -39,10 +39,10 @@ ($_ _.and (_.cover [/.refiner] (case (/.refiner predicate raw) - {#.Some refined} + {.#Some refined} (predicate raw) - #.None + {.#None} (not (predicate raw)))) (_.cover [/.predicate] (|> (/.refiner predicate modulus) diff --git a/stdlib/source/test/lux/type/resource.lux b/stdlib/source/test/lux/type/resource.lux index f78fb8473..4f06802b3 100644 --- a/stdlib/source/test/lux/type/resource.lux +++ b/stdlib/source/test/lux/type/resource.lux @@ -160,12 +160,12 @@ (monad.do meta.monad [[_ _ exception] (meta.export exception)] (function (_ compiler) - {#.Right [compiler + {.#Right [compiler (list (code.bit (case ((macro.single_expansion to_expand) compiler) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} true)))]}))) (def: .public test diff --git a/stdlib/source/test/lux/type/unit.lux b/stdlib/source/test/lux/type/unit.lux index eaea8af2d..b7bcf40f3 100644 --- a/stdlib/source/test/lux/type/unit.lux +++ b/stdlib/source/test/lux/type/unit.lux @@ -172,8 +172,8 @@ )) (_.cover [/.*] (let [expected (i.* (\ /.meter out left) (\ /.meter out right)) - actual ((debug.private /.out) (: (/.Qty [/.Meter /.Meter]) - (/.* left right)))] + actual ((debug.private /.out') (: (/.Qty [/.Meter /.Meter]) + (/.* left right)))] (i.= expected actual))) (_.cover [/./] (|> right diff --git a/stdlib/source/test/lux/world/console.lux b/stdlib/source/test/lux/world/console.lux index eaf882016..f044be377 100644 --- a/stdlib/source/test/lux/world/console.lux +++ b/stdlib/source/test/lux/world/console.lux @@ -41,12 +41,12 @@ (def: (on_write message [dead? content]) (if dead? (exception.except ..dead []) - {#try.Success [dead? (format content message)]})) + {try.#Success [dead? (format content message)]})) (def: (on_close [dead? content]) (if dead? (exception.except ..dead []) - {#try.Success [true content]})))) + {try.#Success [true content]})))) (def: .public test Test diff --git a/stdlib/source/test/lux/world/file/watch.lux b/stdlib/source/test/lux/world/file/watch.lux index 5ad722723..3e7b03015 100644 --- a/stdlib/source/test/lux/world/file/watch.lux +++ b/stdlib/source/test/lux/world/file/watch.lux @@ -76,16 +76,16 @@ ?stop (\ watcher stop directory)] (_.cover' [/.not_being_watched] (and (case ?concern - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_being_watched error) - {#try.Success _} + {try.#Success _} false) (case ?stop - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_being_watched error) - {#try.Success _} + {try.#Success _} false))))) ))) @@ -118,7 +118,7 @@ (def: (after_modification! fs watcher data expected_path) (-> (//.System Async) (/.Watcher Async) Binary //.Path (Async (Try Bit))) (do (try.with async.monad) - [_ (async.after 1 {#try.Success "Delay to make sure the over_write time-stamp always changes."}) + [_ (async.after 1 {try.#Success "Delay to make sure the over_write time-stamp always changes."}) _ (\ fs write data expected_path) poll/2 (\ watcher poll []) poll/2' (\ watcher poll [])] @@ -191,9 +191,9 @@ [started? ( \ watcher start /.all directory)] (_.cover' [/.cannot_poll_a_non_existent_directory] (case started? - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.cannot_poll_a_non_existent_directory error)))))) ))) diff --git a/stdlib/source/test/lux/world/input/keyboard.lux b/stdlib/source/test/lux/world/input/keyboard.lux index 7da4c9c34..192c406c1 100644 --- a/stdlib/source/test/lux/world/input/keyboard.lux +++ b/stdlib/source/test/lux/world/input/keyboard.lux @@ -160,8 +160,8 @@ [key ..random .let [sample (<function> key)]] (_.cover [<function>] - (and (bit\= <pressed?> (value@ #/.pressed? sample)) - (n.= key (value@ #/.input sample)))))] + (and (bit\= <pressed?> (value@ /.#pressed? sample)) + (n.= key (value@ /.#input sample)))))] [#0 /.release] [#1 /.press] diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux index 9a789fd70..5160aae60 100644 --- a/stdlib/source/test/lux/world/net/http/client.lux +++ b/stdlib/source/test/lux/world/net/http/client.lux @@ -47,30 +47,30 @@ (implementation (def: (request method url headers data) (io.io (let [value (case method - #//.Post on_post - #//.Get on_get - #//.Put on_put - #//.Patch on_patch - #//.Delete on_delete - #//.Head on_head - #//.Connect on_connect - #//.Options on_options - #//.Trace on_trace) + {//.#Post} on_post + {//.#Get} on_get + {//.#Put} on_put + {//.#Patch} on_patch + {//.#Delete} on_delete + {//.#Head} on_head + {//.#Connect} on_connect + {//.#Options} on_options + {//.#Trace} on_trace) data (|> value (\ nat.decimal encoded) (\ utf8.codec encoded))] - {#try.Success [//status.ok - [#//.headers headers - #//.body (function (_ ?wanted_bytes) - (io.io {#try.Success [(binary.size data) + {try.#Success [//status.ok + [//.#headers headers + //.#body (function (_ ?wanted_bytes) + (io.io {try.#Success [(binary.size data) data]}))]]})))))]] (`` ($_ _.and (~~ (template [<definition> <expected>] [(_.cover [<definition>] - (|> (<definition> "" //.empty #.None mock) + (|> (<definition> "" //.empty {.#None} mock) (do> try.monad [io.run!] - [product.right (value@ #//.body) (function.on #.None) io.run!] + [product.right (value@ //.#body) (function.on {.#None}) io.run!] [product.right (\ utf8.codec decoded)] [(\ nat.decimal decoded)] [(nat.= <expected>) in]) diff --git a/stdlib/source/test/lux/world/program.lux b/stdlib/source/test/lux/world/program.lux index c498a939b..e5909bcba 100644 --- a/stdlib/source/test/lux/world/program.lux +++ b/stdlib/source/test/lux/world/program.lux @@ -70,9 +70,9 @@ (|> unknown (\ program variable) io.run! - (case> {#try.Success _} + (case> {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.unknown_environment_variable error))))) )))) diff --git a/stdlib/source/test/lux/world/shell.lux b/stdlib/source/test/lux/world/shell.lux index daa0a5e11..c79a2fa14 100644 --- a/stdlib/source/test/lux/world/shell.lux +++ b/stdlib/source/test/lux/world/shell.lux @@ -41,51 +41,51 @@ [echo (try.of_maybe (list.head arguments))] (in [dead? echo])))) - (def: (on_error dead?) + (def: (on_fail dead?) (if dead? (exception.except ..dead []) - {#try.Success [dead? ""]})) + {try.#Success [dead? ""]})) (def: (on_write message dead?) (if dead? (exception.except ..dead []) - {#try.Success dead?})) + {try.#Success dead?})) (def: (on_destroy dead?) (if dead? (exception.except ..dead []) - {#try.Success true})) + {try.#Success true})) (def: (on_await dead?) (if dead? (exception.except ..dead []) - {#try.Success [true /.normal]})))) + {try.#Success [true /.normal]})))) (def: (io_shell command oops input destruction exit) (-> /.Command Text Text Text /.Exit (/.Shell IO)) (implementation (def: (execute [environment working_directory command arguments]) (<| io.io - #try.Success + {try.#Success} (: (/.Process IO)) (implementation (def: (read _) - (io.io {#try.Success command})) - (def: (error _) - (io.io {#try.Success oops})) + (io.io {try.#Success command})) + (def: (fail _) + (io.io {try.#Success oops})) (def: (write message) - (io.io {#try.Failure message})) + (io.io {try.#Failure message})) (def: (destroy _) - (io.io {#try.Failure destruction})) + (io.io {try.#Failure destruction})) (def: (await _) - (io.io {#try.Success exit}))))))) + (io.io {try.#Success exit}))))))) (def: .public test Test (<| (_.covering /._) ($_ _.and (_.for [/.async /.mock /.Mock] - ($/.spec (/.async (/.mock (|>> ..mock #try.Success) + ($/.spec (/.async (/.mock (|>> ..mock {try.#Success}) false)))) (_.cover [/.error] (not (i.= /.normal /.error))) @@ -100,26 +100,26 @@ [verdict (do (try.with !) [process (\ shell execute [environment.empty "~" command (list)]) read (\ process read []) - error (\ process error []) + failure (\ process fail []) wrote! (do ! [write (\ process write input)] - (in {#try.Success (case write - {#try.Success _} + (in {try.#Success (case write + {try.#Success _} false - {#try.Failure write} + {try.#Failure write} (text\= input write))})) destroyed! (do ! [destroy (\ process destroy [])] - (in {#try.Success (case destroy - {#try.Success _} + (in {try.#Success (case destroy + {try.#Success _} false - {#try.Failure destroy} + {try.#Failure destroy} (text\= destruction destroy))})) await (\ process await [])] (in (and (text\= command read) - (text\= oops error) + (text\= oops failure) wrote! destroyed! (i.= exit await))))] |