aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/aedifex/artifact/snapshot/version/value.lux2
-rw-r--r--stdlib/source/test/aedifex/artifact/time/date.lux4
-rw-r--r--stdlib/source/test/aedifex/cache.lux10
-rw-r--r--stdlib/source/test/aedifex/cli.lux14
-rw-r--r--stdlib/source/test/aedifex/command/auto.lux12
-rw-r--r--stdlib/source/test/aedifex/command/build.lux46
-rw-r--r--stdlib/source/test/aedifex/command/deps.lux8
-rw-r--r--stdlib/source/test/aedifex/command/install.lux2
-rw-r--r--stdlib/source/test/aedifex/command/pom.lux6
-rw-r--r--stdlib/source/test/aedifex/command/test.lux12
-rw-r--r--stdlib/source/test/aedifex/command/version.lux4
-rw-r--r--stdlib/source/test/aedifex/dependency/deployment.lux4
-rw-r--r--stdlib/source/test/aedifex/dependency/resolution.lux108
-rw-r--r--stdlib/source/test/aedifex/dependency/status.lux2
-rw-r--r--stdlib/source/test/aedifex/hash.lux12
-rw-r--r--stdlib/source/test/aedifex/metadata/artifact.lux8
-rw-r--r--stdlib/source/test/aedifex/metadata/snapshot.lux8
-rw-r--r--stdlib/source/test/aedifex/package.lux18
-rw-r--r--stdlib/source/test/aedifex/parser.lux4
-rw-r--r--stdlib/source/test/aedifex/pom.lux10
-rw-r--r--stdlib/source/test/aedifex/project.lux8
-rw-r--r--stdlib/source/test/aedifex/repository.lux6
-rw-r--r--stdlib/source/test/aedifex/repository/local.lux4
-rw-r--r--stdlib/source/test/aedifex/repository/remote.lux16
-rw-r--r--stdlib/source/test/lux.lux62
-rw-r--r--stdlib/source/test/lux/abstract/apply.lux6
-rw-r--r--stdlib/source/test/lux/abstract/codec.lux4
-rw-r--r--stdlib/source/test/lux/abstract/enum.lux2
-rw-r--r--stdlib/source/test/lux/abstract/equivalence.lux2
-rw-r--r--stdlib/source/test/lux/abstract/functor.lux16
-rw-r--r--stdlib/source/test/lux/abstract/monad/free.lux6
-rw-r--r--stdlib/source/test/lux/abstract/predicate.lux2
-rw-r--r--stdlib/source/test/lux/control/concatenative.lux2
-rw-r--r--stdlib/source/test/lux/control/concurrency/actor.lux30
-rw-r--r--stdlib/source/test/lux/control/concurrency/async.lux10
-rw-r--r--stdlib/source/test/lux/control/concurrency/frp.lux24
-rw-r--r--stdlib/source/test/lux/control/concurrency/semaphore.lux10
-rw-r--r--stdlib/source/test/lux/control/continuation.lux4
-rw-r--r--stdlib/source/test/lux/control/exception.lux32
-rw-r--r--stdlib/source/test/lux/control/function/contract.lux8
-rw-r--r--stdlib/source/test/lux/control/maybe.lux12
-rw-r--r--stdlib/source/test/lux/control/parser.lux22
-rw-r--r--stdlib/source/test/lux/control/parser/analysis.lux34
-rw-r--r--stdlib/source/test/lux/control/parser/binary.lux42
-rw-r--r--stdlib/source/test/lux/control/parser/cli.lux22
-rw-r--r--stdlib/source/test/lux/control/parser/code.lux26
-rw-r--r--stdlib/source/test/lux/control/parser/environment.lux4
-rw-r--r--stdlib/source/test/lux/control/parser/json.lux68
-rw-r--r--stdlib/source/test/lux/control/parser/synthesis.lux34
-rw-r--r--stdlib/source/test/lux/control/parser/text.lux32
-rw-r--r--stdlib/source/test/lux/control/parser/tree.lux10
-rw-r--r--stdlib/source/test/lux/control/parser/type.lux80
-rw-r--r--stdlib/source/test/lux/control/parser/xml.lux66
-rw-r--r--stdlib/source/test/lux/control/region.lux18
-rw-r--r--stdlib/source/test/lux/control/remember.lux30
-rw-r--r--stdlib/source/test/lux/control/try.lux18
-rw-r--r--stdlib/source/test/lux/data/binary.lux18
-rw-r--r--stdlib/source/test/lux/data/collection/array.lux16
-rw-r--r--stdlib/source/test/lux/data/collection/dictionary.lux26
-rw-r--r--stdlib/source/test/lux/data/collection/dictionary/ordered.lux6
-rw-r--r--stdlib/source/test/lux/data/collection/list.lux14
-rw-r--r--stdlib/source/test/lux/data/collection/queue.lux4
-rw-r--r--stdlib/source/test/lux/data/collection/queue/priority.lux4
-rw-r--r--stdlib/source/test/lux/data/collection/row.lux8
-rw-r--r--stdlib/source/test/lux/data/collection/set/ordered.lux2
-rw-r--r--stdlib/source/test/lux/data/collection/stack.lux6
-rw-r--r--stdlib/source/test/lux/data/collection/tree/finger.lux10
-rw-r--r--stdlib/source/test/lux/data/format/json.lux34
-rw-r--r--stdlib/source/test/lux/data/format/tar.lux86
-rw-r--r--stdlib/source/test/lux/data/sum.lux12
-rw-r--r--stdlib/source/test/lux/data/text.lux10
-rw-r--r--stdlib/source/test/lux/data/text/escape.lux20
-rw-r--r--stdlib/source/test/lux/data/text/format.lux2
-rw-r--r--stdlib/source/test/lux/data/text/regex.lux26
-rw-r--r--stdlib/source/test/lux/debug.lux18
-rw-r--r--stdlib/source/test/lux/documentation.lux8
-rw-r--r--stdlib/source/test/lux/extension.lux12
-rw-r--r--stdlib/source/test/lux/ffi.jvm.lux40
-rw-r--r--stdlib/source/test/lux/ffi.lua.lux2
-rw-r--r--stdlib/source/test/lux/ffi.old.lux10
-rw-r--r--stdlib/source/test/lux/locale.lux14
-rw-r--r--stdlib/source/test/lux/macro.lux12
-rw-r--r--stdlib/source/test/lux/macro/code.lux20
-rw-r--r--stdlib/source/test/lux/macro/local.lux14
-rw-r--r--stdlib/source/test/lux/macro/syntax/check.lux4
-rw-r--r--stdlib/source/test/lux/macro/syntax/declaration.lux4
-rw-r--r--stdlib/source/test/lux/macro/syntax/definition.lux16
-rw-r--r--stdlib/source/test/lux/macro/syntax/export.lux2
-rw-r--r--stdlib/source/test/lux/macro/syntax/input.lux4
-rw-r--r--stdlib/source/test/lux/macro/template.lux8
-rw-r--r--stdlib/source/test/lux/math/logic/fuzzy.lux4
-rw-r--r--stdlib/source/test/lux/math/modular.lux10
-rw-r--r--stdlib/source/test/lux/math/modulus.lux8
-rw-r--r--stdlib/source/test/lux/math/number.lux12
-rw-r--r--stdlib/source/test/lux/math/number/i64.lux2
-rw-r--r--stdlib/source/test/lux/math/number/ratio.lux4
-rw-r--r--stdlib/source/test/lux/meta.lux204
-rw-r--r--stdlib/source/test/lux/program.lux4
-rw-r--r--stdlib/source/test/lux/static.lux8
-rw-r--r--stdlib/source/test/lux/target/jvm.lux58
-rw-r--r--stdlib/source/test/lux/time.lux16
-rw-r--r--stdlib/source/test/lux/time/date.lux8
-rw-r--r--stdlib/source/test/lux/time/day.lux8
-rw-r--r--stdlib/source/test/lux/time/instant.lux4
-rw-r--r--stdlib/source/test/lux/time/month.lux8
-rw-r--r--stdlib/source/test/lux/time/year.lux12
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux30
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux10
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/primitive.lux16
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux12
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux30
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux4
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux70
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux134
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux16
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux10
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux4
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux64
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux16
-rw-r--r--stdlib/source/test/lux/type.lux16
-rw-r--r--stdlib/source/test/lux/type/abstract.lux6
-rw-r--r--stdlib/source/test/lux/type/check.lux231
-rw-r--r--stdlib/source/test/lux/type/dynamic.lux12
-rw-r--r--stdlib/source/test/lux/type/poly/equivalence.lux10
-rw-r--r--stdlib/source/test/lux/type/poly/json.lux10
-rw-r--r--stdlib/source/test/lux/type/refinement.lux2
-rw-r--r--stdlib/source/test/lux/type/resource.lux8
-rw-r--r--stdlib/source/test/lux/world/console.lux4
-rw-r--r--stdlib/source/test/lux/world/file/watch.lux14
-rw-r--r--stdlib/source/test/lux/world/net/http/client.lux6
-rw-r--r--stdlib/source/test/lux/world/program.lux4
-rw-r--r--stdlib/source/test/lux/world/shell.lux34
132 files changed, 1351 insertions, 1350 deletions
diff --git a/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux b/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux
index bccd76fac..8daf8635c 100644
--- a/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux
+++ b/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux
@@ -54,7 +54,7 @@
(/.format (with@ #/.snapshot #///.Local sample)))
remote_format (/.format [#/.version (format version /.snapshot)
- #/.snapshot (#///.Remote stamp)])
+ #/.snapshot {#///.Remote stamp}])
remote!
(and (text.starts_with? (format version (///time.format (value@ #///stamp.time stamp)))
remote_format)
diff --git a/stdlib/source/test/aedifex/artifact/time/date.lux b/stdlib/source/test/aedifex/artifact/time/date.lux
index e76cf4259..77c312380 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/cache.lux b/stdlib/source/test/aedifex/cache.lux
index fc5efcf8f..338feb5fa 100644
--- a/stdlib/source/test/aedifex/cache.lux
+++ b/stdlib/source/test/aedifex/cache.lux
@@ -75,7 +75,7 @@
content ..content]
(in [[#//dependency.artifact identity
#//dependency.type type]
- (with@ #//package.origin (#//repository/origin.Remote "") (//package.local pom content))])))
+ (with@ #//package.origin {#//repository/origin.Remote ""} (//package.local pom content))])))
(def: resolution
(Random Resolution)
@@ -89,13 +89,13 @@
[pom (random.one (function (_ [identity profile pom])
(|> profile
(with@ #//.dependencies (set.empty //dependency.hash))
- (with@ #//.identity (#.Some (value@ #//dependency.artifact dependency)))
+ (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 9cc55fd2c..e41f3e44c 100644
--- a/stdlib/source/test/aedifex/cli.lux
+++ b/stdlib/source/test/aedifex/cli.lux
@@ -64,9 +64,9 @@
#/.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))))
+ {#/.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 4511d8a03..57aca92d2 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
@@ -79,7 +79,7 @@
with_target (: (-> Profile Profile)
(with@ #///.target target))
with_program (: (-> Profile Profile)
- (with@ #///.program (#.Some program)))
+ (with@ #///.program {#.Some program}))
profile (|> empty_profile
with_program
@@ -110,17 +110,17 @@
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!
- no_dangling_process!)))))]
+ (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 c856b11f5..1376d440a 100644
--- a/stdlib/source/test/aedifex/command/build.lux
+++ b/stdlib/source/test/aedifex/command/build.lux
@@ -41,7 +41,7 @@
(-> 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)
@@ -49,17 +49,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 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)
@@ -67,43 +67,43 @@
(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 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
(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
(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)
@@ -153,7 +153,7 @@
with_target (: (-> Profile Profile)
(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 "")]
@@ -232,10 +232,10 @@
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)))]
(in (and (text\= expected/0 actual/0)
diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux
index 3d563f540..8cf0ea05c 100644
--- a/stdlib/source/test/aedifex/command/deps.lux
+++ b/stdlib/source/test/aedifex/command/deps.lux
@@ -73,22 +73,22 @@
#///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@ #///.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.origin {#///repository/origin.Remote ""})
(with@ #///package.pom [dependee_pom
(|> dependee_pom (\ xml.codec encoded) (\ utf8.codec encoded))
#///dependency/status.Unverified]))
depender_package (|> depender_package
- (with@ #///package.origin (#///repository/origin.Remote ""))
+ (with@ #///package.origin {#///repository/origin.Remote ""})
(with@ #///package.pom [depender_pom
(|> depender_pom (\ xml.codec encoded) (\ utf8.codec encoded))
#///dependency/status.Unverified]))
diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux
index 8ef29ec92..ac1a87be1 100644
--- a/stdlib/source/test/aedifex/command/install.lux
+++ b/stdlib/source/test/aedifex/command/install.lux
@@ -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)
diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux
index 80676974b..ac080c966 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,10 +60,10 @@
(_.cover' [/.do! /.success]
(try.else false verdict)))
- (#try.Failure error)
+ {#try.Failure error}
(_.cover' [/.do!]
(case (value@ #///.identity sample)
- (#.Some _)
+ {#.Some _}
false
#.None
diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux
index bbcb582b1..19ae5cd70 100644
--- a/stdlib/source/test/aedifex/command/test.lux
+++ b/stdlib/source/test/aedifex/command/test.lux
@@ -52,7 +52,7 @@
with_target (: (-> Profile Profile)
(with@ #///.target target))
with_test (: (-> Profile Profile)
- (with@ #///.test (#.Some test)))
+ (with@ #///.test {#.Some test}))
profile (|> empty_profile
with_test
@@ -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,13 +91,13 @@
(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)]))))))
+ shell.error)]})))})
[])]
_ (/.do! console (program.async (program.mock environment.empty home working_directory))
fs (shell.async bad_shell) resolution
diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux
index 1b2b0aa53..6cd59b3a5 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 5b7869eab..7e137443b 100644
--- a/stdlib/source/test/aedifex/dependency/deployment.lux
+++ b/stdlib/source/test/aedifex/dependency/deployment.lux
@@ -68,12 +68,12 @@
(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)
diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux
index 2fe39286d..69867d5f8 100644
--- a/stdlib/source/test/aedifex/dependency/resolution.lux
+++ b/stdlib/source/test/aedifex/dependency/resolution.lux
@@ -92,9 +92,9 @@
(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))
@@ -115,28 +115,28 @@
(\ 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))
@@ -146,50 +146,50 @@
(def: (on_download uri state)
(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
+ {#try.Success [state (|> expected_package
(value@ #///package.library)
- product.left)])
+ product.left)]}
(text.ends_with? ..lux_sha-1 uri)
- (#try.Success [state (|> expected_package
+ {#try.Success [state (|> expected_package
(value@ #///package.library)
product.left
- ..sha-1)])
+ ..sha-1)]}
(text.ends_with? ..lux_md5 uri)
- (#try.Success [state (|> expected_package
+ {#try.Success [state (|> expected_package
(value@ #///package.library)
product.left
- ..md5)])
+ ..md5)]}
(text.ends_with? ///artifact/extension.pom uri)
- (#try.Success [state (|> expected_package
+ {#try.Success [state (|> expected_package
(value@ #///package.pom)
product.left
(\ xml.codec encoded)
- (\ utf8.codec encoded))])
+ (\ utf8.codec encoded))]}
(text.ends_with? ..pom_sha-1 uri)
- (#try.Success [state (|> dummy_package
+ {#try.Success [state (|> dummy_package
(value@ #///package.pom)
product.left
(\ xml.codec encoded)
(\ utf8.codec encoded)
- ..sha-1)])
+ ..sha-1)]}
(text.ends_with? ..pom_md5 uri)
- (#try.Success [state (|> expected_package
+ {#try.Success [state (|> expected_package
(value@ #///package.pom)
product.left
(\ xml.codec encoded)
(\ utf8.codec encoded)
- ..md5)])
+ ..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))
@@ -199,50 +199,50 @@
(def: (on_download uri state)
(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
+ {#try.Success [state (|> expected_package
(value@ #///package.library)
- product.left)])
+ product.left)]}
(text.ends_with? ..lux_sha-1 uri)
- (#try.Success [state (|> expected_package
+ {#try.Success [state (|> expected_package
(value@ #///package.library)
product.left
- ..sha-1)])
+ ..sha-1)]}
(text.ends_with? ..lux_md5 uri)
- (#try.Success [state (|> dummy_package
+ {#try.Success [state (|> dummy_package
(value@ #///package.library)
product.left
- ..md5)])
+ ..md5)]}
(text.ends_with? ///artifact/extension.pom uri)
- (#try.Success [state (|> expected_package
+ {#try.Success [state (|> expected_package
(value@ #///package.pom)
product.left
(\ xml.codec encoded)
- (\ utf8.codec encoded))])
+ (\ utf8.codec encoded))]}
(text.ends_with? ..pom_sha-1 uri)
- (#try.Success [state (|> expected_package
+ {#try.Success [state (|> expected_package
(value@ #///package.pom)
product.left
(\ xml.codec encoded)
(\ utf8.codec encoded)
- ..sha-1)])
+ ..sha-1)]}
(text.ends_with? ..pom_md5 uri)
- (#try.Success [state (|> dummy_package
+ {#try.Success [state (|> dummy_package
(value@ #///package.pom)
product.left
(\ xml.codec encoded)
(\ utf8.codec encoded)
- ..md5)])
+ ..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
@@ -264,12 +264,12 @@
#///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
@@ -278,10 +278,10 @@
#///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]
@@ -313,12 +313,12 @@
#///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 "")]
@@ -329,10 +329,10 @@
#///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))))
)))
@@ -366,16 +366,16 @@
#///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@ #///.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)
diff --git a/stdlib/source/test/aedifex/dependency/status.lux b/stdlib/source/test/aedifex/dependency/status.lux
index 981f18b0e..79e59460f 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 a3220b756..049023718 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/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux
index 0f0188ea3..a1d3133c5 100644
--- a/stdlib/source/test/aedifex/metadata/artifact.lux
+++ b/stdlib/source/test/aedifex/metadata/artifact.lux
@@ -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 39d16bd27..52f7a1562 100644
--- a/stdlib/source/test/aedifex/metadata/snapshot.lux
+++ b/stdlib/source/test/aedifex/metadata/snapshot.lux
@@ -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 61153b8ad..69d31ddcc 100644
--- a/stdlib/source/test/aedifex/package.lux
+++ b/stdlib/source/test/aedifex/package.lux
@@ -64,9 +64,9 @@
($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)
@@ -76,13 +76,13 @@
[actual_pom binary_pom pom_status] (value@ #/.pom local)
[actual_library library_status] (value@ #/.library local)]
(and (case (value@ #/.origin local)
- (#//origin.Local "") true
+ {#//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,7 +97,7 @@
(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))
@@ -106,17 +106,17 @@
(_.cover [/.dependencies]
(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)]
(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 1152a1dba..3dc073f0d 100644
--- a/stdlib/source/test/aedifex/parser.lux
+++ b/stdlib/source/test/aedifex/parser.lux
@@ -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 92f13bd4f..4913df25d 100644
--- a/stdlib/source/test/aedifex/pom.lux
+++ b/stdlib/source/test/aedifex/pom.lux
@@ -35,20 +35,20 @@
(_.cover [/.write /.parser]
(case [(/.write expected)
(value@ #//.identity expected)]
- [(#try.Success pom)
- (#.Some _)]
+ [{#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)))
actual)
- (#try.Failure error)
+ {#try.Failure error}
false)
- [(#try.Failure error)
+ [{#try.Failure error}
#.None]
(exception.match? //.no_identity error)
diff --git a/stdlib/source/test/aedifex/project.lux b/stdlib/source/test/aedifex/project.lux
index 94e61bd7c..767f8cdb3 100644
--- a/stdlib/source/test/aedifex/project.lux
+++ b/stdlib/source/test/aedifex/project.lux
@@ -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 0cbea2733..e65503ee9 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
(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 03c64b69a..b6d647bb9 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 9e405ddc5..443ab884e 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))
@@ -56,7 +56,7 @@
[#@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)))
@@ -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!
@@ -113,19 +113,19 @@
#.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
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/lux.lux b/stdlib/source/test/lux.lux
index fefe5270e..6a6ef3fac 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))
)))
@@ -437,13 +437,13 @@
(/.macro: (found_crosshair? tokens lux)
(let [[_ _ source_code] (value@ #.source lux)]
- (#.Right [lux (list (code.bit (text.contains? ..crosshair source_code)))])))
+ {#.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))]
@@ -468,8 +468,8 @@
(/.type: for_type/variant
(Variant
#Case/0
- (#Case/1 Nat)
- (#Case/2 Int Text)))
+ {#Case/1 Nat}
+ {#Case/2 Int Text}))
(/.type: for_type/record
(Record
@@ -518,7 +518,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 +526,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))
@@ -562,7 +562,7 @@
(_.cover [/.Variant]
(exec
(: for_type/variant
- (#Case/1 expected_left))
+ {#Case/1 expected_left})
true))
(_.cover [/.Record]
(exec
@@ -836,11 +836,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 +890,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 +950,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]
@@ -1083,8 +1083,8 @@
(case (value@ #.mode info)
#.Build true
_ false)]
- (#.Right [lux (list (code.bit (and conforming_target!
- compiling!)))]))))
+ {#.Right [lux (list (code.bit (and conforming_target!
+ compiling!)))]})))
(syntax: (for_meta|Module_State [])
(do meta.monad
@@ -1146,8 +1146,8 @@
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)
diff --git a/stdlib/source/test/lux/abstract/apply.lux b/stdlib/source/test/lux/abstract/apply.lux
index d5a1cd060..d7c6495c3 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 fdaff8185..aadf0d0e2 100644
--- a/stdlib/source/test/lux/abstract/codec.lux
+++ b/stdlib/source/test/lux/abstract/codec.lux
@@ -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 83505a5be..5e2807e53 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)))
diff --git a/stdlib/source/test/lux/abstract/equivalence.lux b/stdlib/source/test/lux/abstract/equivalence.lux
index 206150921..799a657cb 100644
--- a/stdlib/source/test/lux/abstract/equivalence.lux
+++ b/stdlib/source/test/lux/abstract/equivalence.lux
@@ -48,7 +48,7 @@
[#.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 dff57b393..97540f00e 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 39f91dc05..8fc9c96a8 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 8799e27a9..3cc54444b 100644
--- a/stdlib/source/test/lux/abstract/predicate.lux
+++ b/stdlib/source/test/lux/abstract/predicate.lux
@@ -83,7 +83,7 @@
#.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 4cc158fd5..d1bb1d315 100644
--- a/stdlib/source/test/lux/control/concatenative.lux
+++ b/stdlib/source/test/lux/control/concatenative.lux
@@ -69,7 +69,7 @@
(~~ (template [<function> <tag>]
[(_.cover [<function>]
((sum.equivalence n.= n.=)
- (<tag> sample)
+ {<tag> sample}
(||> (/.push sample)
<function>)))]
diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux
index 27b13bba4..c36e1b074 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
@@ -92,12 +92,12 @@
(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,7 +105,7 @@
result (async.future (async.value read))]
(_.cover' [/.poisoned]
(case result
- (#.Some error)
+ {#.Some error}
(exception.match? /.poisoned error)
#.None
@@ -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 2194854b5..f117f57f5 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 d4615020b..c46d0da92 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)
_
@@ -58,8 +58,8 @@
#.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,7 +148,7 @@
_ (atom.update! (row.suffix value) sink)]
(if (n.< (list.size inputs)
(++ (row.size current)))
- (in (#.Some []))
+ (in {#.Some []})
(do !
[_ (!signal [])]
(in #.None)))))
@@ -212,8 +212,8 @@
(/.iterations (function (_ [iterations current])
(async.resolved
(if (n.< max_iterations iterations)
- (#.Some [[(++ iterations) (n.+ shift current)]
- current])
+ {#.Some [[(++ iterations) (n.+ shift current)]
+ current]}
#.None))))
/.list)]
(_.cover' [/.iterations]
diff --git a/stdlib/source/test/lux/control/concurrency/semaphore.lux b/stdlib/source/test/lux/control/concurrency/semaphore.lux
index 6f87f0889..44b2241f3 100644
--- a/stdlib/source/test/lux/control/concurrency/semaphore.lux
+++ b/stdlib/source/test/lux/control/concurrency/semaphore.lux
@@ -45,7 +45,7 @@
[result (async.within ..delay (/.wait! semaphore))]
(_.cover' [/.semaphore]
(case result
- (#.Some _)
+ {#.Some _}
true
#.None
@@ -58,7 +58,7 @@
result (async.within ..delay (/.wait! semaphore))]
(_.cover' [/.wait!]
(case result
- (#.Some _)
+ {#.Some _}
false
#.None
@@ -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)
_
@@ -148,7 +148,7 @@
[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 ecb4ee77d..9fcea56e8 100644
--- a/stdlib/source/test/lux/control/continuation.lux
+++ b/stdlib/source/test/lux/control/continuation.lux
@@ -75,12 +75,12 @@
#.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 faeac513e..1a0d26c86 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 2ea5d8e3e..3e50834a7 100644
--- a/stdlib/source/test/lux/control/function/contract.lux
+++ b/stdlib/source/test/lux/control/function/contract.lux
@@ -25,20 +25,20 @@
(_.cover [/.pre /.pre_condition_failed]
(case (try (/.pre (n.even? expected)
true))
- (#try.Success output)
+ {#try.Success output}
output
- (#try.Failure error)
+ {#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)
+ {#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 1c3e270a5..2cdce3830 100644
--- a/stdlib/source/test/lux/control/maybe.lux
+++ b/stdlib/source/test/lux/control/maybe.lux
@@ -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)
_
@@ -68,21 +68,21 @@
#.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 fa3e828dc..119bfebb6 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,7 +99,7 @@
(_.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))
@@ -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 c1babf741..392e66382 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 7e8ddd47c..40e2fa301 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
@@ -131,7 +131,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 +150,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 +168,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 +188,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 +207,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 +220,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 +232,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 +246,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 +260,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 +273,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 +282,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 +296,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 +310,7 @@
(/.or /.any
(<>.and /.nat
recur))))))
- (!expect (^multi (#try.Success actual)
+ (!expect (^multi {#try.Success actual}
(\ (list.equivalence n.equivalence) =
expected
actual))))))
@@ -325,13 +325,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 +339,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 +351,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 +366,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 +380,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 69f8cfe3e..fe10e5ccd 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 8ee19b7e4..400aea243 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]
@@ -87,7 +87,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 +102,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 +115,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 +133,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 42c09df66..dbef40a52 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 1e440036e..ad35703ab 100644
--- a/stdlib/source/test/lux/control/parser/json.lux
+++ b/stdlib/source/test/lux/control/parser/json.lux
@@ -49,30 +49,30 @@
[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 _))))
+ (!expect {#try.Success _})))
(~~ (template [<query> <test> <check> <random> <json> <equivalence>]
[(do [! random.monad]
[expected <random>
dummy (|> <random> (random.only (|>> (\ <equivalence> = expected) not)))]
($_ _.and
(_.cover [<query>]
- (|> (/.result <query> (<json> expected))
- (!expect (^multi (#try.Success actual)
+ (|> (/.result <query> {<json> expected})
+ (!expect (^multi {#try.Success actual}
(\ <equivalence> = expected actual)))))
(_.cover [<test>]
- (and (|> (/.result (<test> expected) (<json> expected))
- (!expect (#try.Success #1)))
- (|> (/.result (<test> expected) (<json> dummy))
- (!expect (#try.Success #0)))))
+ (and (|> (/.result (<test> expected) {<json> expected})
+ (!expect {#try.Success #1}))
+ (|> (/.result (<test> expected) {<json> dummy})
+ (!expect {#try.Success #0}))))
(_.cover [<check>]
- (and (|> (/.result (<check> expected) (<json> expected))
- (!expect (#try.Success _)))
- (|> (/.result (<check> expected) (<json> dummy))
- (!expect (#try.Failure _)))))))]
+ (and (|> (/.result (<check> expected) {<json> expected})
+ (!expect {#try.Success _}))
+ (|> (/.result (<check> expected) {<json> dummy})
+ (!expect {#try.Failure _}))))))]
[/.boolean /.boolean? /.boolean! random.bit #json.Boolean bit.equivalence]
[/.number /.number? /.number! ..safe_frac #json.Number frac.equivalence]
@@ -82,25 +82,25 @@
[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)
+ (!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)))))))
+ (|> (/.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))]
(_.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.zipped/2 keys)
- (dictionary.of_list text.hash))))
- (!expect (^multi (#try.Success actual)
+ (dictionary.of_list text.hash))})
+ (!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 9068cad62..67906c0a1 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 05a28b1ff..8377f6b4b 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 30fc3f5d1..d99273be5 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 8b843dcdb..3d27819bd 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 b61b993a2..15c1fdd88 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,12 +62,12 @@
(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))]
(_.cover [/.any]
@@ -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,54 +100,54 @@
(|> (/.result (<| (/.node expected_tag)
(//.after (/.attribute expected_attribute))
(//\in []))
- (list (#xml.Node expected_tag
- (|> (dictionary.empty name.hash)
- (dictionary.has expected_attribute expected_value))
- (list))))
- (!expect (#try.Success [])))))
+ (list {#xml.Node expected_tag
+ (|> (dictionary.empty name.hash)
+ (dictionary.has expected_attribute expected_value))
+ (list)}))
+ (!expect {#try.Success []}))))
(!failure /.unknown_attribute
[[(/.attribute ["" expected])
- (#xml.Node [expected expected]
- (|> (dictionary.empty name.hash)
- (dictionary.has [expected ""] expected))
- (list))]])
+ {#xml.Node [expected expected]
+ (|> (dictionary.empty name.hash)
+ (dictionary.has [expected ""] expected))
+ (list)}]])
(!failure /.empty_input
[[(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]
- (dictionary.empty name.hash)
- (list))]
+ {#xml.Node [expected expected]
+ (dictionary.empty name.hash)
+ (list)}]
[(do //.monad
[_ /.any]
(/.node [expected expected]
(/.attribute [expected expected])))
- (#xml.Node [expected expected]
- (|> (dictionary.empty name.hash)
- (dictionary.has [expected expected] expected))
- (list))]])
+ {#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 6b4f5b55c..da88cb31e 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 680238ff9..3b210813d 100644
--- a/stdlib/source/test/lux/control/remember.lux
+++ b/stdlib/source/test/lux/control/remember.lux
@@ -39,17 +39,17 @@
(~ (code.text message))
(~+ (case focus
#.None (list)
- (#.Some focus) (list focus))))))
+ {#.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)
@@ -59,7 +59,7 @@
#.None
true
- (#.Some focus)
+ {#.Some focus}
(text.contains? (%.code focus) failure))))
(syntax: (test_macro [macro <code>.identifier
@@ -74,31 +74,31 @@
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_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_succeed1 (..attempt (macro.expansion (..memory macro tomorrow message {#.Some expected})))]
(in (list (code.bit (and (case should_fail0
- (#try.Failure 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)
_
@@ -116,8 +116,8 @@
(_.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)]))))
+ (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/try.lux b/stdlib/source/test/lux/control/try.lux
index 80b68423f..3e38574b2 100644
--- a/stdlib/source/test/lux/control/try.lux
+++ b/stdlib/source/test/lux/control/try.lux
@@ -57,28 +57,28 @@
(_.cover [/.trusted]
(n.= expected
- (/.trusted (#/.Success expected))))
+ (/.trusted {#/.Success expected})))
(_.cover [/.of_maybe]
- (case [(/.of_maybe (#.Some expected))
+ (case [(/.of_maybe {#.Some expected})
(/.of_maybe #.None)]
- [(#/.Success actual) (#/.Failure _)]
+ [{#/.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 1fb97272c..d301efd1c 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)
_
@@ -141,16 +141,16 @@
#.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 46783bc56..243d77203 100644
--- a/stdlib/source/test/lux/data/collection/array.lux
+++ b/stdlib/source/test/lux/data/collection/array.lux
@@ -65,9 +65,9 @@
(/.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))
@@ -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))
@@ -199,7 +199,7 @@
(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!]
diff --git a/stdlib/source/test/lux/data/collection/dictionary.lux b/stdlib/source/test/lux/data/collection/dictionary.lux
index 788f6c3eb..2f8a58bfc 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!)))
@@ -192,7 +192,7 @@
#.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,7 +209,7 @@
(_.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
@@ -220,9 +220,9 @@
#.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
diff --git a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
index 65bb6226d..94dd0e61d 100644
--- a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
+++ b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
@@ -78,7 +78,7 @@
[#.None #.None]
#1
- [(#.Some reference) (#.Some sample)]
+ [{#.Some reference} {#.Some sample}]
(n.= reference sample)
_
@@ -88,7 +88,7 @@
[#.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 e4776e1ab..b2411ce74 100644
--- a/stdlib/source/test/lux/data/collection/list.lux
+++ b/stdlib/source/test/lux/data/collection/list.lux
@@ -168,7 +168,7 @@
(_.cover [/.item]
(/.every? (function (_ [index expected])
(case (/.item index sample)
- (#.Some actual)
+ {#.Some actual}
(n.= expected actual)
#.None
@@ -238,7 +238,7 @@
[($_ _.and
(_.cover [<head>]
(case [(<pre> sample) (<head> sample)]
- [(#.Item expected _) (#.Some actual)]
+ [{#.Item expected _} {#.Some actual}]
(n.= expected actual)
[#.End #.None]
@@ -248,7 +248,7 @@
false))
(_.cover [<tail>]
(case [(<pre> sample) (<tail> sample)]
- [(#.Item _ expected) (#.Some actual)]
+ [{#.Item _ expected} {#.Some actual}]
(/\= (<pre> expected) actual)
[#.End #.None]
@@ -355,7 +355,7 @@
choose (: (-> Nat (Maybe Text))
(function (_ value)
(if (n.even? value)
- (#.Some (\ n.decimal encoded value))
+ {#.Some (\ n.decimal encoded value)}
#.None)))]
(do [! random.monad]
[sample ..random]
@@ -366,7 +366,7 @@
(/\each (\ n.decimal encoded))
/.head)
(/.one choose sample)]
- [(#.Some expected) (#.Some actual)]
+ [{#.Some expected} {#.Some actual}]
(text\= expected actual)
[#.None #.None]
@@ -382,7 +382,7 @@
(/.all choose sample)))
(_.cover [/.example]
(case (/.example n.even? sample)
- (#.Some found)
+ {#.Some found}
(n.even? found)
#.None
@@ -419,7 +419,7 @@
(/\= (/.indices size)
(/.iterations (function (_ index)
(if (n.< size index)
- (#.Some (++ index))
+ {#.Some (++ index)}
#.None))
0)))))
(_.cover [/.mixes]
diff --git a/stdlib/source/test/lux/data/collection/queue.lux b/stdlib/source/test/lux/data/collection/queue.lux
index 117617468..795806329 100644
--- a/stdlib/source/test/lux/data/collection/queue.lux
+++ b/stdlib/source/test/lux/data/collection/queue.lux
@@ -60,7 +60,7 @@
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]
@@ -95,7 +95,7 @@
has_expected_order!)))
(_.cover [/.next]
(case members
- (#.Item target expected)
+ {#.Item target expected}
(let [popped (/.next sample)
size_decreases!
diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux
index 0ce7111f6..6ec5cb958 100644
--- a/stdlib/source/test/lux/data/collection/queue/priority.lux
+++ b/stdlib/source/test/lux/data/collection/queue/priority.lux
@@ -49,14 +49,14 @@
(/.empty? /.empty))
(_.cover [/.front]
(case (/.front sample)
- (#.Some first)
+ {#.Some first}
(n.> 0 (/.size sample))
#.None
(/.empty? sample)))
(_.cover [/.member?]
(case (/.front sample)
- (#.Some first)
+ {#.Some first}
(/.member? n.equivalence sample first)
#.None
diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux
index fa4f7271f..684619006 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 b89bad1bb..89ad780c7 100644
--- a/stdlib/source/test/lux/data/collection/set/ordered.lux
+++ b/stdlib/source/test/lux/data/collection/set/ordered.lux
@@ -74,7 +74,7 @@
(~~ (template [<coverage> <comparison>]
[(_.cover [<coverage>]
(case (<coverage> setL)
- (#.Some value)
+ {#.Some value}
(|> setL /.list (list.every? (<comparison> value)))
#.None
diff --git a/stdlib/source/test/lux/data/collection/stack.lux b/stdlib/source/test/lux/data/collection/stack.lux
index eb05c1e67..928dc475a 100644
--- a/stdlib/source/test/lux/data/collection/stack.lux
+++ b/stdlib/source/test/lux/data/collection/stack.lux
@@ -48,20 +48,20 @@
#.None
(/.empty? sample)
- (#.Some _)
+ {#.Some _}
(not (/.empty? sample))))
(_.cover [/.next]
(case (/.next sample)
#.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))
diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux
index a929dbaa5..c067ba36c 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 82faaba7f..1e5015f46 100644
--- a/stdlib/source/test/lux/data/format/json.lux
+++ b/stdlib/source/test/lux/data/format/json.lux
@@ -96,12 +96,12 @@
($_ _.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!))))))
@@ -139,7 +139,7 @@
[key (random.ascii/alpha 1)
value <random>]
(_.cover [<type> <field>]
- (|> (/.object (list [key (<tag> value)]))
+ (|> (/.object (list [key {<tag> value}]))
(<field> key)
(try\each (\ <equivalence> = value))
(try.else false))))]
@@ -154,9 +154,9 @@
<number> (number)
<string> (string)
<array_row> (row.row #/.Null
- (#/.Boolean <boolean>)
- (#/.Number <number>)
- (#/.String <string>))
+ {#/.Boolean <boolean>}
+ {#/.Number <number>}
+ {#/.String <string>})
<key0> (string)
<key1> (string)
<key2> (string)
@@ -167,13 +167,13 @@
(_.cover [/.json]
(and (\= #/.Null (/.json #null))
(~~ (template [<tag> <value>]
- [(\= (<tag> <value>) (/.json <value>))]
+ [(\= {<tag> <value>} (/.json <value>))]
[#/.Boolean <boolean>]
[#/.Number <number>]
[#/.String <string>]
))
- (\= (#/.Array <array_row>) (/.json [#null <boolean> <number> <string>]))
+ (\= {#/.Array <array_row>} (/.json [#null <boolean> <number> <string>]))
(let [object (/.json {<key0> #null
<key1> <boolean>
<key2> <number>
@@ -190,10 +190,10 @@
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))))))
+ (\= {#/.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 d595955b1..835ce822e 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)))
)))))
@@ -171,11 +171,11 @@
[(_.cover [<type>]
(|> (do try.monad
[expected_path (/.path expected_path)
- tar (|> (row.row (<tag> expected_path))
+ tar (|> (row.row {<tag> expected_path})
(format.result /.writer)
(<b>.result /.parser))]
(in (case (row.list tar)
- (^ (list (<tag> actual_path)))
+ (^ (list {<tag> actual_path}))
(text\= (/.from_path expected_path)
(/.from_path actual_path))
@@ -193,18 +193,18 @@
(|> (do try.monad
[expected_path (/.path expected_path)
expected_content (/.content content)
- tar (|> (row.row (<tag> [expected_path
+ tar (|> (row.row {<tag> [expected_path
expected_moment
/.none
[#/.user [#/.name /.anonymous
#/.id /.no_id]
#/.group [#/.name /.anonymous
#/.id /.no_id]]
- expected_content]))
+ expected_content]})
(format.result /.writer)
(<b>.result /.parser))]
(in (case (row.list tar)
- (^ (list (<tag> [actual_path actual_moment actual_mode actual_ownership actual_content])))
+ (^ (list {<tag> [actual_path actual_moment actual_mode actual_ownership actual_content]}))
(let [seconds (: (-> Instant Int)
(|>> instant.relative (duration.ticks duration.second)))]
(and (text\= (/.from_path expected_path)
@@ -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]]
- content]))
+ 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]]
- content]))
+ 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,35 +324,35 @@
($_ _.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]]
- content]))
+ 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)))
(text\= (/.from_name /.anonymous)
@@ -365,18 +365,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)
/.none
[#/.user [#/.name /.anonymous
#/.id /.no_id]
#/.group [#/.name /.anonymous
#/.id /.no_id]]
- content]))
+ 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)))
(n.= (/.from_small /.no_id)
@@ -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/sum.lux b/stdlib/source/test/lux/data/sum.lux
index c0fae2333..bc1d9c70c 100644
--- a/stdlib/source/test/lux/data/sum.lux
+++ b/stdlib/source/test/lux/data/sum.lux
@@ -37,19 +37,19 @@
(_.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)
(: (Or Nat Nat))
- (case> (0 #0 actual) (n.= expected actual)
+ (case> {0 #0 actual} (n.= expected actual)
_ false)))
(_.cover [/.right]
(|> (/.right expected)
(: (Or Nat Nat))
- (case> (0 #1 actual) (n.= expected actual)
+ (case> {0 #1 actual} (n.= expected actual)
_ false)))
(_.cover [/.either]
(and (|> (/.left expected)
@@ -64,11 +64,11 @@
(and (|> (/.left expected)
(: (Or Nat Nat))
(/.then (n.+ shift) (n.- shift))
- (case> (0 #0 actual) (n.= (n.+ shift expected) actual) _ false))
+ (case> {0 #0 actual} (n.= (n.+ shift expected) actual) _ false))
(|> (/.right expected)
(: (Or Nat Nat))
(/.then (n.+ shift) (n.- shift))
- (case> (0 #1 actual) (n.= (n.- shift expected) actual) _ false))))
+ (case> {0 #1 actual} (n.= (n.- shift expected) actual) _ false))))
(do !
[size (\ ! each (n.% 5) random.nat)
expected (random.list size random.nat)]
diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux
index ea5bfce13..305268a0b 100644
--- a/stdlib/source/test/lux/data/text.lux
+++ b/stdlib/source/test/lux/data/text.lux
@@ -152,9 +152,9 @@
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)
_
@@ -210,7 +210,7 @@
(/.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))
@@ -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 43242b1cf..6a658d960 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 141705e33..ddd4d0afb 100644
--- a/stdlib/source/test/lux/data/text/format.lux
+++ b/stdlib/source/test/lux/data/text/format.lux
@@ -170,7 +170,7 @@
#.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 b77909f5a..554a47eff 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!_)
@@ -259,27 +259,27 @@
Test
($_ _.and
(_.test "Can specify alternative patterns."
- (and (should_check ["a" (0 #0 [])] (/.regex "a|b") "a")
- (should_check ["b" (0 #1 [])] (/.regex "a|b") "b")
+ (and (should_check ["a" {0 #0 []}] (/.regex "a|b") "a")
+ (should_check ["b" {0 #1 []}] (/.regex "a|b") "b")
(should_fail (/.regex "a|b") "c")))
(_.test "Can have groups within alternations."
- (and (should_check ["abc" (0 #0 ["b" "c"])] (/.regex "a(.)(.)|b(.)(.)") "abc")
- (should_check ["bcd" (0 #1 ["c" "d"])] (/.regex "a(.)(.)|b(.)(.)") "bcd")
+ (and (should_check ["abc" {0 #0 ["b" "c"]}] (/.regex "a(.)(.)|b(.)(.)") "abc")
+ (should_check ["bcd" {0 #1 ["c" "d"]}] (/.regex "a(.)(.)|b(.)(.)") "bcd")
(should_fail (/.regex "a(.)(.)|b(.)(.)") "cde")
- (should_check ["123-456-7890" (0 #0 ["123" "456-7890" "456" "7890"])]
+ (should_check ["123-456-7890" {0 #0 ["123" "456-7890" "456" "7890"]}]
(/.regex "(\d{3})-((\d{3})-(\d{4}))|b(.)d")
"123-456-7890")))
))
(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)
- false)))])))
+ {#try.Failure error}
+ false)))]}))
(def: .public test
Test
diff --git a/stdlib/source/test/lux/debug.lux b/stdlib/source/test/lux/debug.lux
index fbd5a9b12..80f78b281 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)]
+ [{#.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 0fd8ffff1..d4979d44e 100644
--- a/stdlib/source/test/lux/documentation.lux
+++ b/stdlib/source/test/lux/documentation.lux
@@ -22,12 +22,12 @@
(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 _)
- false)))])))
+ {#try.Success _}
+ false)))]}))
(syntax: (description [])
(\ meta.monad each
diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux
index 52994d6a1..6076ca6ee 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,13 +74,13 @@
(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
@@ -89,15 +89,15 @@
(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 431e72641..0e5933bbb 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
@@ -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]
@@ -165,10 +165,10 @@
(and (|> (/.??? (/.null))
(: (Maybe java/lang/Object))
(case> #.None #1
- (#.Some _) #0))
+ {#.Some _} #0))
(|> (/.??? sample)
(: (Maybe java/lang/Object))
- (case> (#.Some _) #1
+ (case> {#.Some _} #1
#.None #0))))
(_.cover [/.!!!]
(and (|> (/.??? (/.null))
@@ -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,10 +586,10 @@
(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
diff --git a/stdlib/source/test/lux/ffi.lua.lux b/stdlib/source/test/lux/ffi.lua.lux
index 96e4b7ec8..1e20f80ca 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
+ {#.Some _} true
#.None true))
)))))
diff --git a/stdlib/source/test/lux/ffi.old.lux b/stdlib/source/test/lux/ffi.old.lux
index df05fdf29..7f53f7da4 100644
--- a/stdlib/source/test/lux/ffi.old.lux
+++ b/stdlib/source/test/lux/ffi.old.lux
@@ -182,7 +182,7 @@
(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 ed9bb4970..f8856abca 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))
)))
@@ -77,9 +77,9 @@
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))]
+ 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 694a10f7d..2266d973a 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))))))
@@ -70,7 +70,7 @@
#.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
- #.current_module (#.Some current_module)
+ #.current_module {#.Some current_module}
#.modules (list [macro_module
[#.module_hash 0
#.module_aliases (list)
@@ -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 1e694ada1..f14970009 100644
--- a/stdlib/source/test/lux/macro/code.lux
+++ b/stdlib/source/test/lux/macro/code.lux
@@ -67,11 +67,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]))
@@ -110,15 +110,15 @@
[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)]
+ [location.dummy {<tag> expected}]
(<coverage> expected)))))]
[/.bit random.bit #.Bit]
@@ -137,15 +137,15 @@
[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])]
+ [location.dummy {<tag> ["" expected]}]
(<coverage> expected)))
))]
diff --git a/stdlib/source/test/lux/macro/local.lux b/stdlib/source/test/lux/macro/local.lux
index 1016ccdef..b36094399 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
@@ -54,8 +54,8 @@
(let [remove_macro! (: (-> .Module .Module)
(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)]
(exec (~ pop!)
diff --git a/stdlib/source/test/lux/macro/syntax/check.lux b/stdlib/source/test/lux/macro/syntax/check.lux
index 8ea3f25e5..de1e3fe56 100644
--- a/stdlib/source/test/lux/macro/syntax/check.lux
+++ b/stdlib/source/test/lux/macro/syntax/check.lux
@@ -40,9 +40,9 @@
(case (<code>.result /.parser
(list (/.format [#/.type type
#/.value value])))
- (#try.Failure _)
+ {#try.Failure _}
false
- (#try.Success 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 e87028628..f14762ad6 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 cb5867a2a..b76f75cdb 100644
--- a/stdlib/source/test/lux/macro/syntax/definition.lux
+++ b/stdlib/source/test/lux/macro/syntax/definition.lux
@@ -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 17396ad9c..ac95210a2 100644
--- a/stdlib/source/test/lux/macro/syntax/export.lux
+++ b/stdlib/source/test/lux/macro/syntax/export.lux
@@ -33,7 +33,7 @@
[[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
diff --git a/stdlib/source/test/lux/macro/syntax/input.lux b/stdlib/source/test/lux/macro/syntax/input.lux
index bed8f2768..b822f1b94 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 8a79d62a5..74263e302 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
diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux
index d7e6d1000..d4887967e 100644
--- a/stdlib/source/test/lux/math/logic/fuzzy.lux
+++ b/stdlib/source/test/lux/math/logic/fuzzy.lux
@@ -93,7 +93,7 @@
(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))))
@@ -177,7 +177,7 @@
(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))))]
diff --git a/stdlib/source/test/lux/math/modular.lux b/stdlib/source/test/lux/math/modular.lux
index 0cb8a6456..bee6e09a5 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,7 +96,7 @@
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)
@@ -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 74a61ff8c..d13cb6817 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 861a8bfdb..6614235b4 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/i64.lux b/stdlib/source/test/lux/math/number/i64.lux
index fd8d55789..a9bde8474 100644
--- a/stdlib/source/test/lux/math/number/i64.lux
+++ b/stdlib/source/test/lux/math/number/i64.lux
@@ -128,7 +128,7 @@
(_.cover [/.sub]
(n.= 0 size))
- (#.Some sub)
+ {#.Some sub}
(do [! random.monad]
[.let [limit (|> (-- (\ sub width))
/.mask
diff --git a/stdlib/source/test/lux/math/number/ratio.lux b/stdlib/source/test/lux/math/number/ratio.lux
index 332345387..2bced4d50 100644
--- a/stdlib/source/test/lux/math/number/ratio.lux
+++ b/stdlib/source/test/lux/math/number/ratio.lux
@@ -79,7 +79,7 @@
with_denominator!
(case (/.nat (/.ratio numerator denominator))
- (#.Some factor)
+ {#.Some factor}
(and (n.= 0 (n.% denominator numerator))
(n.= numerator (n.* factor denominator)))
@@ -111,7 +111,7 @@
(and (/.= right
(|> div (/.* left) (/.+ rem)))
(case (/.nat div)
- (#.Some _) true
+ {#.Some _} true
#.None false)))))
(do random.monad
[left ..random
diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux
index fa5e55c24..86af8bc90 100644
--- a/stdlib/source/test/lux/meta.lux
+++ b/stdlib/source/test/lux/meta.lux
@@ -54,13 +54,13 @@
#.mode #.Build]
#.source [location.dummy 0 source_code]
#.location location.dummy
- #.current_module (#.Some expected_current_module)
+ #.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)))
+ #.expected {#.Some {#.Primitive primitive_type (list)}}
#.seed expected_seed
#.scope_type_vars (list)
#.extensions []
@@ -70,18 +70,18 @@
(_.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)))))
)))
@@ -102,13 +102,13 @@
#.mode #.Build]
#.source [location.dummy 0 source_code]
#.location location.dummy
- #.current_module (#.Some expected_current_module)
+ #.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)))
+ #.expected {#.Some {#.Primitive primitive_type (list)}}
#.seed expected_seed
#.scope_type_vars (list)
#.extensions []
@@ -119,43 +119,43 @@
(|> (/.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))))
))
)))
@@ -197,13 +197,13 @@
#.mode #.Build]
#.source [location.dummy 0 source_code]
#.location location.dummy
- #.current_module (#.Some expected_current_module)
+ #.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)))
+ #.expected {#.Some {#.Primitive primitive_type (list)}}
#.seed expected_seed
#.scope_type_vars (list)
#.extensions []
@@ -214,29 +214,29 @@
(_.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,7 +284,7 @@
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
@@ -298,11 +298,11 @@
#.mode #.Build]
#.source [location.dummy 0 source_code]
#.location expected_location
- #.current_module (#.Some expected_current_module)
+ #.current_module {#.Some expected_current_module}
#.modules (list)
#.scopes (list)
#.type_context type_context
- #.expected (#.Some expected_type)
+ #.expected {#.Some expected_type}
#.seed expected_seed
#.scope_type_vars (list)
#.extensions []
@@ -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,12 +355,12 @@
(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
(list)))]
@@ -371,7 +371,7 @@
#.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
- #.current_module (#.Some expected_current_module)
+ #.current_module {#.Some expected_current_module}
#.modules (list [expected_current_module
[#.module_hash 0
#.module_aliases (list)
@@ -397,54 +397,54 @@
($_ _.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,12 +470,12 @@
(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
(list)))]
@@ -486,7 +486,7 @@
#.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
- #.current_module (#.Some expected_current_module)
+ #.current_module {#.Some expected_current_module}
#.modules (list [expected_current_module
[#.module_hash 0
#.module_aliases (list)
@@ -512,44 +512,44 @@
($_ _.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)]
(|> (/.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,11 +644,11 @@
(\ ! each set.list)
(random.and (in head)))))]
tags_0 random_labels
- tags_1 (let [set/0 (set.of_list text.hash (#.Item tags_0))]
+ 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
@@ -657,7 +657,7 @@
#.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
- #.current_module (#.Some current_module)
+ #.current_module {#.Some current_module}
#.modules (list [current_module
[#.module_hash 0
#.module_aliases (list)
@@ -667,17 +667,17 @@
[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)])]
+ #.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)
+ [(format "#" 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])])))))
+ [(format "#" short) {#.Slot [true type_1 {#.Item tags_1} index]}])))))
#.imports (list)
#.module_state #.Active]])
#.scopes (list)
@@ -698,29 +698,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,19 +742,19 @@
(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))
+ .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 []])]))
+ {#.Definition [false type_4 []]}]))
scopes (list [#.name (list)
#.inner 0
@@ -782,7 +782,7 @@
#.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
- #.current_module (#.Some current_module)
+ #.current_module {#.Some current_module}
#.modules (list [current_module
[#.module_hash 0
#.module_aliases (list)
@@ -866,7 +866,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,7 +883,7 @@
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
@@ -894,13 +894,13 @@
#.mode #.Build]
#.source [expected_location 0 source_code]
#.location expected_location
- #.current_module (#.Some expected_current_module)
+ #.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)
+ #.expected {#.Some expected_type}
#.seed expected_seed
#.scope_type_vars (list)
#.extensions []
@@ -923,7 +923,7 @@
(: (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
@@ -931,7 +931,7 @@
(: (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 6dc3667c2..18bc932e8 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 048d0511b..d603b4d85 100644
--- a/stdlib/source/test/lux/static.lux
+++ b/stdlib/source/test/lux/static.lux
@@ -31,7 +31,7 @@
<right> (<random>)
<l+r> (<static> (<+> <left> <right>))]
(case (' <l+r>)
- [_ (<tag> l+r)]
+ [_ {<tag> l+r}]
(<=> l+r (<+> <left> <right>))
_
@@ -46,7 +46,7 @@
<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 9fa008544..0d17df0ff 100644
--- a/stdlib/source/test/lux/target/jvm.lux
+++ b/stdlib/source/test/lux/target/jvm.lux
@@ -117,9 +117,9 @@
method_name
(/type.method [(list) (list) ..$Object (list)])
(list)
- (#.Some (do /.monad
+ {#.Some (do /.monad
[_ bytecode]
- /.areturn))))
+ /.areturn)}))
(row.row))
.let [bytecode (format.result /class.writer class)
loader (/loader.memory (/loader.new_library []))]
@@ -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)
@@ -869,14 +869,14 @@
_ /.aload_0
_ /.lload_1
_ (/.putfield $Self object_field /type.long)]
- /.return)))
+ /.return)})
(/method.method ($_ /modifier\composite
/method.public
/method.static)
static_method
(/type.method [(list) (list) ..$Long (list)])
(list)
- (#.Some (do /.monad
+ {#.Some (do /.monad
[_ (/.new $Self)
_ /.dup
_ (..$Long::literal part1)
@@ -885,7 +885,7 @@
_ (/.getstatic $Self class_field /type.long)
_ /.ladd
_ ..$Long::wrap]
- /.areturn))))
+ /.areturn)}))
(row.row))
try.trusted
(format.result /class.writer))
@@ -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,23 +1337,23 @@
primitive_method_name
primitive_method_type
(list)
- (#.Some (do /.monad
+ {#.Some (do /.monad
[_ ((value@ #literal primitive) expected)]
- return)))
+ 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
(in [])
- (#.Some substitute)
+ {#.Some substitute}
(substitute expected))
_ (value@ #wrap primitive)]
- /.areturn))))
+ /.areturn)}))
(row.row))
.let [bytecode (format.result /class.writer class)
loader (/loader.memory (/loader.new_library []))]
@@ -1361,10 +1361,10 @@
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
@@ -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,9 +1623,9 @@
name
method::type
(list)
- (#.Some (do /.monad
+ {#.Some (do /.monad
[_ (..$Long::literal value)]
- /.lreturn)))))
+ /.lreturn)})))
interface_bytecode (|> (/class.class /version.v6_0 ($_ /modifier\composite /class.public /class.abstract /class.interface)
(/name.internal interface_class)
@@ -1646,10 +1646,10 @@
"<init>"
constructor::type
(list)
- (#.Some (do /.monad
+ {#.Some (do /.monad
[_ /.aload_0
_ (/.invokespecial ..$Object "<init>" constructor::type)]
- /.return)))
+ /.return)})
(method inherited_method part0)
(method overriden_method fake_part2)
(/method.method ($_ /modifier\composite /method.public /method.abstract)
@@ -1671,10 +1671,10 @@
"<init>"
constructor::type
(list)
- (#.Some (do /.monad
+ {#.Some (do /.monad
[_ /.aload_0
_ (/.invokespecial $Abstract "<init>" constructor::type)]
- /.return)))
+ /.return)})
(method virtual_method part1)
(method overriden_method part2)
(method abstract_method part3)
@@ -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)
@@ -1700,7 +1700,7 @@
_ (invoke $Abstract abstract_method)
_ /.ladd
_ ..$Long::wrap]
- /.areturn))))
+ /.areturn)}))
(row.row))
try.trusted
(format.result /class.writer))
@@ -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/time.lux b/stdlib/source/test/lux/time.lux
index 178818c3e..32bb9d67c 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 5862b2ea5..24d18c5b9 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 f1bcc932d..04d267d79 100644
--- a/stdlib/source/test/lux/time/day.lux
+++ b/stdlib/source/test/lux/time/day.lux
@@ -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,10 +73,10 @@
(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)
diff --git a/stdlib/source/test/lux/time/instant.lux b/stdlib/source/test/lux/time/instant.lux
index f25348f9a..57050174e 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 7e4ad8433..4db1303b3 100644
--- a/stdlib/source/test/lux/time/month.lux
+++ b/stdlib/source/test/lux/time/month.lux
@@ -64,10 +64,10 @@
(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)
@@ -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 121d74822..1d949bf44 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 4f87450ba..c152bb5c2 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
@@ -44,28 +44,28 @@
#.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>]
- [[_ (<tag> _)]
+ [[_ {<tag> _}]
(if allow_literals?
(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)))
@@ -79,20 +79,20 @@
[#.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,11 +163,11 @@
////analysis.with_scope
(do phase.monad
[_ (//module.declare_tags variant_tags false
- (#.Named [module_name variant_name]
- (type.variant primitivesT)))
+ {#.Named [module_name variant_name]
+ (type.variant primitivesT)})
_ (//module.declare_tags record_tags false
- (#.Named [module_name record_name]
- (type.tuple primitivesT)))])
+ {#.Named [module_name record_name]
+ (type.tuple primitivesT)})])
(//module.with_module 0 module_name)))]
exhaustive_patterns (exhaustive_branches true variantTC inputC)
.let [exhaustive_branchesC (list\each (branch outputC)
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 afd5276d4..73ef650e6 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 d3ef99670..1ca30c317 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))
(|> (infer Any (..phase archive.empty (' [])))
- (case> (^ (#try.Success (#////analysis.Primitive (#////analysis.Unit output))))
+ (case> (^ {#try.Success {#////analysis.Primitive {#////analysis.Unit output}}})
(same? [] output)
_
@@ -99,7 +99,7 @@
[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)
_
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 1db1336ea..981b2604f 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 4ad22a9fe..9d276e070 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>
_
@@ -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 2528ff9c1..aaf4f1ae6 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 af22d952d..881c2f678 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,10 +171,10 @@
[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)))))
+ (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))
@@ -198,11 +198,11 @@
[[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))))
+ {#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)]
@@ -237,10 +237,10 @@
(function (_ lefts right? value body)
($_ #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
@@ -276,17 +276,17 @@
(if right?
($_ #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.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.Then (synthesis.f64 body)}))))
branch (: (-> Nat Bit Text Frac Branch)
(function (_ lefts right? value body)
[#analysis.when (if right?
@@ -298,10 +298,10 @@
(analysis.pattern/unit)))))
#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 8c8b6c4a5..5396c5b9c 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
@@ -52,12 +52,12 @@
(-> Arity Analysis Analysis)
(list\mix (function (_ arity_1 body)
(case arity_1
- 0 (#analysis.Function (list) body)
- _ (#analysis.Function ($_ list\composite
+ 0 {#analysis.Function (list) body}
+ _ {#analysis.Function ($_ list\composite
(list\each (|>> #variable.Foreign)
(list.indices arity_1))
- (list (#variable.Local 1)))
- body)))
+ (list {#variable.Local 1}))
+ body}))
body
(list.reversed (list.indices arity))))
@@ -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
- (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])])])))
+ {#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])]}])))
(def: (random_let arity random_value output?)
(-> Arity Scenario Scenario)
@@ -246,10 +246,10 @@
(synthesis.branch/let [expected_input
(++ arity)
expected_output])
- (#analysis.Case actual_input
- [[#analysis.when (#analysis.Bind 2)
- #analysis.then actual_output]
- (list)])])))
+ {#analysis.Case actual_input
+ [[#analysis.when {#analysis.Bind 2}
+ #analysis.then actual_output]
+ (list)]}])))
(def: (random_if random_value output?)
(-> Scenario Scenario)
@@ -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,17 +284,17 @@
[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
- (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.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)]}])))
(def: (random_branch arity random_value output?)
(-> Arity Scenario Scenario)
@@ -309,9 +309,9 @@
[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)))
+ _ (reference.foreign 0))}
(list\each (|>> product.right product.right) resets)])])))
(def: (random_scope arity output?)
@@ -347,7 +347,7 @@
.let [environment ($_ list\composite
(list\each (|>> #variable.Foreign)
(list.indices arity))
- (list (#variable.Local 1)))]]
+ (list {#variable.Local 1}))]]
(in [true
(synthesis.function/abstraction
[#synthesis.environment environment
@@ -356,8 +356,8 @@
[#synthesis.start 1
#synthesis.inits (list)
#synthesis.iteration expected_output])])
- (#analysis.Function environment
- actual_output)])))
+ {#analysis.Function environment
+ actual_output}])))
(def: (random_apply random_value output?)
(-> Scenario Scenario)
@@ -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 63a6f2546..c27d08c14 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)
@@ -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)
@@ -279,8 +279,8 @@
(list\each (|>> #variable.Local)))
#//.arity arity
#//.body iteration])
- (^ (#.Some (//.loop/scope [actual_offset actual_inits
- actual])))
+ (^ {#.Some (//.loop/scope [actual_offset actual_inits
+ actual])})
(and (n.= expected_offset
actual_offset)
(\ (list.equivalence //.equivalence) =
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 4b37cbb5a..79e26221b 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,14 +39,14 @@
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>))]
@@ -78,10 +78,10 @@
[(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)
_
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 60a4bdeec..c9334a880 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)))
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 7ba708602..b7713c5bd 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,31 +160,31 @@
(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)]
@@ -195,23 +195,23 @@
(do [! random.monad]
[side ..random_side
[expected_next actual_next] (path_scenario scenario context)]
- (in [(#synthesis.Seq (#synthesis.Access (#synthesis.Side side))
- expected_next)
- (#synthesis.Seq (#synthesis.Access (#synthesis.Side side))
- actual_next)]))
+ (in [{#synthesis.Seq {#synthesis.Access {#synthesis.Side side}}
+ expected_next}
+ {#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))
- expected_next)
- (#synthesis.Seq (#synthesis.Access (#synthesis.Member member))
- actual_next)])))
+ (in [{#synthesis.Seq {#synthesis.Access {#synthesis.Member member}}
+ expected_next}
+ {#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)
@@ -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 32dcae9de..e9daa8e53 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 94f7b92fd..65bcf2d81 100644
--- a/stdlib/source/test/lux/type.lux
+++ b/stdlib/source/test/lux/type.lux
@@ -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,7 +123,7 @@
(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))))
(do [! random.monad]
@@ -132,7 +132,7 @@
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))
_
diff --git a/stdlib/source/test/lux/type/abstract.lux b/stdlib/source/test/lux/type/abstract.lux
index 9004d7fbe..826569dae 100644
--- a/stdlib/source/test/lux/type/abstract.lux
+++ b/stdlib/source/test/lux/type/abstract.lux
@@ -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 d3825ef80..1f5c396e6 100644
--- a/stdlib/source/test/lux/type/check.lux
+++ b/stdlib/source/test/lux/type/check.lux
@@ -71,18 +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))])
+ [{<tag> left right}
+ (and (valid_type? left)
+ (valid_type? right))])
([#.Sum] [#.Product] [#.Function])
- (#.Named name type')
+ {#.Named name type'}
(valid_type? type')
_
@@ -96,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)
_
@@ -124,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
@@ -153,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)
@@ -196,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
@@ -233,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)
_
@@ -283,43 +284,43 @@
(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)
+ {#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)
+ {#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?
@@ -331,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])))
@@ -349,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!)))
@@ -372,15 +373,15 @@
(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))
(..fails? (/.check pair/0 pair/1)))
- super_pair (<combinator> Super Super)
- sub_pair (<combinator> Sub Sub)
+ super_pair {<combinator> Super Super}
+ sub_pair {<combinator> Sub Sub}
covariant!
(and (..succeeds? (/.check super_pair sub_pair))
@@ -395,22 +396,22 @@
(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 _)
- false)])))
+ {#try.Failure _}
+ false)]}))
(def: (build_ring tail_size)
(-> Nat (/.Check [Type (List Type) Type]))
@@ -577,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)
@@ -637,20 +638,20 @@
(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
rightT dirty_type]
(in (function (_ holeT)
- (<tag> (leftT holeT) (rightT holeT)))))]
+ {<tag> (leftT holeT) (rightT holeT)})))]
[#.Sum]
[#.Product]
@@ -661,15 +662,15 @@
[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
argT dirty_type
body random.nat]
(in (function (_ holeT)
- (<tag> (list (funcT holeT) (argT holeT))
- (#.Parameter body)))))]
+ {<tag> (list (funcT holeT) (argT holeT))
+ {#.Parameter body}})))]
[#.UnivQ]
[#.ExQ]
@@ -704,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)
@@ -726,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
@@ -743,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
@@ -758,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
@@ -773,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>]
@@ -787,8 +788,8 @@
(do random.monad
[id random.nat
example ..clean_type]
- (in (not (or (/.subsumes? (<tag> id) example)
- (/.subsumes? example (<tag> id)))))))]
+ (in (not (or (/.subsumes? {<tag> id} example)
+ (/.subsumes? example {<tag> id}))))))]
[#.Var for_subsumption|variable]
[#.Ex for_subsumption|existential]
@@ -809,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
@@ -850,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 b9787f8bf..695caa566 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/equivalence.lux b/stdlib/source/test/lux/type/poly/equivalence.lux
index 63854e535..738578386 100644
--- a/stdlib/source/test/lux/type/poly/equivalence.lux
+++ b/stdlib/source/test/lux/type/poly/equivalence.lux
@@ -25,15 +25,15 @@
(type: Variant
(.Variant
- (#Case0 Bit)
- (#Case1 Int)
- (#Case2 Frac)))
+ {#Case0 Bit}
+ {#Case1 Int}
+ {#Case2 Frac}))
(type: Recursive
(Rec Recursive
(.Variant
- (#Number Frac)
- (#Addition Frac Recursive))))
+ {#Number Frac}
+ {#Addition Frac Recursive})))
(type: Record
(.Record
diff --git a/stdlib/source/test/lux/type/poly/json.lux b/stdlib/source/test/lux/type/poly/json.lux
index 0f78aa976..0332e7d00 100644
--- a/stdlib/source/test/lux/type/poly/json.lux
+++ b/stdlib/source/test/lux/type/poly/json.lux
@@ -50,15 +50,15 @@
(type: Variant
(.Variant
- (#Bit Bit)
- (#Text Text)
- (#Frac Frac)))
+ {#Bit Bit}
+ {#Text Text}
+ {#Frac Frac}))
(type: Recursive
(Rec Recursive
(.Variant
- (#Number Frac)
- (#Addition Frac Recursive))))
+ {#Number Frac}
+ {#Addition Frac Recursive})))
(type: Record
(.Record
diff --git a/stdlib/source/test/lux/type/refinement.lux b/stdlib/source/test/lux/type/refinement.lux
index 1b2c17e36..bebde21e2 100644
--- a/stdlib/source/test/lux/type/refinement.lux
+++ b/stdlib/source/test/lux/type/refinement.lux
@@ -39,7 +39,7 @@
($_ _.and
(_.cover [/.refiner]
(case (/.refiner predicate raw)
- (#.Some refined)
+ {#.Some refined}
(predicate raw)
#.None
diff --git a/stdlib/source/test/lux/type/resource.lux b/stdlib/source/test/lux/type/resource.lux
index e8c4b0fba..f78fb8473 100644
--- a/stdlib/source/test/lux/type/resource.lux
+++ b/stdlib/source/test/lux/type/resource.lux
@@ -160,13 +160,13 @@
(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)
- true)))]))))
+ {#try.Failure error}
+ true)))]})))
(def: .public test
Test
diff --git a/stdlib/source/test/lux/world/console.lux b/stdlib/source/test/lux/world/console.lux
index 3f54d54a7..eaf882016 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 aee4f4922..5ad722723 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/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux
index 1f80ba26b..9a789fd70 100644
--- a/stdlib/source/test/lux/world/net/http/client.lux
+++ b/stdlib/source/test/lux/world/net/http/client.lux
@@ -59,11 +59,11 @@
data (|> value
(\ nat.decimal encoded)
(\ utf8.codec encoded))]
- (#try.Success [//status.ok
+ {#try.Success [//status.ok
[#//.headers headers
#//.body (function (_ ?wanted_bytes)
- (io.io (#try.Success [(binary.size data)
- data])))]]))))))]]
+ (io.io {#try.Success [(binary.size data)
+ data]}))]]})))))]]
(`` ($_ _.and
(~~ (template [<definition> <expected>]
[(_.cover [<definition>]
diff --git a/stdlib/source/test/lux/world/program.lux b/stdlib/source/test/lux/world/program.lux
index eafafecaa..c498a939b 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 8d98b5f1f..daa0a5e11 100644
--- a/stdlib/source/test/lux/world/shell.lux
+++ b/stdlib/source/test/lux/world/shell.lux
@@ -44,22 +44,22 @@
(def: (on_error 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))
@@ -70,15 +70,15 @@
(: (/.Process IO))
(implementation
(def: (read _)
- (io.io (#try.Success command)))
+ (io.io {#try.Success command}))
(def: (error _)
- (io.io (#try.Success oops)))
+ (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
@@ -103,20 +103,20 @@
error (\ process error [])
wrote! (do !
[write (\ process write input)]
- (in (#try.Success (case write
- (#try.Success _)
+ (in {#try.Success (case write
+ {#try.Success _}
false
- (#try.Failure write)
- (text\= input 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)
- (text\= destruction destroy)))))
+ {#try.Failure destroy}
+ (text\= destruction destroy))}))
await (\ process await [])]
(in (and (text\= command read)
(text\= oops error)