aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
authorEduardo Julian2022-03-14 18:27:37 -0400
committerEduardo Julian2022-03-14 18:27:37 -0400
commit41495e32d3f5f88b5f189f48dd4fdbfa883c6ac0 (patch)
tree7a561e83768d5ac4eb08855858dde38d2987fc46 /stdlib/source/test
parent62299ecdc93b39f6a22b1f89779f55dfa735fb3c (diff)
De-sigil-ification: >
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/aedifex/cli.lux70
-rw-r--r--stdlib/source/test/aedifex/command/auto.lux11
-rw-r--r--stdlib/source/test/aedifex/command/build.lux13
-rw-r--r--stdlib/source/test/aedifex/parser.lux29
-rw-r--r--stdlib/source/test/aedifex/profile.lux1
-rw-r--r--stdlib/source/test/lux/abstract/interval.lux38
-rw-r--r--stdlib/source/test/lux/control/concurrency/async.lux1
-rw-r--r--stdlib/source/test/lux/control/maybe.lux59
-rw-r--r--stdlib/source/test/lux/control/parser/analysis.lux120
-rw-r--r--stdlib/source/test/lux/control/parser/binary.lux95
-rw-r--r--stdlib/source/test/lux/control/parser/json.lux65
-rw-r--r--stdlib/source/test/lux/control/parser/synthesis.lux1
-rw-r--r--stdlib/source/test/lux/control/parser/type.lux1
-rw-r--r--stdlib/source/test/lux/control/pipe.lux115
-rw-r--r--stdlib/source/test/lux/control/state.lux58
-rw-r--r--stdlib/source/test/lux/control/try.lux53
-rw-r--r--stdlib/source/test/lux/data/collection/list.lux13
-rw-r--r--stdlib/source/test/lux/data/collection/tree/zipper.lux204
-rw-r--r--stdlib/source/test/lux/data/format/xml.lux1
-rw-r--r--stdlib/source/test/lux/data/sum.lux16
-rw-r--r--stdlib/source/test/lux/data/text.lux90
-rw-r--r--stdlib/source/test/lux/data/text/regex.lux80
-rw-r--r--stdlib/source/test/lux/ffi.jvm.lux45
-rw-r--r--stdlib/source/test/lux/ffi.old.lux12
-rw-r--r--stdlib/source/test/lux/meta/symbol.lux2
-rw-r--r--stdlib/source/test/lux/target/js.lux13
-rw-r--r--stdlib/source/test/lux/target/lua.lux7
-rw-r--r--stdlib/source/test/lux/target/python.lux1
-rw-r--r--stdlib/source/test/lux/target/ruby.lux7
-rw-r--r--stdlib/source/test/lux/time.lux87
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux86
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux21
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux22
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux82
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux7
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis/type.lux32
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux1
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux50
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux1
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux72
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux42
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/extension.lux47
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux75
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux59
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux65
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux98
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux1
-rw-r--r--stdlib/source/test/lux/tool/compiler/meta/archive.lux1
-rw-r--r--stdlib/source/test/lux/tool/compiler/meta/archive/module/document.lux53
-rw-r--r--stdlib/source/test/lux/tool/compiler/meta/cli.lux47
-rw-r--r--stdlib/source/test/lux/tool/compiler/meta/export.lux64
-rw-r--r--stdlib/source/test/lux/tool/compiler/meta/import.lux1
-rw-r--r--stdlib/source/test/lux/tool/compiler/phase.lux82
-rw-r--r--stdlib/source/test/lux/type.lux76
-rw-r--r--stdlib/source/test/lux/type/check.lux36
-rw-r--r--stdlib/source/test/lux/type/poly/json.lux1
-rw-r--r--stdlib/source/test/lux/world/net/http/client.lux12
-rw-r--r--stdlib/source/test/lux/world/program.lux66
58 files changed, 1301 insertions, 1207 deletions
diff --git a/stdlib/source/test/aedifex/cli.lux b/stdlib/source/test/aedifex/cli.lux
index 85e8e7bc5..0dd70ae6d 100644
--- a/stdlib/source/test/aedifex/cli.lux
+++ b/stdlib/source/test/aedifex/cli.lux
@@ -1,26 +1,26 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]
- [\\specification
- ["$[0]" equivalence]]]
- [control
- [pipe {"+" case>}]
- ["[0]" try]
- [parser
- ["[0]" cli]]]
- [data
- ["[0]" text]
- [collection
- ["[0]" list]]]
- [math
- ["[0]" random {"+" Random} ("[1]#[0]" monad)]]]]
- [\\program
- ["[0]" /
- ["/[1]" // "_"
- ["[1]" profile]]]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" equivalence]]]
+ [control
+ ["[0]" pipe]
+ ["[0]" try]
+ [parser
+ ["[0]" cli]]]
+ [data
+ ["[0]" text]
+ [collection
+ ["[0]" list]]]
+ [math
+ ["[0]" random {"+" Random} ("[1]#[0]" monad)]]]]
+ [\\program
+ ["[0]" /
+ ["/[1]" // "_"
+ ["[1]" profile]]]])
(def: compilation
(Random /.Compilation)
@@ -76,12 +76,13 @@
(|> expected
..format
(cli.result /.command)
- (case> {try.#Success [names actual]}
- (and (# (list.equivalence text.equivalence) = (list //.default) names)
- (# /.equivalence = expected actual))
-
- {try.#Failure error}
- false)))))
+ (pipe.case
+ {try.#Success [names actual]}
+ (and (# (list.equivalence text.equivalence) = (list //.default) names)
+ (# /.equivalence = expected actual))
+
+ {try.#Failure error}
+ false)))))
(def: with_profile
Test
@@ -93,12 +94,13 @@
..format
(list& "with" expected_profile)
(cli.result /.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}
- false)))))
+ (pipe.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}
+ false)))))
(def: .public test
Test
diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux
index a9e9c56fb..bfdbb789e 100644
--- a/stdlib/source/test/aedifex/command/auto.lux
+++ b/stdlib/source/test/aedifex/command/auto.lux
@@ -5,7 +5,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try]
[parser
["[0]" environment]]
@@ -110,11 +110,12 @@
fs
(shell.async ($build.good_shell []))
resolution)
- (# ! each (|>> (case> {try.#Failure error}
- (same? end_signal error)
+ (# ! each (|>> (pipe.case
+ {try.#Failure error}
+ (same? end_signal error)
- {try.#Success _}
- false))))
+ {try.#Success _}
+ false))))
correct_number_of_runs! (|> @runs
atom.read!
async.future
diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux
index 0b8eac768..f8d2d46ec 100644
--- a/stdlib/source/test/aedifex/command/build.lux
+++ b/stdlib/source/test/aedifex/command/build.lux
@@ -5,8 +5,8 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
[io {"+" IO}]
+ ["[0]" pipe]
["[0]" try]
["[0]" exception]
[concurrency
@@ -232,11 +232,12 @@
actual/1 (# console read_line [])
actual/2 (# console read_line [])
end! (|> (# console read_line [])
- (# ! each (|>> (case> {try.#Failure error}
- true
-
- {try.#Success _}
- false)
+ (# ! each (|>> (pipe.case
+ {try.#Failure error}
+ true
+
+ {try.#Success _}
+ false)
{try.#Success})))]
(in (and (text#= expected/0 actual/0)
(text#= expected/1 actual/1)
diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux
index 1d3168d93..f529c2d0a 100644
--- a/stdlib/source/test/aedifex/parser.lux
+++ b/stdlib/source/test/aedifex/parser.lux
@@ -6,7 +6,7 @@
[monad {"+" do}]
[hash {"+" Hash}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try]
[parser
["<[0]>" code]]]
@@ -84,16 +84,17 @@
//format.project
list
(<code>.result /.project)
- (case> {try.#Success actual}
- (|> expected
- ..with_empty_profile
- dictionary.entries
- (list#each (function (_ [name profile])
- [name (|> profile
- ..with_default_sources
- ..with_default_repository)]))
- (dictionary.of_list text.hash)
- (# //project.equivalence = actual))
-
- {try.#Failure error}
- false))))))
+ (pipe.case
+ {try.#Success actual}
+ (|> expected
+ ..with_empty_profile
+ dictionary.entries
+ (list#each (function (_ [name profile])
+ [name (|> profile
+ ..with_default_sources
+ ..with_default_repository)]))
+ (dictionary.of_list text.hash)
+ (# //project.equivalence = actual))
+
+ {try.#Failure error}
+ false))))))
diff --git a/stdlib/source/test/aedifex/profile.lux b/stdlib/source/test/aedifex/profile.lux
index 1cfc7eb40..c7f63d254 100644
--- a/stdlib/source/test/aedifex/profile.lux
+++ b/stdlib/source/test/aedifex/profile.lux
@@ -9,7 +9,6 @@
["$[0]" equivalence]
["$[0]" monoid]]]
[control
- [pipe {"+" case>}]
["[0]" try]
[parser
["[0]" cli]]]
diff --git a/stdlib/source/test/lux/abstract/interval.lux b/stdlib/source/test/lux/abstract/interval.lux
index e4cf534e0..a9dfc2572 100644
--- a/stdlib/source/test/lux/abstract/interval.lux
+++ b/stdlib/source/test/lux/abstract/interval.lux
@@ -8,7 +8,7 @@
[\\specification
["$[0]" equivalence]]]
[control
- [pipe {"+" case>}]]
+ ["[0]" pipe]]
[data
[collection
["[0]" set]
@@ -141,11 +141,12 @@
[[l m r] (|> (random.set n.hash 3 random.nat)
(# ! each (|>> set.list
(list.sorted n.<)
- (case> (^ (list b t1 t2))
- [b t1 t2]
+ (pipe.case
+ (^ (list b t1 t2))
+ [b t1 t2]
- _
- (undefined)))))
+ _
+ (undefined)))))
.let [left (/.singleton n.enum l)
right (/.singleton n.enum r)]]
($_ _.and
@@ -163,11 +164,12 @@
[[b t1 t2] (|> (random.set n.hash 3 random.nat)
(# ! each (|>> set.list
(list.sorted n.<)
- (case> (^ (list b t1 t2))
- [b t1 t2]
+ (pipe.case
+ (^ (list b t1 t2))
+ [b t1 t2]
- _
- (undefined)))))
+ _
+ (undefined)))))
.let [int_left (/.between n.enum t1 t2)
int_right (/.between n.enum b t1)]]
($_ _.and
@@ -190,11 +192,12 @@
[x0 x1 x2 x3] (|> (random.set n.hash 4 random.nat)
(# ! each (|>> set.list
(list.sorted n.<)
- (case> (^ (list x0 x1 x2 x3))
- [x0 x1 x2 x3]
+ (pipe.case
+ (^ (list x0 x1 x2 x3))
+ [x0 x1 x2 x3]
- _
- (undefined)))))]
+ _
+ (undefined)))))]
($_ _.and
(_.test "Every interval is nested into itself."
(/.nested? some_interval some_interval))
@@ -223,11 +226,12 @@
[x0 x1 x2 x3] (|> (random.set n.hash 4 random.nat)
(# ! each (|>> set.list
(list.sorted n.<)
- (case> (^ (list x0 x1 x2 x3))
- [x0 x1 x2 x3]
+ (pipe.case
+ (^ (list x0 x1 x2 x3))
+ [x0 x1 x2 x3]
- _
- (undefined)))))]
+ _
+ (undefined)))))]
($_ _.and
(_.test "No interval overlaps with itself."
(not (/.overlaps? some_interval some_interval)))
diff --git a/stdlib/source/test/lux/control/concurrency/async.lux b/stdlib/source/test/lux/control/concurrency/async.lux
index 7f844f558..faff80b79 100644
--- a/stdlib/source/test/lux/control/concurrency/async.lux
+++ b/stdlib/source/test/lux/control/concurrency/async.lux
@@ -10,7 +10,6 @@
["$[0]" apply]
["$[0]" monad]]]
[control
- [pipe {"+" case>}]
["[0]" io]]
[time
["[0]" instant]
diff --git a/stdlib/source/test/lux/control/maybe.lux b/stdlib/source/test/lux/control/maybe.lux
index fe8528548..6fefaecfe 100644
--- a/stdlib/source/test/lux/control/maybe.lux
+++ b/stdlib/source/test/lux/control/maybe.lux
@@ -1,29 +1,29 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]
- [\\specification
- ["$[0]" equivalence]
- ["$[0]" hash]
- ["$[0]" monoid]
- ["$[0]" functor]
- ["$[0]" apply]
- ["$[0]" monad]]]
- [control
- ["[0]" io ("[1]#[0]" monad)]
- pipe]
- [data
- ["[0]" text]
- [collection
- ["[0]" list]]]
- [math
- ["[0]" random {"+" Random}]
- [number
- ["n" nat]]]]]
- [\\library
- ["[0]" / ("[1]#[0]" monoid monad)]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" equivalence]
+ ["$[0]" hash]
+ ["$[0]" monoid]
+ ["$[0]" functor]
+ ["$[0]" apply]
+ ["$[0]" monad]]]
+ [control
+ ["[0]" io ("[1]#[0]" monad)]
+ ["[0]" pipe]]
+ [data
+ ["[0]" text]
+ [collection
+ ["[0]" list]]]
+ [math
+ ["[0]" random {"+" Random}]
+ [number
+ ["n" nat]]]]]
+ [\\library
+ ["[0]" / ("[1]#[0]" monoid monad)]])
(def: .public test
Test
@@ -55,11 +55,12 @@
[a (lifted (io#in left))
b (in right)]
(in (n.+ a b))))
- (case> {.#Some actual}
- (n.= expected actual)
+ (pipe.case
+ {.#Some actual}
+ (n.= expected actual)
- _
- false)))))
+ _
+ false)))))
(do random.monad
[default random.nat
value random.nat]
diff --git a/stdlib/source/test/lux/control/parser/analysis.lux b/stdlib/source/test/lux/control/parser/analysis.lux
index a3f401643..074115336 100644
--- a/stdlib/source/test/lux/control/parser/analysis.lux
+++ b/stdlib/source/test/lux/control/parser/analysis.lux
@@ -1,37 +1,37 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]]
- [control
- [pipe {"+" case>}]
- ["[0]" try]
- ["[0]" exception]
- ["<>" parser]]
- [data
- ["[0]" bit ("[1]#[0]" equivalence)]
- ["[0]" text ("[1]#[0]" equivalence)]
- [collection
- ["[0]" list]]]
- [math
- ["[0]" random {"+" Random}]
- [number
- ["n" nat]
- ["i" int]
- ["f" frac]
- ["r" rev]]]
- [meta
- ["[0]" symbol ("[1]#[0]" equivalence)]]
- [tool
- [compiler
- [reference {"+" Constant}
- [variable {"+"}]]
- [language
- [lux
- ["[0]" analysis]]]]]]]
- [\\library
- ["[0]" /]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" pipe]
+ ["[0]" try]
+ ["[0]" exception]
+ ["<>" parser]]
+ [data
+ ["[0]" bit ("[1]#[0]" equivalence)]
+ ["[0]" text ("[1]#[0]" equivalence)]
+ [collection
+ ["[0]" list]]]
+ [math
+ ["[0]" random {"+" Random}]
+ [number
+ ["n" nat]
+ ["i" int]
+ ["f" frac]
+ ["r" rev]]]
+ [meta
+ ["[0]" symbol ("[1]#[0]" equivalence)]]
+ [tool
+ [compiler
+ [reference {"+" Constant}
+ [variable {"+"}]]
+ [language
+ [lux
+ ["[0]" analysis]]]]]]]
+ [\\library
+ ["[0]" /]])
(template: (!expect <expectation> <computation>)
[(case <computation>
@@ -58,22 +58,24 @@
(_.cover [/.result /.any]
(|> (list expected)
(/.result /.any)
- (case> {try.#Success actual}
- (# analysis.equivalence = expected actual)
+ (pipe.case
+ {try.#Success actual}
+ (# analysis.equivalence = expected actual)
- {try.#Failure _}
- false))))
+ {try.#Failure _}
+ false))))
(~~ (template [<query> <check> <random> <analysis> <=>]
[(do [! random.monad]
[expected <random>]
(_.cover [<query>]
(|> (list (<analysis> expected))
(/.result <query>)
- (case> {try.#Success actual}
- (<=> expected actual)
+ (pipe.case
+ {try.#Success actual}
+ (<=> expected actual)
- {try.#Failure _}
- false))))
+ {try.#Failure _}
+ false))))
(do [! random.monad]
[expected <random>]
(_.cover [<check>]
@@ -96,11 +98,12 @@
(_.cover [/.tuple]
(|> (list (analysis.tuple (list (analysis.bit expected))))
(/.result (/.tuple /.bit))
- (case> {try.#Success actual}
- (bit#= expected actual)
+ (pipe.case
+ {try.#Success actual}
+ (bit#= expected actual)
- {try.#Failure _}
- false))))
+ {try.#Failure _}
+ false))))
(do [! random.monad]
[dummy random.bit]
(_.cover [/.end?]
@@ -124,26 +127,29 @@
(_.cover [/.cannot_parse]
(and (|> (list (analysis.bit expected))
(/.result /.nat)
- (case> {try.#Success _}
- false
+ (pipe.case
+ {try.#Success _}
+ false
- {try.#Failure error}
- (exception.match? /.cannot_parse error)))
+ {try.#Failure error}
+ (exception.match? /.cannot_parse error)))
(|> (list)
(/.result /.bit)
- (case> {try.#Success _}
- false
+ (pipe.case
+ {try.#Success _}
+ false
- {try.#Failure error}
- (exception.match? /.cannot_parse 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 _}
- false
+ (pipe.case
+ {try.#Success _}
+ false
- {try.#Failure error}
- (exception.match? /.unconsumed_input 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 482f3603a..11cca9980 100644
--- a/stdlib/source/test/lux/control/parser/binary.lux
+++ b/stdlib/source/test/lux/control/parser/binary.lux
@@ -1,46 +1,46 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- ["[0]" type]
- [abstract
- [equivalence {"+" Equivalence}]
- [predicate {"+" Predicate}]
- [monad {"+" do}]]
- [control
- [pipe {"+" case>}]
- ["[0]" maybe]
- ["[0]" try]
- ["[0]" exception]
- ["<>" parser]]
- [data
- ["[0]" binary]
- ["[0]" sum]
- ["[0]" bit]
- ["[0]" text ("[1]#[0]" equivalence)
- ["%" format {"+" format}]
- [encoding
- ["[0]" utf8]]]
- ["[0]" format "_"
- ["[1]" binary]]
- [collection
- ["[0]" list]
- ["[0]" sequence]
- ["[0]" set]]]
- [macro
- ["[0]" code]]
- [math
- ["[0]" random {"+" Random}]
- [number
- ["n" nat]
- ["[0]" i64]
- ["[0]" int]
- ["[0]" rev]
- ["[0]" frac]]]
- [meta
- ["[0]" symbol]]]]
- [\\library
- ["[0]" /]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ ["[0]" type]
+ [abstract
+ [equivalence {"+" Equivalence}]
+ [predicate {"+" Predicate}]
+ [monad {"+" do}]]
+ [control
+ ["[0]" pipe]
+ ["[0]" maybe]
+ ["[0]" try]
+ ["[0]" exception]
+ ["<>" parser]]
+ [data
+ ["[0]" binary]
+ ["[0]" sum]
+ ["[0]" bit]
+ ["[0]" text ("[1]#[0]" equivalence)
+ ["%" format {"+" format}]
+ [encoding
+ ["[0]" utf8]]]
+ ["[0]" format "_"
+ ["[1]" binary]]
+ [collection
+ ["[0]" list]
+ ["[0]" sequence]
+ ["[0]" set]]]
+ [macro
+ ["[0]" code]]
+ [math
+ ["[0]" random {"+" Random}]
+ [number
+ ["n" nat]
+ ["[0]" i64]
+ ["[0]" int]
+ ["[0]" rev]
+ ["[0]" frac]]]
+ [meta
+ ["[0]" symbol]]]]
+ [\\library
+ ["[0]" /]])
(template: (!expect <expectation> <computation>)
[(case <computation>
@@ -57,11 +57,12 @@
(|> value
(# utf8.codec encoded)
(# utf8.codec decoded)
- (case> {try.#Success converted}
- (text#= value converted)
-
- {try.#Failure error}
- false)))
+ (pipe.case
+ {try.#Success converted}
+ (text#= value converted)
+
+ {try.#Failure error}
+ false)))
(def: random_text
(Random Text)
diff --git a/stdlib/source/test/lux/control/parser/json.lux b/stdlib/source/test/lux/control/parser/json.lux
index 23ee86ccc..0ac380274 100644
--- a/stdlib/source/test/lux/control/parser/json.lux
+++ b/stdlib/source/test/lux/control/parser/json.lux
@@ -1,32 +1,32 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]]
- [control
- [pipe {"+" case>}]
- ["[0]" maybe]
- ["[0]" try]
- ["[0]" exception]
- ["<>" parser]]
- [data
- ["[0]" bit]
- ["[0]" text]
- [collection
- ["[0]" list ("[1]#[0]" functor)]
- ["[0]" set]
- ["[0]" dictionary]
- ["[0]" sequence {"+" sequence} ("[1]#[0]" functor)]]
- [format
- ["[0]" json]]]
- [math
- ["[0]" random {"+" Random}]
- [number
- ["n" nat]
- ["[0]" frac]]]]]
- [\\library
- ["[0]" /]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" pipe]
+ ["[0]" maybe]
+ ["[0]" try]
+ ["[0]" exception]
+ ["<>" parser]]
+ [data
+ ["[0]" bit]
+ ["[0]" text]
+ [collection
+ ["[0]" list ("[1]#[0]" functor)]
+ ["[0]" set]
+ ["[0]" dictionary]
+ ["[0]" sequence {"+" sequence} ("[1]#[0]" functor)]]
+ [format
+ ["[0]" json]]]
+ [math
+ ["[0]" random {"+" Random}]
+ [number
+ ["n" nat]
+ ["[0]" frac]]]]]
+ [\\library
+ ["[0]" /]])
(template: (!expect <pattern> <value>)
[(case <value>
@@ -127,11 +127,12 @@
expected_string (random.unicode 1)
[boolean_field number_field string_field] (|> (random.set text.hash 3 (random.unicode 3))
(# ! each (|>> set.list
- (case> (^ (list boolean_field number_field string_field))
- [boolean_field number_field string_field]
+ (pipe.case
+ (^ (list boolean_field number_field string_field))
+ [boolean_field number_field string_field]
- _
- (undefined)))))]
+ _
+ (undefined)))))]
(_.cover [/.object /.field]
(|> (/.result (/.object ($_ <>.and
(/.field boolean_field /.boolean)
diff --git a/stdlib/source/test/lux/control/parser/synthesis.lux b/stdlib/source/test/lux/control/parser/synthesis.lux
index 0a2f2fbeb..62a78cd0e 100644
--- a/stdlib/source/test/lux/control/parser/synthesis.lux
+++ b/stdlib/source/test/lux/control/parser/synthesis.lux
@@ -5,7 +5,6 @@
[abstract
["[0]" monad {"+" do}]]
[control
- [pipe {"+" case>}]
["<>" parser]
["[0]" try]
["[0]" exception]]
diff --git a/stdlib/source/test/lux/control/parser/type.lux b/stdlib/source/test/lux/control/parser/type.lux
index 6476f9e30..5258921b2 100644
--- a/stdlib/source/test/lux/control/parser/type.lux
+++ b/stdlib/source/test/lux/control/parser/type.lux
@@ -6,7 +6,6 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
["[0]" try]
["[0]" exception]]
[data
diff --git a/stdlib/source/test/lux/control/pipe.lux b/stdlib/source/test/lux/control/pipe.lux
index 0e8acc13f..32153db22 100644
--- a/stdlib/source/test/lux/control/pipe.lux
+++ b/stdlib/source/test/lux/control/pipe.lux
@@ -1,20 +1,20 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- ["[0]" debug]
- [abstract
- [monad {"+" do}]]
- [data
- ["[0]" identity]
- ["[0]" text ("[1]#[0]" equivalence)
- ["%" format {"+" format}]]]
- [math
- ["[0]" random]
- [number
- ["n" nat]]]]]
- [\\library
- ["[0]" /]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ ["[0]" debug]
+ [abstract
+ [monad {"+" do}]]
+ [data
+ ["[0]" identity]
+ ["[0]" text ("[1]#[0]" equivalence)
+ ["%" format {"+" format}]]]
+ [math
+ ["[0]" random]
+ [number
+ ["n" nat]]]]]
+ [\\library
+ ["[0]" /]])
(def: .public test
Test
@@ -24,65 +24,65 @@
($_ _.and
(do !
[another random.nat]
- (_.cover [/.new>]
+ (_.cover [/.new]
(n.= (++ another)
(|> sample
(n.* 3)
(n.+ 4)
- (/.new> another [++])))))
- (_.cover [/.let>]
+ (/.new another [++])))))
+ (_.cover [/.let]
(n.= (n.+ sample sample)
(|> sample
- (/.let> x [(n.+ x x)]))))
- (_.cover [/.cond>]
+ (/.let x [(n.+ x x)]))))
+ (_.cover [/.cond]
(text#= (cond (n.= 0 sample) "zero"
(n.even? sample) "even"
"odd")
(|> sample
- (/.cond> [(n.= 0)] [(/.new> "zero" [])]
- [n.even?] [(/.new> "even" [])]
- [(/.new> "odd" [])]))))
- (_.cover [/.if>]
+ (/.cond [(n.= 0)] [(/.new "zero" [])]
+ [n.even?] [(/.new "even" [])]
+ [(/.new "odd" [])]))))
+ (_.cover [/.if]
(text#= (if (n.even? sample)
"even"
"odd")
(|> sample
- (/.if> [n.even?]
- [(/.new> "even" [])]
- [(/.new> "odd" [])]))))
- (_.cover [/.when>]
+ (/.if [n.even?]
+ [(/.new "even" [])]
+ [(/.new "odd" [])]))))
+ (_.cover [/.when]
(n.= (if (n.even? sample)
(n.* 2 sample)
sample)
(|> sample
- (/.when> [n.even?]
- [(n.* 2)]))))
- (_.cover [/.loop>]
+ (/.when [n.even?]
+ [(n.* 2)]))))
+ (_.cover [/.loop]
(n.= (n.* 10 sample)
(|> sample
- (/.loop> [(n.= (n.* 10 sample)) not]
- [(n.+ sample)]))))
- (_.cover [/.do>]
+ (/.loop [(n.= (n.* 10 sample)) not]
+ [(n.+ sample)]))))
+ (_.cover [/.do]
(n.= (++ (n.+ 4 (n.* 3 sample)))
(|> sample
- (/.do> identity.monad
- [(n.* 3)]
- [(n.+ 4)]
- [++]))))
- (_.cover [/.exec>]
+ (/.do identity.monad
+ [(n.* 3)]
+ [(n.+ 4)]
+ [++]))))
+ (_.cover [/.exec]
(n.= (n.* 10 sample)
(|> sample
- (/.exec> [%.nat (format "sample = ") debug.log!])
+ (/.exec [%.nat (format "sample = ") debug.log!])
(n.* 10))))
- (_.cover [/.tuple>]
+ (_.cover [/.tuple]
(let [[left middle right] (|> sample
- (/.tuple> [++]
- [--]
- [%.nat]))]
+ (/.tuple [++]
+ [--]
+ [%.nat]))]
(and (n.= (++ sample) left)
(n.= (-- sample) middle)
(text#= (%.nat sample) right))))
- (_.cover [/.case>]
+ (_.cover [/.case]
(text#= (case (n.% 10 sample)
0 "zero"
1 "one"
@@ -97,15 +97,16 @@
_ "???")
(|> sample
(n.% 10)
- (/.case> 0 "zero"
- 1 "one"
- 2 "two"
- 3 "three"
- 4 "four"
- 5 "five"
- 6 "six"
- 7 "seven"
- 8 "eight"
- 9 "nine"
- _ "???"))))
+ (/.case
+ 0 "zero"
+ 1 "one"
+ 2 "two"
+ 3 "three"
+ 4 "four"
+ 5 "five"
+ 6 "six"
+ 7 "seven"
+ 8 "eight"
+ 9 "nine"
+ _ "???"))))
))))
diff --git a/stdlib/source/test/lux/control/state.lux b/stdlib/source/test/lux/control/state.lux
index 40498c0d8..39e10983a 100644
--- a/stdlib/source/test/lux/control/state.lux
+++ b/stdlib/source/test/lux/control/state.lux
@@ -1,24 +1,24 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]
- [\\specification
- ["$[0]" functor {"+" Injection Comparison}]
- ["$[0]" apply]
- ["$[0]" monad]]]
- [control
- [pipe {"+" let>}]
- ["[0]" io]]
- [data
- ["[0]" product]]
- [math
- ["[0]" random]
- [number
- ["n" nat]]]]]
- [\\library
- ["[0]" / {"+" State}]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" functor {"+" Injection Comparison}]
+ ["$[0]" apply]
+ ["$[0]" monad]]]
+ [control
+ ["[0]" pipe]
+ ["[0]" io]]
+ [data
+ ["[0]" product]]
+ [math
+ ["[0]" random]
+ [number
+ ["n" nat]]]]]
+ [\\library
+ ["[0]" / {"+" State}]])
(def: (with_conditions [state output] computation)
(-> [Nat Nat] (State Nat Nat) Bit)
@@ -89,15 +89,15 @@
(_.cover [/.while /.result]
(|> (/.while condition (/.update ++))
(/.result 0)
- (let> [state' output']
- (n.= limit state'))))
+ (pipe.let [state' output']
+ (n.= limit state'))))
(_.cover [/.do_while]
(|> (/.do_while condition (/.update ++))
(/.result 0)
- (let> [state' output']
- (or (n.= limit state')
- (and (n.= 0 limit)
- (n.= 1 state'))))))
+ (pipe.let [state' output']
+ (or (n.= limit state')
+ (and (n.= 0 limit)
+ (n.= 1 state'))))))
)))
(def: monad_transformer
@@ -115,9 +115,9 @@
(in (n.+ a b))))
(/.result' state)
io.run!
- (let> [state' output']
- (and (n.= state state')
- (n.= (n.+ left right) output')))))
+ (pipe.let [state' output']
+ (and (n.= state state')
+ (n.= (n.+ left right) output')))))
)))
(def: .public test
diff --git a/stdlib/source/test/lux/control/try.lux b/stdlib/source/test/lux/control/try.lux
index b07aa194d..b3efe3dd2 100644
--- a/stdlib/source/test/lux/control/try.lux
+++ b/stdlib/source/test/lux/control/try.lux
@@ -1,25 +1,25 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]
- [\\specification
- ["$[0]" functor {"+" Injection Comparison}]
- ["$[0]" apply]
- ["$[0]" monad]
- ["$[0]" equivalence]]]
- [control
- pipe
- ["[0]" io]]
- [data
- ["[0]" text ("[1]#[0]" equivalence)]]
- [math
- ["[0]" random {"+" Random}]
- [number
- ["n" nat]]]]]
- [\\library
- ["[0]" / {"+" Try}]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" functor {"+" Injection Comparison}]
+ ["$[0]" apply]
+ ["$[0]" monad]
+ ["$[0]" equivalence]]]
+ [control
+ ["[0]" pipe]
+ ["[0]" io]]
+ [data
+ ["[0]" text ("[1]#[0]" equivalence)]]
+ [math
+ ["[0]" random {"+" Random}]
+ [number
+ ["n" nat]]]]]
+ [\\library
+ ["[0]" / {"+" Try}]])
(def: injection
(Injection Try)
@@ -86,10 +86,11 @@
b (in alternative)]
(in (n.+ a b)))
io.run!
- (case> {/.#Success result}
- (n.= (n.+ expected alternative)
- result)
+ (pipe.case
+ {/.#Success result}
+ (n.= (n.+ expected alternative)
+ result)
- _
- false))))
+ _
+ false))))
)))
diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux
index 458b447e4..e4d2bb2aa 100644
--- a/stdlib/source/test/lux/data/collection/list.lux
+++ b/stdlib/source/test/lux/data/collection/list.lux
@@ -14,7 +14,7 @@
["$[0]" apply]
["$[0]" monad]]]
[control
- pipe
+ ["[0]" pipe]
["[0]" io]
["[0]" maybe]
["[0]" function]]
@@ -76,11 +76,12 @@
[a (lifted (io#in parameter))
b (in subject)]
(in (n.+ a b))))
- (case> (^ (list actual))
- (n.= expected actual)
-
- _
- false)))))
+ (pipe.case
+ (^ (list actual))
+ (n.= expected actual)
+
+ _
+ false)))))
))
(def: whole
diff --git a/stdlib/source/test/lux/data/collection/tree/zipper.lux b/stdlib/source/test/lux/data/collection/tree/zipper.lux
index 55d01f81e..111597da6 100644
--- a/stdlib/source/test/lux/data/collection/tree/zipper.lux
+++ b/stdlib/source/test/lux/data/collection/tree/zipper.lux
@@ -1,29 +1,29 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]
- [\\specification
- ["$[0]" equivalence]
- ["$[0]" functor]
- ["$[0]" comonad]]]
- [control
- pipe
- ["[0]" maybe ("[1]#[0]" functor)]]
- [data
- ["[0]" product]
- ["[0]" text]
- [collection
- ["[0]" list]]]
- [math
- ["[0]" random]
- [number
- ["n" nat]]]]]
- ["[0]" //]
- [\\library
- ["[0]" / {"+" Zipper}
- ["tree" //]]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" equivalence]
+ ["$[0]" functor]
+ ["$[0]" comonad]]]
+ [control
+ ["[0]" pipe]
+ ["[0]" maybe ("[1]#[0]" functor)]]
+ [data
+ ["[0]" product]
+ ["[0]" text]
+ [collection
+ ["[0]" list]]]
+ [math
+ ["[0]" random]
+ [number
+ ["n" nat]]]]]
+ ["[0]" //]
+ [\\library
+ ["[0]" / {"+" Zipper}
+ ["tree" //]]])
(def: move
Test
@@ -34,25 +34,25 @@
(_.cover [/.down]
(|> (tree.branch dummy (list (tree.leaf expected)))
/.zipper
- (do> maybe.monad
- [/.down]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.up]
(|> (tree.branch expected (list (tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.down]
- [/.up]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.up]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.right]
(|> (tree.branch dummy (list (tree.leaf dummy) (tree.leaf expected)))
/.zipper
- (do> maybe.monad
- [/.down]
- [/.right]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.right]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.rightmost]
(|> (tree.branch dummy
@@ -61,19 +61,19 @@
(tree.leaf dummy)
(tree.leaf expected)))
/.zipper
- (do> maybe.monad
- [/.down]
- [/.rightmost]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.rightmost]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.left]
(|> (tree.branch dummy (list (tree.leaf expected) (tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.down]
- [/.right]
- [/.left]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.right]
+ [/.left]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.leftmost]
(|> (tree.branch dummy
@@ -82,29 +82,29 @@
(tree.leaf dummy)
(tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.down]
- [/.rightmost]
- [/.leftmost]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.rightmost]
+ [/.leftmost]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.next]
(and (|> (tree.branch dummy
(list (tree.leaf expected)
(tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.next]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.next]
+ [/.value (n.= expected) in])
(maybe.else false))
(|> (tree.branch dummy
(list (tree.leaf dummy)
(tree.leaf expected)))
/.zipper
- (do> maybe.monad
- [/.next]
- [/.next]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.next]
+ [/.next]
+ [/.value (n.= expected) in])
(maybe.else false))))
(_.cover [/.end]
(|> (tree.branch dummy
@@ -113,9 +113,9 @@
(tree.leaf dummy)
(tree.leaf expected)))
/.zipper
- (do> maybe.monad
- [/.end]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.end]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.start]
(|> (tree.branch expected
@@ -124,30 +124,30 @@
(tree.leaf dummy)
(tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.end]
- [/.start]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.end]
+ [/.start]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.previous]
(and (|> (tree.branch expected
(list (tree.leaf dummy)
(tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.next]
- [/.previous]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.next]
+ [/.previous]
+ [/.value (n.= expected) in])
(maybe.else false))
(|> (tree.branch dummy
(list (tree.leaf expected)
(tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.next]
- [/.next]
- [/.previous]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.next]
+ [/.next]
+ [/.previous]
+ [/.value (n.= expected) in])
(maybe.else false))))
)))
@@ -205,15 +205,15 @@
(/.interpose expected))]
(and (n.= dummy (/.value cursor))
(|> cursor
- (do> maybe.monad
- [/.down]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.value (n.= expected) in])
(maybe.else false))
(|> cursor
- (do> maybe.monad
- [/.down]
- [/.down]
- [/.value (n.= dummy) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.down]
+ [/.value (n.= dummy) in])
(maybe.else false)))))
(_.cover [/.adopt]
(let [cursor (|> (tree.branch dummy (list (tree.leaf dummy)))
@@ -221,41 +221,41 @@
(/.adopt expected))]
(and (n.= dummy (/.value cursor))
(|> cursor
- (do> maybe.monad
- [/.down]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.value (n.= expected) in])
(maybe.else false))
(|> cursor
- (do> maybe.monad
- [/.down]
- [/.right]
- [/.value (n.= dummy) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [/.right]
+ [/.value (n.= dummy) in])
(maybe.else false)))))
(_.cover [/.insert_left]
(|> (tree.branch dummy (list (tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.down]
- [(/.insert_left expected)]
- [/.left]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [(/.insert_left expected)]
+ [/.left]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.insert_right]
(|> (tree.branch dummy (list (tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.down]
- [(/.insert_right expected)]
- [/.right]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [(/.insert_right expected)]
+ [/.right]
+ [/.value (n.= expected) in])
(maybe.else false)))
(_.cover [/.remove]
(|> (tree.branch dummy (list (tree.leaf dummy)))
/.zipper
- (do> maybe.monad
- [/.down]
- [(/.insert_left expected)]
- [/.remove]
- [/.value (n.= expected) in])
+ (pipe.do maybe.monad
+ [/.down]
+ [(/.insert_left expected)]
+ [/.remove]
+ [/.value (n.= expected) in])
(maybe.else false)))
))))
diff --git a/stdlib/source/test/lux/data/format/xml.lux b/stdlib/source/test/lux/data/format/xml.lux
index 0ee929ca7..439fe1f5c 100644
--- a/stdlib/source/test/lux/data/format/xml.lux
+++ b/stdlib/source/test/lux/data/format/xml.lux
@@ -8,7 +8,6 @@
["$[0]" equivalence]
["$[0]" codec]]]
[control
- pipe
["[0]" maybe]
["[0]" try]
["p" parser
diff --git a/stdlib/source/test/lux/data/sum.lux b/stdlib/source/test/lux/data/sum.lux
index 2aa3c5058..6dc6eeb9e 100644
--- a/stdlib/source/test/lux/data/sum.lux
+++ b/stdlib/source/test/lux/data/sum.lux
@@ -8,7 +8,7 @@
["$[0]" equivalence]
["$[0]" hash]]]
[control
- pipe]
+ ["[0]" pipe]]
[data
["[0]" text]
[collection
@@ -39,13 +39,15 @@
(_.cover [/.left]
(|> (/.left expected)
(: (Or Nat Nat))
- (case> {0 #0 actual} (n.= expected actual)
- _ false)))
+ (pipe.case
+ {0 #0 actual} (n.= expected actual)
+ _ false)))
(_.cover [/.right]
(|> (/.right expected)
(: (Or Nat Nat))
- (case> {0 #1 actual} (n.= expected actual)
- _ false)))
+ (pipe.case
+ {0 #1 actual} (n.= expected actual)
+ _ false)))
(_.cover [/.either]
(and (|> (/.left expected)
(: (Or Nat Nat))
@@ -59,11 +61,11 @@
(and (|> (/.left expected)
(: (Or Nat Nat))
(/.then (n.+ shift) (n.- shift))
- (case> {0 #0 actual} (n.= (n.+ shift expected) actual) _ false))
+ (pipe.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))))
+ (pipe.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 faa8e0f86..ed6cc5d9d 100644
--- a/stdlib/source/test/lux/data/text.lux
+++ b/stdlib/source/test/lux/data/text.lux
@@ -1,35 +1,35 @@
(.using
- [library
- [lux {"-" char}
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]
- [\\specification
- ["$[0]" equivalence]
- ["$[0]" hash]
- ["$[0]" order]
- ["$[0]" monoid]]]
- [control
- pipe
- ["[0]" maybe]]
- [data
- [collection
- ["[0]" list]
- ["[0]" set]]]
- [math
- ["[0]" random]
- [number
- ["n" nat]]]]]
- ["[0]" / "_"
- ["[1][0]" buffer]
- ["[1][0]" encoding]
- ["[1][0]" format]
- ["[1][0]" regex]
- ["[1][0]" escape]
- ["[1][0]" unicode "_"
- ["[1]" set]]]
- [\\library
- ["[0]" /]])
+ [library
+ [lux {"-" char}
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" equivalence]
+ ["$[0]" hash]
+ ["$[0]" order]
+ ["$[0]" monoid]]]
+ [control
+ ["[0]" pipe]
+ ["[0]" maybe]]
+ [data
+ [collection
+ ["[0]" list]
+ ["[0]" set]]]
+ [math
+ ["[0]" random]
+ [number
+ ["n" nat]]]]]
+ ["[0]" / "_"
+ ["[1][0]" buffer]
+ ["[1][0]" encoding]
+ ["[1][0]" format]
+ ["[1][0]" regex]
+ ["[1][0]" escape]
+ ["[1][0]" unicode "_"
+ ["[1]" set]]]
+ [\\library
+ ["[0]" /]])
(def: bounded_size
(random.Random Nat)
@@ -289,26 +289,28 @@
($_ _.and
(_.cover [/.split_at]
(|> (/.split_at sizeL sample)
- (case> {.#Right [_l _r]}
- (and (/#= sampleL _l)
- (/#= sampleR _r)
- (/#= sample (/.together (list _l _r))))
+ (pipe.case
+ {.#Right [_l _r]}
+ (and (/#= sampleL _l)
+ (/#= sampleR _r)
+ (/#= sample (/.together (list _l _r))))
- _
- #0)))
+ _
+ #0)))
(_.cover [/.clip /.clip_since]
(|> [(/.clip 0 sizeL sample)
(/.clip sizeL (n.- sizeL (/.size sample)) sample)
(/.clip_since sizeL sample)
(/.clip_since 0 sample)]
- (case> [{.#Right _l} {.#Right _r} {.#Right _r'} {.#Right _f}]
- (and (/#= sampleL _l)
- (/#= sampleR _r)
- (/#= _r _r')
- (/#= sample _f))
+ (pipe.case
+ [{.#Right _l} {.#Right _r} {.#Right _r'} {.#Right _f}]
+ (and (/#= sampleL _l)
+ (/#= sampleR _r)
+ (/#= _r _r')
+ (/#= sample _f))
- _
- #0)))
+ _
+ #0)))
))
(do [! random.monad]
[sizeP bounded_size
diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux
index d5596ae56..0ab71cbaa 100644
--- a/stdlib/source/test/lux/data/text/regex.lux
+++ b/stdlib/source/test/lux/data/text/regex.lux
@@ -1,56 +1,59 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]]
- [control
- pipe
- ["[0]" try]
- [parser
- ["<[0]>" text {"+" Parser}]
- ["<[0]>" code]]]
- [data
- ["[0]" text ("[1]#[0]" equivalence)
- ["%" format {"+" format}]]]
- ["[0]" macro
- [syntax {"+" syntax:}]
- ["[0]" code]]
- [math
- [number {"+" hex}]
- ["[0]" random]]]]
- [\\library
- ["[0]" /]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" pipe]
+ ["[0]" try]
+ [parser
+ ["<[0]>" text {"+" Parser}]
+ ["<[0]>" code]]]
+ [data
+ ["[0]" text ("[1]#[0]" equivalence)
+ ["%" format {"+" format}]]]
+ ["[0]" macro
+ [syntax {"+" syntax:}]
+ ["[0]" code]]
+ [math
+ [number {"+" hex}]
+ ["[0]" random]]]]
+ [\\library
+ ["[0]" /]])
(def: (should_pass regex input)
(-> (Parser Text) Text Bit)
(|> input
(<text>.result regex)
- (case> {try.#Success parsed}
- (text#= parsed input)
+ (pipe.case
+ {try.#Success parsed}
+ (text#= parsed input)
- _
- #0)))
+ _
+ #0)))
(def: (text_should_pass test regex input)
(-> Text (Parser Text) Text Bit)
(|> input
(<text>.result regex)
- (case> {try.#Success parsed}
- (text#= test parsed)
+ (pipe.case
+ {try.#Success parsed}
+ (text#= test parsed)
- _
- false)))
+ _
+ false)))
(def: (should_fail regex input)
(All (_ a) (-> (Parser a) Text Bit))
(|> input
(<text>.result regex)
- (case> {try.#Failure _}
- true
+ (pipe.case
+ {try.#Failure _}
+ true
- _
- false)))
+ _
+ false)))
(syntax: (should_check [pattern <code>.any
regex <code>.any
@@ -58,11 +61,12 @@
(macro.with_symbols [g!message g!_]
(in (list (` (|> (~ input)
(<text>.result (~ regex))
- (case> (^ {try.#Success (~ pattern)})
- true
+ (pipe.case
+ (^ {try.#Success (~ pattern)})
+ true
- (~ g!_)
- false)))))))
+ (~ g!_)
+ false)))))))
(def: basics
Test
diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux
index 74107be7d..0cc809a70 100644
--- a/stdlib/source/test/lux/ffi.jvm.lux
+++ b/stdlib/source/test/lux/ffi.jvm.lux
@@ -9,7 +9,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try ("[1]#[0]" functor)]
["[0]" exception]
[parser
@@ -75,11 +75,12 @@
(function (_ lux)
(|> (macro.single_expansion expression)
(meta.result lux)
- (case> {try.#Success expansion}
- {try.#Failure "OOPS!"}
-
- {try.#Failure error}
- {try.#Success [lux (list (code.text error))]}))))
+ (pipe.case
+ {try.#Success expansion}
+ {try.#Failure "OOPS!"}
+
+ {try.#Failure error}
+ {try.#Success [lux (list (code.text error))]}))))
(def: for_conversions
Test
@@ -179,12 +180,14 @@
(_.cover [/.???]
(and (|> (/.??? (/.null))
(: (Maybe java/lang/Object))
- (case> {.#None} #1
- {.#Some _} #0))
+ (pipe.case
+ {.#None} #1
+ {.#Some _} #0))
(|> (/.??? sample)
(: (Maybe java/lang/Object))
- (case> {.#Some _} #1
- {.#None} #0))))
+ (pipe.case
+ {.#Some _} #1
+ {.#None} #0))))
(_.cover [/.!!!]
(and (|> (/.??? (/.null))
/.!!!
@@ -615,11 +618,12 @@
(function (_ lux)
(|> (macro.single_expansion expression)
(meta.result lux)
- (case> {try.#Success expansion}
- true
-
- {try.#Failure error}
- false)
+ (pipe.case
+ {try.#Success expansion}
+ true
+
+ {try.#Failure error}
+ false)
code.bit
list
[lux]
@@ -654,11 +658,12 @@
(try.else false))
(|> (list (code.local_symbol var/2))
(<code>.result type_variable)
- (case> {try.#Failure error}
- (exception.match? /.unknown_type_variable error)
-
- _
- false)))))
+ (pipe.case
+ {try.#Failure error}
+ (exception.match? /.unknown_type_variable error)
+
+ _
+ false)))))
)))
(def: .public test
diff --git a/stdlib/source/test/lux/ffi.old.lux b/stdlib/source/test/lux/ffi.old.lux
index 1a9db190f..39a86642e 100644
--- a/stdlib/source/test/lux/ffi.old.lux
+++ b/stdlib/source/test/lux/ffi.old.lux
@@ -6,7 +6,7 @@
[equivalence {"+" Equivalence}]
[monad {"+" do}]]
[control
- [pipe {"+" case>}]]
+ ["[0]" pipe]]
[data
["[0]" text ("[1]#[0]" equivalence)
["%" format {"+" format}]]]
@@ -182,11 +182,13 @@
(not (/.null? sample))))
(_.cover [/.???]
(and (|> (: (Maybe java/lang/Object) (/.??? (/.null)))
- (case> {.#None} #1
- _ #0))
+ (pipe.case
+ {.#None} #1
+ _ #0))
(|> (: (Maybe java/lang/Object) (/.??? sample))
- (case> {.#Some _} #1
- _ #0))))
+ (pipe.case
+ {.#Some _} #1
+ _ #0))))
(_.cover [/.!!!]
(and (/.null? (/.!!! (/.??? (/.null))))
(not (/.null? (/.!!! (/.??? sample))))))
diff --git a/stdlib/source/test/lux/meta/symbol.lux b/stdlib/source/test/lux/meta/symbol.lux
index 2ce0ba52b..261015a31 100644
--- a/stdlib/source/test/lux/meta/symbol.lux
+++ b/stdlib/source/test/lux/meta/symbol.lux
@@ -9,8 +9,6 @@
["$[0]" hash]
["$[0]" order]
["$[0]" codec]]]
- [control
- pipe]
[data
["[0]" text]]
[math
diff --git a/stdlib/source/test/lux/target/js.lux b/stdlib/source/test/lux/target/js.lux
index 16366a141..8f1da42bb 100644
--- a/stdlib/source/test/lux/target/js.lux
+++ b/stdlib/source/test/lux/target/js.lux
@@ -7,7 +7,7 @@
[monad {"+" do}]
["[0]" predicate]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" function]
["[0]" maybe ("[1]#[0]" functor)]
["[0]" try {"+" Try} ("[1]#[0]" functor)]]
@@ -817,11 +817,12 @@
(/.return $arg/0)))
(list))
..eval
- (case> {try.#Success it}
- false
-
- {try.#Failure error}
- true))))
+ (pipe.case
+ {try.#Success it}
+ false
+
+ {try.#Failure error}
+ true))))
..test|exception
..test|function
..test|branching
diff --git a/stdlib/source/test/lux/target/lua.lux b/stdlib/source/test/lux/target/lua.lux
index 0bee11310..84cf47b3f 100644
--- a/stdlib/source/test/lux/target/lua.lux
+++ b/stdlib/source/test/lux/target/lua.lux
@@ -10,7 +10,7 @@
["$[0]" equivalence]
["$[0]" hash]]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" function]
["[0]" maybe ("[1]#[0]" functor)]
["[0]" try {"+" Try} ("[1]#[0]" functor)]]
@@ -56,8 +56,9 @@
(|> /.nil
/.code
..load
- (case> {.#None} true
- {.#Some _} false)))
+ (pipe.case
+ {.#None} true
+ {.#Some _} false)))
(_.cover [/.boolean]
(expression (|>> (:as Bit) (bit#= boolean))
(/.boolean boolean)))
diff --git a/stdlib/source/test/lux/target/python.lux b/stdlib/source/test/lux/target/python.lux
index afcc8a43e..2a9bdb68e 100644
--- a/stdlib/source/test/lux/target/python.lux
+++ b/stdlib/source/test/lux/target/python.lux
@@ -11,7 +11,6 @@
["$[0]" equivalence]
["$[0]" hash]]]
[control
- [pipe {"+" case>}]
["[0]" function]
["[0]" maybe ("[1]#[0]" functor)]
["[0]" try {"+" Try} ("[1]#[0]" functor)]]
diff --git a/stdlib/source/test/lux/target/ruby.lux b/stdlib/source/test/lux/target/ruby.lux
index ee6b63d1c..58cf47c7b 100644
--- a/stdlib/source/test/lux/target/ruby.lux
+++ b/stdlib/source/test/lux/target/ruby.lux
@@ -10,7 +10,7 @@
[\\specification
["$[0]" equivalence]]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" maybe ("[1]#[0]" functor)]
["[0]" try {"+" Try} ("[1]#[0]" functor)]]
[data
@@ -52,8 +52,9 @@
(-> /.Expression Bit)
(|>> /.code
..eval
- (try#each (|>> (case> {.#None} true
- {.#Some _} false)))
+ (try#each (|>> (pipe.case
+ {.#None} true
+ {.#Some _} false)))
(try.else false)))
(def: test|literal
diff --git a/stdlib/source/test/lux/time.lux b/stdlib/source/test/lux/time.lux
index 72af6c159..074e2ebf4 100644
--- a/stdlib/source/test/lux/time.lux
+++ b/stdlib/source/test/lux/time.lux
@@ -1,37 +1,37 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]
- [\\specification
- ["$[0]" equivalence]
- ["$[0]" order]
- ["$[0]" enum]
- ["$[0]" codec]]]
- [control
- [pipe {"+" case>}]
- ["[0]" try ("[1]#[0]" functor)]
- ["[0]" exception]
- [parser
- ["<[0]>" text]]]
- [data
- ["[0]" text
- ["%" format {"+" format}]]]
- [math
- ["[0]" random]
- [number
- ["n" nat]]]]]
- ["[0]" / "_"
- ["[1][0]" date]
- ["[1][0]" day]
- ["[1][0]" duration]
- ["[1][0]" instant]
- ["[1][0]" month]
- ["[1][0]" year]]
- [\\library
- ["[0]" /
- ["[0]" duration]]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" equivalence]
+ ["$[0]" order]
+ ["$[0]" enum]
+ ["$[0]" codec]]]
+ [control
+ ["[0]" pipe]
+ ["[0]" try ("[1]#[0]" functor)]
+ ["[0]" exception]
+ [parser
+ ["<[0]>" text]]]
+ [data
+ ["[0]" text
+ ["%" format {"+" format}]]]
+ [math
+ ["[0]" random]
+ [number
+ ["n" nat]]]]]
+ ["[0]" / "_"
+ ["[1][0]" date]
+ ["[1][0]" day]
+ ["[1][0]" duration]
+ ["[1][0]" instant]
+ ["[1][0]" month]
+ ["[1][0]" year]]
+ [\\library
+ ["[0]" /
+ ["[0]" duration]]])
(def: for_implementation
Test
@@ -76,8 +76,9 @@
(text.prefix <prefix>)
(text.suffix <suffix>)
(# /.codec decoded)
- (case> {try.#Success _} true
- {try.#Failure error} false))
+ (pipe.case
+ {try.#Success _} true
+ {try.#Failure error} false))
invalid!
(|> <invalid>
@@ -85,11 +86,12 @@
(text.prefix <prefix>)
(text.suffix <suffix>)
(# /.codec decoded)
- (case> {try.#Success _}
- false
-
- {try.#Failure error}
- (exception.match? <exception> error)))]
+ (pipe.case
+ {try.#Success _}
+ false
+
+ {try.#Failure error}
+ (exception.match? <exception> error)))]
(and valid!
invalid!)))]
@@ -102,8 +104,9 @@
%.nat
(format "00:00:00.")
(# /.codec decoded)
- (case> {try.#Success _} true
- {try.#Failure error} false)))
+ (pipe.case
+ {try.#Success _} true
+ {try.#Failure error} false)))
))))
(def: .public test
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux
index 7ca3c4b12..eb623b548 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux
@@ -8,7 +8,7 @@
[\\specification
["$[0]" equivalence]]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" function]
["[0]" maybe]
["[0]" try]
@@ -272,52 +272,57 @@
(|> (/.failure expected_error)
(phase.result [extension.#bundle extension.empty
extension.#state state/0])
- (case> {try.#Failure actual_error}
- (and (text.contains? expected_error actual_error)
- (text.contains? (location.format location/0) actual_error))
+ (pipe.case
+ {try.#Failure actual_error}
+ (and (text.contains? expected_error actual_error)
+ (text.contains? (location.format location/0) actual_error))
- _
- false)))
+ _
+ false)))
(_.cover [/.except]
(|> (/.except <exception> [])
(phase.result [extension.#bundle extension.empty
extension.#state state/0])
- (case> {try.#Failure actual_error}
- (and (text.contains? (exception.error <exception> []) actual_error)
- (text.contains? (location.format location/0) actual_error))
+ (pipe.case
+ {try.#Failure actual_error}
+ (and (text.contains? (exception.error <exception> []) actual_error)
+ (text.contains? (location.format location/0) actual_error))
- _
- false)))
+ _
+ false)))
(_.cover [/.with_exception]
(|> (/.failure expected_error)
(/.with_exception <exception> [])
(phase.result [extension.#bundle extension.empty
extension.#state state/0])
- (case> {try.#Failure actual_error}
- (and (text.contains? expected_error actual_error)
- (text.contains? (exception.error <exception> []) actual_error)
- (text.contains? (location.format location/0) actual_error))
-
- _
- false)))
+ (pipe.case
+ {try.#Failure actual_error}
+ (and (text.contains? expected_error actual_error)
+ (text.contains? (exception.error <exception> []) actual_error)
+ (text.contains? (location.format location/0) actual_error))
+
+ _
+ false)))
(_.cover [/.assertion]
(and (|> (/.assertion <exception> [] false)
(phase.result [extension.#bundle extension.empty
extension.#state state/0])
- (case> {try.#Failure actual_error}
- (and (text.contains? (exception.error <exception> []) actual_error)
- (text.contains? (location.format location/0) actual_error))
+ (pipe.case
+ {try.#Failure actual_error}
+ (and (text.contains? (exception.error <exception> []) actual_error)
+ (text.contains? (location.format location/0) actual_error))
- _
- false))
+ _
+ false))
(|> (/.assertion <exception> [] true)
(phase.result [extension.#bundle extension.empty
extension.#state state/0])
- (case> {try.#Success _}
- true
+ (pipe.case
+ {try.#Success _}
+ true
- _
- false))))
+ _
+ false))))
))))
(def: test|state
@@ -370,11 +375,12 @@
(extension.read (|>> (the .#current_module) (maybe.else ""))))
(phase.result [extension.#bundle extension.empty
extension.#state state])
- (case> {try.#Success actual}
- (same? expected_module actual)
+ (pipe.case
+ {try.#Success actual}
+ (same? expected_module actual)
- _
- false)))
+ _
+ false)))
(_.cover [/.with_current_module]
(let [current_module (extension.read (|>> (the .#current_module) (maybe.else "")))]
(|> (do phase.monad
@@ -396,11 +402,12 @@
(extension.read (the .#location)))
(phase.result [extension.#bundle extension.empty
extension.#state state])
- (case> {try.#Success actual}
- (same? expected actual)
+ (pipe.case
+ {try.#Success actual}
+ (same? expected actual)
- _
- false))))
+ _
+ false))))
(_.cover [/.with_location]
(let [expected (/.location expected_file)
dummy (/.location expected_code)
@@ -424,11 +431,12 @@
(extension.read (the .#source)))
(phase.result [extension.#bundle extension.empty
extension.#state state])
- (case> {try.#Success actual}
- (same? expected actual)
+ (pipe.case
+ {try.#Success actual}
+ (same? expected actual)
- _
- false))))
+ _
+ false))))
(_.cover [/.with_source_code]
(let [expected (/.source expected_file expected_code)
dummy (/.source expected_code expected_file)
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux
index d8ae7a32e..e7e26bd54 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux
@@ -8,7 +8,7 @@
[\\specification
["$[0]" equivalence]]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try {"+" Try} ("[1]#[0]" functor)]
["[0]" exception {"+" Exception}]]
[data
@@ -116,14 +116,15 @@
(in [(|> coverages
(list.only (|>> /.exhaustive? not))
list.reversed
- (case> {.#End}
- {/.#Exhaustive}
-
- {.#Item last prevs}
- (list#mix (function (_ left right)
- {/.#Seq left right})
- last
- prevs)))
+ (pipe.case
+ {.#End}
+ {/.#Exhaustive}
+
+ {.#Item last prevs}
+ (list#mix (function (_ left right)
+ {/.#Seq left right})
+ last
+ prevs)))
{//pattern.#Complex {//complex.#Tuple patterns}}]))
(do random.monad
@@ -239,7 +240,7 @@
[expected/2 pattern/2] (random.only ($_ predicate.and
(|>> product.left (/#= expected/0) not)
(|>> product.left (/#= expected/1) not)
- (|>> product.left (case> {/.#Variant _} false _ true)))
+ (|>> product.left (pipe.case {/.#Variant _} false _ true)))
..random_value_pattern)
bit random.bit
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux
index e3dd8a53f..af025cb4d 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux
@@ -7,7 +7,7 @@
[\\specification
["$[0]" equivalence]]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" maybe ("[1]#[0]" functor)]
["[0]" try ("[1]#[0]" functor)]
["[0]" exception]]
@@ -87,12 +87,13 @@
(_.cover [/.expansion_failed]
(|> (/.expansion ..expander name singular (list))
(meta.result lux)
- (case> {try.#Failure it}
- (and (text.contains? expected_error it)
- (text.contains? (the exception.#label /.expansion_failed) it))
+ (pipe.case
+ {try.#Failure it}
+ (and (text.contains? expected_error it)
+ (text.contains? (the exception.#label /.expansion_failed) it))
- _
- false)))
+ _
+ false)))
(_.cover [/.single_expansion]
(|> (/.single_expansion ..expander name singular poly)
(meta.result lux)
@@ -101,9 +102,10 @@
(_.cover [/.must_have_single_expansion]
(|> (/.single_expansion ..expander name multiple (list mono))
(meta.result lux)
- (case> {try.#Failure it}
- (text.contains? (the exception.#label /.must_have_single_expansion) it)
+ (pipe.case
+ {try.#Failure it}
+ (text.contains? (the exception.#label /.must_have_single_expansion) it)
- _
- false)))
+ _
+ false)))
)))
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux
index 904bd4dd7..52ab6e6ff 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux
@@ -5,7 +5,7 @@
[abstract
["[0]" monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try ("[1]#[0]" functor)]
["[0]" exception]]
[data
@@ -121,12 +121,13 @@
(in it))
(/phase.result state)
(try#each (|>> (the .#module_aliases)
- (case> (^ (list [actual_alias actual_import]))
- (and (same? expected_alias actual_alias)
- (same? expected_import actual_import))
+ (pipe.case
+ (^ (list [actual_alias actual_import]))
+ (and (same? expected_alias actual_alias)
+ (same? expected_import actual_import))
- _
- false)))
+ _
+ false)))
(try.else false)))
)))
@@ -164,11 +165,12 @@
[_ (<pre> name)]
(<post> name)))
(/phase.result state)
- (case> {try.#Success _}
- false
-
- {try.#Failure error}
- (text.contains? (the exception.#label /.can_only_change_state_of_active_module) error)))]
+ (pipe.case
+ {try.#Success _}
+ false
+
+ {try.#Failure error}
+ (text.contains? (the exception.#label /.can_only_change_state_of_active_module) error)))]
[/.set_compiled /.set_active]
[/.set_compiled /.set_compiled]
@@ -181,11 +183,12 @@
(and (~~ (template [<set>]
[(|> (<set> name)
(/phase.result state)
- (case> {try.#Success _}
- false
-
- {try.#Failure error}
- (text.contains? (the exception.#label /.unknown_module) error)))]
+ (pipe.case
+ {try.#Success _}
+ false
+
+ {try.#Failure error}
+ (text.contains? (the exception.#label /.unknown_module) error)))]
[/.set_active]
[/.set_compiled]
@@ -221,8 +224,9 @@
[(|> (/.with hash module_name
(/.define def_name <global>))
(/phase.result state)
- (case> {try.#Success _} true
- {try.#Failure _} false))]
+ (pipe.case
+ {try.#Success _} true
+ {try.#Failure _} false))]
[definition]
[{.#Type [public? def_type {.#Left [labels|head labels|tail]}]}]
@@ -234,8 +238,9 @@
[_ (/.define def_name definition)]
(/.define alias_name alias)))
(/phase.result state)
- (case> {try.#Success _} true
- {try.#Failure _} false)))))
+ (pipe.case
+ {try.#Success _} true
+ {try.#Failure _} false)))))
(_.cover [/.cannot_define_more_than_once]
(`` (and (~~ (template [<global>]
[(|> (/.with hash module_name
@@ -243,8 +248,9 @@
[_ (/.define def_name <global>)]
(/.define def_name <global>)))
(/phase.result state)
- (case> {try.#Success _} false
- {try.#Failure _} true))]
+ (pipe.case
+ {try.#Success _} false
+ {try.#Failure _} true))]
[{.#Definition [public? def_type []]}]
[{.#Type [public? def_type {.#Left [labels|head labels|tail]}]}]
@@ -257,8 +263,9 @@
_ (/.define alias_name alias)]
(/.define alias_name alias)))
(/phase.result state)
- (case> {try.#Success _} false
- {try.#Failure _} true)))))
+ (pipe.case
+ {try.#Success _} false
+ {try.#Failure _} true)))))
)))
(def: test|label
@@ -291,8 +298,9 @@
(monad.each ! (|>> [module_name] <query> /extension.lifted)
(list& labels|head labels|tail))))
(/phase.result state)
- (case> {try.#Success _} <on_success>
- {try.#Failure _} (not <on_success>)))]
+ (pipe.case
+ {try.#Success _} <on_success>
+ {try.#Failure _} (not <on_success>)))]
[.#Left false meta.tag true]
[.#Left false meta.slot false]
@@ -306,11 +314,12 @@
_ (/.define def_name {.#Type [public? it {<side> [labels|head labels|tail]}]})]
(/.declare_labels <record?> (list& labels|head labels|tail) public? it)))
(/phase.result state)
- (case> {try.#Success _}
- false
-
- {try.#Failure error}
- (text.contains? (the exception.#label /.cannot_declare_labels_for_anonymous_type) error)))]
+ (pipe.case
+ {try.#Success _}
+ false
+
+ {try.#Failure error}
+ (text.contains? (the exception.#label /.cannot_declare_labels_for_anonymous_type) error)))]
[.#Left false]
[.#Right true])))))
@@ -322,11 +331,12 @@
_ (/.define def_name {.#Type [public? it {<side> [labels|head labels|tail]}]})]
(/.declare_labels <record?> (list& labels|head labels|tail) public? it)))
(/phase.result state)
- (case> {try.#Success _}
- false
-
- {try.#Failure error}
- (text.contains? (the exception.#label /.cannot_declare_labels_for_foreign_type) error)))]
+ (pipe.case
+ {try.#Success _}
+ false
+
+ {try.#Failure error}
+ (text.contains? (the exception.#label /.cannot_declare_labels_for_foreign_type) error)))]
[.#Left false]
[.#Right true])))))
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux
index db4902b2b..faf28f47e 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux
@@ -5,7 +5,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" maybe ("[1]#[0]" functor)]
["[0]" try ("[1]#[0]" functor)]
["[0]" exception]]
@@ -64,8 +64,9 @@
/.with
(//phase.result state)
(try#each (|>> product.right
- (case> {.#None} true
- {.#Some _} false)))
+ (pipe.case
+ {.#None} true
+ {.#Some _} false)))
(try.else false)))
(_.cover [/.with_local]
(|> (/.with_local [name/0 type/0]
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/type.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/type.lux
index a5f1b5797..2a13b674c 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/type.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/type.lux
@@ -5,7 +5,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try ("[1]#[0]" functor)]]
[data
["[0]" product]]
@@ -58,22 +58,25 @@
(/module.with 0 module)
(/phase#each product.right)
(/phase.result state)
- (case> {try.#Success _} true
- {try.#Failure _} false))
+ (pipe.case
+ {try.#Success _} true
+ {try.#Failure _} false))
(|> (/.inference dummy)
(/.expecting expected)
(/module.with 0 module)
(/phase#each product.right)
(/phase.result state)
- (case> {try.#Success _} false
- {try.#Failure _} true))
+ (pipe.case
+ {try.#Success _} false
+ {try.#Failure _} true))
(|> (/.inference expected)
(/.expecting dummy)
(/module.with 0 module)
(/phase#each product.right)
(/phase.result state)
- (case> {try.#Success _} false
- {try.#Failure _} true))))
+ (pipe.case
+ {try.#Success _} false
+ {try.#Failure _} true))))
(_.cover [/.inferring]
(|> (/.inference expected)
/.inferring
@@ -92,8 +95,9 @@
(/module.with 0 module)
(/phase#each product.right)
(/phase.result state)
- (case> {try.#Success _} true
- {try.#Failure _} false)))
+ (pipe.case
+ {try.#Success _} true
+ {try.#Failure _} false)))
(_.cover [/.existential /.existential?]
(|> (do /phase.monad
[:it: /.existential]
@@ -112,8 +116,9 @@
(/module.with 0 module)
(/phase#each product.right)
(/phase.result state)
- (case> {try.#Success _} true
- {try.#Failure _} false))
+ (pipe.case
+ {try.#Success _} true
+ {try.#Failure _} false))
(|> (do /phase.monad
[varT (/.check (do check.monad
[[id type] check.var]
@@ -124,6 +129,7 @@
(/module.with 0 module)
(/phase#each product.right)
(/phase.result state)
- (case> {try.#Success _} false
- {try.#Failure _} true))))
+ (pipe.case
+ {try.#Success _} false
+ {try.#Failure _} true))))
))))
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux
index b08ab36de..5fa0d281b 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux
@@ -5,7 +5,6 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
["[0]" try {"+" Try} ("[1]#[0]" functor)]
["[0]" exception]]
[data
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux
index 203c7a46f..f27af5d36 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux
@@ -5,7 +5,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" maybe ("[1]#[0]" functor)]
["[0]" try {"+" Try} ("[1]#[0]" functor)]
["[0]" exception {"+" Exception}]]
@@ -479,22 +479,24 @@
(//module.with 0 module)
(//phase#each product.right)
(//phase.result state)
- (case> {try.#Success {.#Some actual}}
- (let [(^open "list#[0]") (list.equivalence (product.equivalence symbol.equivalence code.equivalence))]
- (list#= expected (list.reversed actual)))
-
- _
- false))))]
+ (pipe.case
+ {try.#Success {.#Some actual}}
+ (let [(^open "list#[0]") (list.equivalence (product.equivalence symbol.equivalence code.equivalence))]
+ (list#= expected (list.reversed actual)))
+
+ _
+ false))))]
(and (normal? (list) (list))
(normal? expected_record global_record)
(normal? expected_record local_record)
(|> (/.normal false tuple)
(//phase.result state)
- (case> {try.#Success {.#None}}
- true
-
- _
- false)))))
+ (pipe.case
+ {try.#Success {.#None}}
+ true
+
+ _
+ false)))))
(_.cover [/.order]
(let [local_record (list.zipped/2 (list#each (|>> [""]) slots/0) tuple)
global_record (list.zipped/2 (list#each (|>> [module]) slots/0) tuple)
@@ -507,22 +509,24 @@
(//module.with 0 module)
(//phase#each (|>> product.right product.right))
(//phase.result state)
- (case> {try.#Success {.#Some [actual_arity actual_tuple actual_type]}}
- (and (n.= arity actual_arity)
- (# code.equivalence = (code.tuple tuple) (code.tuple actual_tuple))
- (type#= :record: actual_type))
-
- _
- false))))
+ (pipe.case
+ {try.#Success {.#Some [actual_arity actual_tuple actual_type]}}
+ (and (n.= arity actual_arity)
+ (# code.equivalence = (code.tuple tuple) (code.tuple actual_tuple))
+ (type#= :record: actual_type))
+
+ _
+ false))))
unit? (: (-> Bit Bit)
(function (_ pattern_matching?)
(|> (/.order false (list))
(//phase.result state)
- (case> (^ {try.#Success {.#Some [0 (list) actual_type]}})
- (same? .Any actual_type)
+ (pipe.case
+ (^ {try.#Success {.#Some [0 (list) actual_type]}})
+ (same? .Any actual_type)
- _
- false))))]
+ _
+ false))))]
(and (ordered? false global_record)
(ordered? false (list.reversed global_record))
(ordered? false local_record)
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux
index dfc9ba28d..fd60e1de8 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux
@@ -5,7 +5,6 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
["[0]" function]
["[0]" try ("[1]#[0]" functor)]
["[0]" exception]]
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux
index 3c215c00b..45fef5649 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux
@@ -5,7 +5,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try ("[1]#[0]" functor)]
["[0]" exception]]
[data
@@ -53,11 +53,12 @@
(//phase#each product.right)
(//phase.result state)
(try#each (|>> product.right
- (case> (^ [actual_type (//analysis.local 0)])
- (type#= expected_type actual_type)
+ (pipe.case
+ (^ [actual_type (//analysis.local 0)])
+ (type#= expected_type actual_type)
- _
- false)))
+ _
+ false)))
(try.else false))
can_find_foreign_variable!
@@ -71,11 +72,12 @@
(//phase.result state)
(try#each (|>> product.right
product.right
- (case> (^ [actual_type (//analysis.foreign 0)])
- (type#= expected_type actual_type)
+ (pipe.case
+ (^ [actual_type (//analysis.foreign 0)])
+ (type#= expected_type actual_type)
- _
- false)))
+ _
+ false)))
(try.else false))
can_find_local_definition!
@@ -86,13 +88,14 @@
(//module.with 0 expected_module)
(//phase.result state)
(try#each (|>> product.right
- (case> (^ [actual_type (//analysis.constant [actual_module actual_name])])
- (and (type#= expected_type actual_type)
- (same? expected_module actual_module)
- (same? expected_name actual_name))
+ (pipe.case
+ (^ [actual_type (//analysis.constant [actual_module actual_name])])
+ (and (type#= expected_type actual_type)
+ (same? expected_module actual_module)
+ (same? expected_name actual_name))
- _
- false)))
+ _
+ false)))
(try.else false))
can_find_foreign_definition!
@@ -105,13 +108,14 @@
(//module.with 0 expected_module)
(//phase.result state)
(try#each (|>> product.right
- (case> (^ [actual_type (//analysis.constant [actual_module actual_name])])
- (and (type#= expected_type actual_type)
- (same? import actual_module)
- (same? expected_name actual_name))
+ (pipe.case
+ (^ [actual_type (//analysis.constant [actual_module actual_name])])
+ (and (type#= expected_type actual_type)
+ (same? import actual_module)
+ (same? expected_name actual_name))
- _
- false)))
+ _
+ false)))
(try.else false))
can_find_alias!
@@ -125,13 +129,14 @@
(//module.with 0 expected_module)
(//phase.result state)
(try#each (|>> product.right
- (case> (^ [actual_type (//analysis.constant [actual_module actual_name])])
- (and (type#= expected_type actual_type)
- (same? import actual_module)
- (same? expected_name actual_name))
+ (pipe.case
+ (^ [actual_type (//analysis.constant [actual_module actual_name])])
+ (and (type#= expected_type actual_type)
+ (same? import actual_module)
+ (same? expected_name actual_name))
- _
- false)))
+ _
+ false)))
(try.else false))
can_find_type!
@@ -145,13 +150,14 @@
(//module.with 0 expected_module)
(//phase.result state)
(try#each (|>> product.right
- (case> (^ [actual_type (//analysis.constant [actual_module actual_name])])
- (and (type#= .Type actual_type)
- (same? expected_module actual_module)
- (same? expected_name actual_name))
+ (pipe.case
+ (^ [actual_type (//analysis.constant [actual_module actual_name])])
+ (and (type#= .Type actual_type)
+ (same? expected_module actual_module)
+ (same? expected_name actual_name))
- _
- false)))
+ _
+ false)))
(try.else false))]
(and can_find_local_variable!
can_find_foreign_variable!
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux
index 86f813b1d..454cebdc6 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux
@@ -6,7 +6,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try]]
[data
["[0]" product]]
@@ -34,43 +34,47 @@
(/phase#each product.right)
(/phase.result [/extension.#bundle /extension.empty
/extension.#state state])
- (case> (^ {try.#Success analysis})
- (? analysis)
+ (pipe.case
+ (^ {try.#Success analysis})
+ (? analysis)
- _
- false))
+ _
+ false))
(|> it
(/type.expecting .Nothing)
(/module.with 0 module)
(/phase#each product.right)
(/phase.result [/extension.#bundle /extension.empty
/extension.#state state])
- (case> (^ {try.#Failure error})
- true
+ (pipe.case
+ (^ {try.#Failure error})
+ true
- _
- false))
+ _
+ false))
(|> it
/type.inferring
(/module.with 0 module)
(/phase#each product.right)
(/phase.result [/extension.#bundle /extension.empty
/extension.#state state])
- (case> (^ {try.#Success [inferred analysis]})
- (and (type#= type inferred)
- (? analysis))
+ (pipe.case
+ (^ {try.#Success [inferred analysis]})
+ (and (type#= type inferred)
+ (? analysis))
- _
- false))))
+ _
+ false))))
(template: (analysis? <type> <tag>)
[(: (-> <type> Analysis Bit)
(function (_ expected)
- (|>> (case> (^ (<tag> actual))
- (same? expected actual)
+ (|>> (pipe.case
+ (^ (<tag> actual))
+ (same? expected actual)
- _
- false))))])
+ _
+ false))))])
(def: .public test
(<| (_.covering /._)
@@ -83,7 +87,7 @@
(`` ($_ _.and
(_.cover [/.unit]
(..analysis state module .Any /.unit
- (|>> (case> (^ (/analysis.unit)) true _ false))))
+ (|>> (pipe.case (^ (/analysis.unit)) true _ false))))
(~~ (template [<analysis> <type> <random> <tag>]
[(do !
[sample <random>]
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension.lux
index ab2af87eb..1f24840eb 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension.lux
@@ -8,7 +8,7 @@
["$[0]" equivalence]
["$[0]" hash]]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try]
["[0]" exception]]
[data
@@ -122,22 +122,24 @@
(/.install extender extension handler/1))
(phase.result [/.#bundle /.empty
/.#state state])
- (case> {try.#Failure error}
- (exception.match? /.cannot_overwrite error)
+ (pipe.case
+ {try.#Failure error}
+ (exception.match? /.cannot_overwrite error)
- _
- false)))
+ _
+ false)))
(_.cover [/.unknown]
(|> (/.apply archive.empty (function (_ archive input)
(# phase.monad in (++ input)))
[extension (list left right)])
(phase.result [/.#bundle /.empty
/.#state state])
- (case> {try.#Failure error}
- (exception.match? /.unknown error)
+ (pipe.case
+ {try.#Failure error}
+ (exception.match? /.unknown error)
- _
- false)))
+ _
+ false)))
)))
(def: test|bundle
@@ -197,11 +199,12 @@
(/.apply archive.empty phase [extension (list)]))
(phase.result [/.#bundle /.empty
/.#state state])
- (case> {try.#Failure error}
- (exception.match? /.incorrect_arity error)
+ (pipe.case
+ {try.#Failure error}
+ (exception.match? /.incorrect_arity error)
- _
- false))))
+ _
+ false))))
(_.cover [/.invalid_syntax]
(let [handler (: (/.Handler Int Nat Nat)
(function (_ @self phase archive inputs)
@@ -211,11 +214,12 @@
(/.apply archive.empty phase [extension (list left right)]))
(phase.result [/.#bundle /.empty
/.#state state])
- (case> {try.#Failure error}
- (exception.match? /.invalid_syntax error)
+ (pipe.case
+ {try.#Failure error}
+ (exception.match? /.invalid_syntax error)
- _
- false))))
+ _
+ false))))
(_.for [/.Name]
..test|name)
))
@@ -252,11 +256,12 @@
(/.lifted (phase.lifted {try.#Failure expected_error})))
(phase.result [/.#bundle /.empty
/.#state state])
- (case> {try.#Failure actual_error}
- (same? expected_error actual_error)
+ (pipe.case
+ {try.#Failure actual_error}
+ (same? expected_error actual_error)
- _
- false))))
+ _
+ false))))
(_.cover [/.up]
(|> (do phase.monad
[]
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
index 90cf891ac..24a9fb366 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
@@ -1,37 +1,37 @@
(.using
- [lux {"-" i64 int primitive}
- [abstract
- ["[0]" monad {"+" do}]]
- [data
- ["%" text/format {"+" format}]]
- ["r" math/random {"+" Random}]
- ["_" test {"+" Test}]
- [control
- pipe
- [io {"+" IO}]
- ["[0]" try]
- [concurrency
- ["[0]" atom]]]
- [data
- ["[0]" product]]
- ["[0]" type ("[1]#[0]" equivalence)]
- [macro
- ["[0]" code]]
- [meta
- ["[0]" symbol]]]
- [////
- [analysis
- ["_[0]" primitive]]]
- [\\
- ["[0]" /
- ["///[1]" //// "_"
- [analysis
- ["[1][0]" scope]
- ["[1][0]" type]]
- [////
- ["[0]" phase]
- [meta
- ["[0]" archive]]]]]])
+ [lux {"-" i64 int primitive}
+ [abstract
+ ["[0]" monad {"+" do}]]
+ [data
+ ["%" text/format {"+" format}]]
+ ["r" math/random {"+" Random}]
+ ["_" test {"+" Test}]
+ [control
+ ["[0]" pipe]
+ [io {"+" IO}]
+ ["[0]" try]
+ [concurrency
+ ["[0]" atom]]]
+ [data
+ ["[0]" product]]
+ ["[0]" type ("[1]#[0]" equivalence)]
+ [macro
+ ["[0]" code]]
+ [meta
+ ["[0]" symbol]]]
+ [////
+ [analysis
+ ["_[0]" primitive]]]
+ [\\
+ ["[0]" /
+ ["///[1]" //// "_"
+ [analysis
+ ["[1][0]" scope]
+ ["[1][0]" type]]
+ [////
+ ["[0]" phase]
+ [meta
+ ["[0]" archive]]]]]])
(template [<name> <success> <failure>]
[(def: (<name> procedure params output_type)
@@ -40,11 +40,12 @@
(////type.with_type output_type
(_primitive.phase archive.empty (` ((~ (code.text procedure)) (~+ params))))))
(phase.result _primitive.state)
- (case> {try.#Success _}
- <success>
+ (pipe.case
+ {try.#Success _}
+ <success>
- {try.#Failure _}
- <failure>)))]
+ {try.#Failure _}
+ <failure>)))]
[check_success+ true false]
[check_failure+ false true]
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux
index beb9c4a34..c5d7ccd02 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux
@@ -5,7 +5,7 @@
[hash {"+" Hash}]
["[0]" monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try ("[1]#[0]" functor)]]
[data
["[0]" sum]
@@ -71,13 +71,14 @@
(|> letA
(//.phase archive.empty)
(phase.result [///bundle.empty synthesis.init])
- (case> (^ {try.#Success (synthesis.branch/let [inputS registerS outputS])})
- (and (n.= registerA registerS)
- (//primitive.corresponds? inputA inputS)
- (//primitive.corresponds? outputA outputS))
+ (pipe.case
+ (^ {try.#Success (synthesis.branch/let [inputS registerS outputS])})
+ (and (n.= registerA registerS)
+ (//primitive.corresponds? inputA inputS)
+ (//primitive.corresponds? outputA outputS))
- _
- false)))))
+ _
+ false)))))
(def: if_test
Test
@@ -99,13 +100,14 @@
(|> ifA
(//.phase archive.empty)
(phase.result [///bundle.empty synthesis.init])
- (case> (^ {try.#Success (synthesis.branch/if [inputS thenS elseS])})
- (and (//primitive.corresponds? inputA inputS)
- (//primitive.corresponds? thenA thenS)
- (//primitive.corresponds? elseA elseS))
+ (pipe.case
+ (^ {try.#Success (synthesis.branch/if [inputS thenS elseS])})
+ (and (//primitive.corresponds? inputA inputS)
+ (//primitive.corresponds? thenA thenS)
+ (//primitive.corresponds? elseA elseS))
- _
- false)))))
+ _
+ false)))))
(def: random_member
(Random synthesis.Member)
@@ -158,12 +160,13 @@
(|> getA
(//.phase archive.empty)
(phase.result [///bundle.empty synthesis.init])
- (case> (^ {try.#Success (synthesis.branch/get [pathS recordS])})
- (and (# (list.equivalence (sum.equivalence n.= n.=)) = pathA pathS)
- (//primitive.corresponds? recordA recordS))
+ (pipe.case
+ (^ {try.#Success (synthesis.branch/get [pathS recordS])})
+ (and (# (list.equivalence (sum.equivalence n.= n.=)) = pathA pathS)
+ (//primitive.corresponds? recordA recordS))
- _
- false)))))
+ _
+ false)))))
(def: random_bit
(Random [Path Match])
@@ -185,11 +188,12 @@
(|> random_element
(random.set hash 5)
(# random.monad each (|>> set.list
- (case> (^ (list s0 s1 s2 s3 s4))
- [s0 s1 s2 s3 s4]
+ (pipe.case
+ (^ (list s0 s1 s2 s3 s4))
+ [s0 s1 s2 s3 s4]
- _
- (undefined))))))
+ _
+ (undefined))))))
(template [<name> <hash> <random> <path> <synthesis> <pattern> <analysis>]
[(def: <name>
@@ -333,12 +337,13 @@
(_.cover [/.synthesize_case]
(|> (/.synthesize_case //.phase archive.empty expected_input match)
(phase.result [///bundle.empty synthesis.init])
- (case> (^ {try.#Success (synthesis.branch/case [actual_input actual_path])})
- (and (# synthesis.equivalence = expected_input actual_input)
- (# synthesis.path_equivalence = expected_path actual_path))
+ (pipe.case
+ (^ {try.#Success (synthesis.branch/case [actual_input actual_path])})
+ (and (# synthesis.equivalence = expected_input actual_input)
+ (# synthesis.path_equivalence = expected_path actual_path))
- _
- false)))))
+ _
+ false)))))
(def: .public test
Test
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux
index 6fa2b9257..159207280 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux
@@ -1,32 +1,32 @@
(.using
- [lux {"-" primitive}
- [abstract ["[0]" monad {"+" do}]]
- [control
- [pipe {"+" case>}]
- ["[0]" try]]
- [data
- ["%" text/format {"+" format}]
- [number
- ["n" nat]]
- [collection
- ["[0]" list]]]
- ["r" math/random {"+" Random} ("[1]#[0]" monad)]
- ["_" test {"+" Test}]
- [meta
- ["[0]" symbol]]]
- [\\
- ["[0]" / "_"
- ["/[1]" //
- ["/[1]" // "_"
- [extension
- ["[1][0]" bundle]]
- ["/[1]" //
- ["[1][0]" analysis {"+" Analysis}]
- ["[1][0]" synthesis {"+" Synthesis}]
- [///
- ["[0]" phase]
- [meta
- ["[0]" archive]]]]]]]])
+ [lux {"-" primitive}
+ [abstract ["[0]" monad {"+" do}]]
+ [control
+ ["[0]" pipe]
+ ["[0]" try]]
+ [data
+ ["%" text/format {"+" format}]
+ [number
+ ["n" nat]]
+ [collection
+ ["[0]" list]]]
+ ["r" math/random {"+" Random} ("[1]#[0]" monad)]
+ ["_" test {"+" Test}]
+ [meta
+ ["[0]" symbol]]]
+ [\\
+ ["[0]" / "_"
+ ["/[1]" //
+ ["/[1]" // "_"
+ [extension
+ ["[1][0]" bundle]]
+ ["/[1]" //
+ ["[1][0]" analysis {"+" Analysis}]
+ ["[1][0]" synthesis {"+" Synthesis}]
+ [///
+ ["[0]" phase]
+ [meta
+ ["[0]" archive]]]]]]]])
(def: .public primitive
(Random Analysis)
@@ -82,11 +82,12 @@
(|> {////analysis.#Primitive {<analysis> expected}}
(//.phase archive.empty)
(phase.result [///bundle.empty ////synthesis.init])
- (case> {try.#Success {////synthesis.#Primitive {<synthesis> actual}}}
- (same? expected actual)
+ (pipe.case
+ {try.#Success {////synthesis.#Primitive {<synthesis> actual}}}
+ (same? expected actual)
- _
- false))))]
+ _
+ false))))]
[////analysis.#Unit ////synthesis.#Text (r#in ////synthesis.unit)]
[////analysis.#Bit ////synthesis.#Bit r.bit]
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux
index ce3327adb..2f66190b4 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux
@@ -1,38 +1,38 @@
(.using
- [lux "*"
- [abstract
- ["[0]" monad {"+" do}]]
- [data
- ["%" text/format {"+" format}]]
- ["r" math/random {"+" Random}]
- ["_" test {"+" Test}]
- [control
- pipe
- ["[0]" try]]
- [data
- ["[0]" bit ("[1]#[0]" equivalence)]
- ["[0]" product]
- [number
- ["n" nat]]
- [collection
- ["[0]" list]]]
- [meta
- ["[0]" symbol]]]
- ["[0]" // "_"
- ["[1][0]" primitive]]
- [\\
- ["[0]" / "_"
- ["/[1]" //
- ["/[1]" // "_"
- [extension
- ["[1][0]" bundle]]
- ["/[1]" //
- ["[1][0]" analysis {"+" Analysis}]
- ["[1][0]" synthesis {"+" Synthesis}]
- [///
- ["[0]" phase]
- [meta
- ["[0]" archive]]]]]]]])
+ [lux "*"
+ [abstract
+ ["[0]" monad {"+" do}]]
+ [data
+ ["%" text/format {"+" format}]]
+ ["r" math/random {"+" Random}]
+ ["_" test {"+" Test}]
+ [control
+ ["[0]" pipe]
+ ["[0]" try]]
+ [data
+ ["[0]" bit ("[1]#[0]" equivalence)]
+ ["[0]" product]
+ [number
+ ["n" nat]]
+ [collection
+ ["[0]" list]]]
+ [meta
+ ["[0]" symbol]]]
+ ["[0]" // "_"
+ ["[1][0]" primitive]]
+ [\\
+ ["[0]" / "_"
+ ["/[1]" //
+ ["/[1]" // "_"
+ [extension
+ ["[1][0]" bundle]]
+ ["/[1]" //
+ ["[1][0]" analysis {"+" Analysis}]
+ ["[1][0]" synthesis {"+" Synthesis}]
+ [///
+ ["[0]" phase]
+ [meta
+ ["[0]" archive]]]]]]]])
(def: variant
Test
@@ -48,14 +48,15 @@
(|> (////analysis.variant [lefts right? memberA])
(//.phase archive.empty)
(phase.result [///bundle.empty ////synthesis.init])
- (case> (^ {try.#Success (////synthesis.variant [leftsS right?S valueS])})
- (let [tagS (if right?S (++ leftsS) leftsS)]
- (and (n.= tagA tagS)
- (|> tagS (n.= (-- size)) (bit#= right?S))
- (//primitive.corresponds? memberA valueS)))
-
- _
- false)))))
+ (pipe.case
+ (^ {try.#Success (////synthesis.variant [leftsS right?S valueS])})
+ (let [tagS (if right?S (++ leftsS) leftsS)]
+ (and (n.= tagA tagS)
+ (|> tagS (n.= (-- size)) (bit#= right?S))
+ (//primitive.corresponds? memberA valueS)))
+
+ _
+ false)))))
(def: tuple
Test
@@ -66,13 +67,14 @@
(|> (////analysis.tuple membersA)
(//.phase archive.empty)
(phase.result [///bundle.empty ////synthesis.init])
- (case> (^ {try.#Success (////synthesis.tuple membersS)})
- (and (n.= size (list.size membersS))
- (list.every? (product.uncurried //primitive.corresponds?)
- (list.zipped/2 membersA membersS)))
+ (pipe.case
+ (^ {try.#Success (////synthesis.tuple membersS)})
+ (and (n.= size (list.size membersS))
+ (list.every? (product.uncurried //primitive.corresponds?)
+ (list.zipped/2 membersA membersS)))
- _
- false)))))
+ _
+ false)))))
(def: .public test
Test
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
index 55a187083..42a9d531a 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
@@ -6,7 +6,6 @@
[math
["[0]" random {"+" Random}]]
[control
- [pipe {"+" case>}]
["[0]" try]]
[data
["[0]" product]
diff --git a/stdlib/source/test/lux/tool/compiler/meta/archive.lux b/stdlib/source/test/lux/tool/compiler/meta/archive.lux
index 7cbd76e8a..f89666969 100644
--- a/stdlib/source/test/lux/tool/compiler/meta/archive.lux
+++ b/stdlib/source/test/lux/tool/compiler/meta/archive.lux
@@ -5,7 +5,6 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
["[0]" try]
["[0]" exception]]
[data
diff --git a/stdlib/source/test/lux/tool/compiler/meta/archive/module/document.lux b/stdlib/source/test/lux/tool/compiler/meta/archive/module/document.lux
index a99e8eccf..1ed849972 100644
--- a/stdlib/source/test/lux/tool/compiler/meta/archive/module/document.lux
+++ b/stdlib/source/test/lux/tool/compiler/meta/archive/module/document.lux
@@ -5,7 +5,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try ("[1]#[0]" functor)]
["[0]" exception]
[parser
@@ -52,42 +52,47 @@
(and (|> expected
(/.document key/0)
(/.marked? key/0)
- (case> {try.#Success it} true
- {try.#Failure error} false))
+ (pipe.case
+ {try.#Success it} true
+ {try.#Failure error} false))
(|> expected
(/.document key/0)
(/.marked? key/1)
- (case> {try.#Success it} false
- {try.#Failure error} true))))
+ (pipe.case
+ {try.#Success it} false
+ {try.#Failure error} true))))
(_.cover [/.invalid_signature]
(and (|> expected
(/.document key/0)
(/.content key/1)
- (case> {try.#Success it}
- false
-
- {try.#Failure error}
- (exception.match? /.invalid_signature error)))
+ (pipe.case
+ {try.#Success it}
+ false
+
+ {try.#Failure error}
+ (exception.match? /.invalid_signature error)))
(|> expected
(/.document key/0)
(/.marked? key/1)
- (case> {try.#Success it}
- false
-
- {try.#Failure error}
- (exception.match? /.invalid_signature error)))))
+ (pipe.case
+ {try.#Success it}
+ false
+
+ {try.#Failure error}
+ (exception.match? /.invalid_signature error)))))
(_.cover [/.writer /.parser]
(|> expected
(/.document key/0)
(binaryF.result (/.writer binaryF.nat))
(<binary>.result (/.parser key/0 <binary>.nat))
- (case> {try.#Success it}
- (and (/signature#= signature/0 (/.signature it))
- (|> it
- (/.content key/0)
- (try#each (nat.= expected))
- (try.else false)))
-
- {try.#Failure error}
- false)))
+ (pipe.case
+ {try.#Success it}
+ (and (/signature#= signature/0 (/.signature it))
+ (|> it
+ (/.content key/0)
+ (try#each (nat.= expected))
+ (try.else false)))
+
+ {try.#Failure error}
+ false)))
))))
diff --git a/stdlib/source/test/lux/tool/compiler/meta/cli.lux b/stdlib/source/test/lux/tool/compiler/meta/cli.lux
index 48aa9c079..725d1f495 100644
--- a/stdlib/source/test/lux/tool/compiler/meta/cli.lux
+++ b/stdlib/source/test/lux/tool/compiler/meta/cli.lux
@@ -5,7 +5,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try ("[1]#[0]" functor)]
["<>" parser
["<[0]>" cli]]]
@@ -61,13 +61,14 @@
[(_.cover [<type>]
(|> (list& "build" compilation')
(<cli>.result /.service)
- (try#each (|>> (case> {/.#Compilation it}
- (|> it
- (the <slot>)
- <?>)
-
- _
- false)))
+ (try#each (|>> (pipe.case
+ {/.#Compilation it}
+ (|> it
+ (the <slot>)
+ <?>)
+
+ _
+ false)))
(try.else false)))]
[/.Host_Dependency /.#host_dependencies (list#= host_dependencies)]
@@ -83,13 +84,14 @@
(`` (and (~~ (template [<slot> <?>]
[(|> (list& "repl" compilation')
(<cli>.result /.service)
- (try#each (|>> (case> {/.#Interpretation it}
- (|> it
- (the <slot>)
- <?>)
-
- _
- false)))
+ (try#each (|>> (pipe.case
+ {/.#Interpretation it}
+ (|> it
+ (the <slot>)
+ <?>)
+
+ _
+ false)))
(try.else false))]
[/.#host_dependencies (list#= host_dependencies)]
@@ -104,13 +106,14 @@
(`` (and (~~ (template [<side> <?>]
[(|> (list& "export" export)
(<cli>.result /.service)
- (try#each (|>> (case> {/.#Export it}
- (|> it
- <side>
- <?>)
-
- _
- false)))
+ (try#each (|>> (pipe.case
+ {/.#Export it}
+ (|> it
+ <side>
+ <?>)
+
+ _
+ false)))
(try.else false))]
[product.left (list#= sources)]
diff --git a/stdlib/source/test/lux/tool/compiler/meta/export.lux b/stdlib/source/test/lux/tool/compiler/meta/export.lux
index 2864dabfd..762449a9e 100644
--- a/stdlib/source/test/lux/tool/compiler/meta/export.lux
+++ b/stdlib/source/test/lux/tool/compiler/meta/export.lux
@@ -5,7 +5,7 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try ("[1]#[0]" functor)]
[concurrency
["[0]" async]]
@@ -79,41 +79,43 @@
(|> it
(try#each (|>> product.left
sequence.list
- (case> (^ (list {tar.#Normal [actual_path/0 when/0 mode/0 ownership/0 actual_content/0]}
- {tar.#Normal [actual_path/1 when/1 mode/1 ownership/1 actual_content/1]}))
- (with_expansions [<test> (and (and (text#= file/0' (tar.from_path actual_path/0))
- (same? /.mode mode/0)
- (same? /.ownership ownership/0)
- (binary#= content/0 (tar.data actual_content/0)))
- (and (text#= file/1' (tar.from_path actual_path/1))
- (same? /.mode mode/1)
- (same? /.ownership ownership/1)
- (binary#= content/1 (tar.data actual_content/1))))]
- (or <test>
- (let [[[actual_path/0 actual_content/0] [actual_path/1 actual_content/1]]
- [[actual_path/1 actual_content/1] [actual_path/0 actual_content/0]]]
- <test>)))
-
- _
- false)))
+ (pipe.case
+ (^ (list {tar.#Normal [actual_path/0 when/0 mode/0 ownership/0 actual_content/0]}
+ {tar.#Normal [actual_path/1 when/1 mode/1 ownership/1 actual_content/1]}))
+ (with_expansions [<test> (and (and (text#= file/0' (tar.from_path actual_path/0))
+ (same? /.mode mode/0)
+ (same? /.ownership ownership/0)
+ (binary#= content/0 (tar.data actual_content/0)))
+ (and (text#= file/1' (tar.from_path actual_path/1))
+ (same? /.mode mode/1)
+ (same? /.ownership ownership/1)
+ (binary#= content/1 (tar.data actual_content/1))))]
+ (or <test>
+ (let [[[actual_path/0 actual_content/0] [actual_path/1 actual_content/1]]
+ [[actual_path/1 actual_content/1] [actual_path/0 actual_content/0]]]
+ <test>)))
+
+ _
+ false)))
(try.else false)))
(_.cover' [/.export /.file]
(|> it
(try#each (|>> product.right
sequence.list
- (case> (^ (list {tar.#Normal [actual_path/0 _ _ _ actual_content/0]}
- {tar.#Normal [actual_path/1 _ _ _ actual_content/1]}))
- (with_expansions [<test> (and (and (text#= file/0' (tar.from_path actual_path/0))
- (binary#= content/0 (tar.data actual_content/0)))
- (and (text#= file/1' (tar.from_path actual_path/1))
- (binary#= content/1 (tar.data actual_content/1))))]
- (or <test>
- (let [[[actual_path/0 actual_content/0] [actual_path/1 actual_content/1]]
- [[actual_path/1 actual_content/1] [actual_path/0 actual_content/0]]]
- <test>)))
-
- _
- false)))
+ (pipe.case
+ (^ (list {tar.#Normal [actual_path/0 _ _ _ actual_content/0]}
+ {tar.#Normal [actual_path/1 _ _ _ actual_content/1]}))
+ (with_expansions [<test> (and (and (text#= file/0' (tar.from_path actual_path/0))
+ (binary#= content/0 (tar.data actual_content/0)))
+ (and (text#= file/1' (tar.from_path actual_path/1))
+ (binary#= content/1 (tar.data actual_content/1))))]
+ (or <test>
+ (let [[[actual_path/0 actual_content/0] [actual_path/1 actual_content/1]]
+ [[actual_path/1 actual_content/1] [actual_path/0 actual_content/0]]]
+ <test>)))
+
+ _
+ false)))
(try.else false)))
)))
))))
diff --git a/stdlib/source/test/lux/tool/compiler/meta/import.lux b/stdlib/source/test/lux/tool/compiler/meta/import.lux
index 7a24f9a82..e601614f6 100644
--- a/stdlib/source/test/lux/tool/compiler/meta/import.lux
+++ b/stdlib/source/test/lux/tool/compiler/meta/import.lux
@@ -5,7 +5,6 @@
[abstract
[monad {"+" do}]]
[control
- [pipe {"+" case>}]
["[0]" maybe ("[1]#[0]" functor)]
["[0]" try ("[1]#[0]" functor)]
["[0]" exception]
diff --git a/stdlib/source/test/lux/tool/compiler/phase.lux b/stdlib/source/test/lux/tool/compiler/phase.lux
index f0137730a..19ec57c3c 100644
--- a/stdlib/source/test/lux/tool/compiler/phase.lux
+++ b/stdlib/source/test/lux/tool/compiler/phase.lux
@@ -8,7 +8,7 @@
["$[0]" functor {"+" Injection Comparison}]
["$[0]" monad]]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" try ("[1]#[0]" functor)]
["[0]" exception {"+" exception:}]]
[data
@@ -54,19 +54,19 @@
(_.cover [/.failure]
(|> (/.failure expected_error)
(/.result state)
- (case> {try.#Failure actual_error}
- (same? expected_error actual_error)
+ (pipe.case {try.#Failure actual_error}
+ (same? expected_error actual_error)
- _
- false)))
+ _
+ false)))
(_.cover [/.lifted]
(and (|> (/.lifted {try.#Failure expected_error})
(/.result state)
- (case> {try.#Failure actual_error}
- (same? expected_error actual_error)
+ (pipe.case {try.#Failure actual_error}
+ (same? expected_error actual_error)
- _
- false))
+ _
+ false))
(|> (/.lifted {try.#Success expected})
(# /.functor each (same? expected))
(/.result state)
@@ -74,26 +74,26 @@
(_.cover [/.except]
(|> (/.except ..oops [])
(/.result state)
- (case> {try.#Failure error}
- (exception.match? ..oops error)
+ (pipe.case {try.#Failure error}
+ (exception.match? ..oops error)
- _
- false)))
+ _
+ false)))
(_.cover [/.assertion]
(and (|> (/.assertion ..oops [] false)
(/.result state)
- (case> {try.#Failure error}
- (exception.match? ..oops error)
+ (pipe.case {try.#Failure error}
+ (exception.match? ..oops error)
- _
- false))
+ _
+ false))
(|> (/.assertion ..oops [] true)
(/.result state)
- (case> {try.#Success _}
- true
+ (pipe.case {try.#Success _}
+ true
- _
- false))))
+ _
+ false))))
)))
(def: test|state
@@ -125,12 +125,12 @@
(# n.hex encoded)
(text#= state/hex)))))
(/.result' state)
- (case> {try.#Success [state' verdict]}
- (and verdict
- (n.= state state'))
+ (pipe.case {try.#Success [state' verdict]}
+ (and verdict
+ (n.= state state'))
- _
- false)))
+ _
+ false)))
)))
(def: test|operation
@@ -147,20 +147,20 @@
(_.cover [/.result]
(|> (# /.monad in expected)
(/.result state)
- (case> {try.#Success actual}
- (same? expected actual)
+ (pipe.case {try.#Success actual}
+ (same? expected actual)
- _
- false)))
+ _
+ false)))
(_.cover [/.result']
(|> (# /.monad in expected)
(/.result' state)
- (case> {try.#Success [state' actual]}
- (and (same? state state')
- (same? expected actual))
+ (pipe.case {try.#Success [state' actual]}
+ (and (same? state state')
+ (same? expected actual))
- _
- false)))
+ _
+ false)))
..test|state
..test|error
)))
@@ -186,13 +186,13 @@
(# /.monad in (%.frac input)))))]
(|> (phase archive.empty expected)
(/.result' [state/0 state/1])
- (case> {try.#Success [[state/0' state/1'] actual]}
- (and (text#= (%.frac (i.frac expected)) actual)
- (same? state/0 state/0')
- (same? state/1 state/1'))
+ (pipe.case {try.#Success [[state/0' state/1'] actual]}
+ (and (text#= (%.frac (i.frac expected)) actual)
+ (same? state/0 state/0')
+ (same? state/1 state/1'))
- _
- false))))
+ _
+ false))))
)))
(def: .public test
diff --git a/stdlib/source/test/lux/type.lux b/stdlib/source/test/lux/type.lux
index 0d20b2ddc..a9799f045 100644
--- a/stdlib/source/test/lux/type.lux
+++ b/stdlib/source/test/lux/type.lux
@@ -1,39 +1,39 @@
(.using
- [library
- [lux {"-" symbol}
- ["_" test {"+" Test}]
- [abstract
- ["[0]" monad {"+" do}]
- [\\specification
- ["$[0]" equivalence]]]
- [control
- [pipe {"+" case>}]
- ["[0]" maybe]]
- [data
- ["[0]" bit ("[1]#[0]" equivalence)]
- ["[0]" text ("[1]#[0]" equivalence)]
- [collection
- ["[0]" list]
- ["[0]" array]]]
- [macro
- ["[0]" code ("[1]#[0]" equivalence)]]
- [math
- ["[0]" random {"+" Random} ("[1]#[0]" monad)]
- [number
- ["n" nat]]]]]
- [\\library
- ["[0]" / ("[1]#[0]" equivalence)]]
- ["[0]" / "_"
- ["[1][0]" abstract]
- ["[1][0]" check]
- ["[1][0]" dynamic]
- ["[1][0]" implicit]
- ["[1][0]" poly]
- ["[1][0]" quotient]
- ["[1][0]" refinement]
- ["[1][0]" resource]
- ["[1][0]" unit]
- ["[1][0]" variance]])
+ [library
+ [lux {"-" symbol}
+ ["_" test {"+" Test}]
+ [abstract
+ ["[0]" monad {"+" do}]
+ [\\specification
+ ["$[0]" equivalence]]]
+ [control
+ ["[0]" pipe]
+ ["[0]" maybe]]
+ [data
+ ["[0]" bit ("[1]#[0]" equivalence)]
+ ["[0]" text ("[1]#[0]" equivalence)]
+ [collection
+ ["[0]" list]
+ ["[0]" array]]]
+ [macro
+ ["[0]" code ("[1]#[0]" equivalence)]]
+ [math
+ ["[0]" random {"+" Random} ("[1]#[0]" monad)]
+ [number
+ ["n" nat]]]]]
+ [\\library
+ ["[0]" / ("[1]#[0]" equivalence)]]
+ ["[0]" / "_"
+ ["[1][0]" abstract]
+ ["[1][0]" check]
+ ["[1][0]" dynamic]
+ ["[1][0]" implicit]
+ ["[1][0]" poly]
+ ["[1][0]" quotient]
+ ["[1][0]" refinement]
+ ["[1][0]" resource]
+ ["[1][0]" unit]
+ ["[1][0]" variance]])
(def: short
(Random Text)
@@ -80,8 +80,8 @@
($equivalence.spec /.equivalence (..random 0)))
(do [! random.monad]
- [anonymousT (random.only (|>> (case> {.#Named _ _} false
- _ true))
+ [anonymousT (random.only (|>> (pipe.case {.#Named _ _} false
+ _ true))
(..random 0))
symbol/0 ..symbol
symbol/1 ..symbol
@@ -125,7 +125,7 @@
full (/.applied (list Int) partial)]
(in (# /.equivalence = full {.#Product Bit Int}))))
(|> (/.applied (list Bit) Text)
- (case> {.#None} #1 _ #0))))
+ (pipe.case {.#None} #1 _ #0))))
(do [! random.monad]
[size (|> random.nat (# ! each (n.% 3)))
members (monad.all ! (list.repeated size (..random 0)))
diff --git a/stdlib/source/test/lux/type/check.lux b/stdlib/source/test/lux/type/check.lux
index a99a19f5d..04ab804ec 100644
--- a/stdlib/source/test/lux/type/check.lux
+++ b/stdlib/source/test/lux/type/check.lux
@@ -10,7 +10,7 @@
["$[0]" apply]
["$[0]" monad]]]
[control
- [pipe {"+" case>}]
+ ["[0]" pipe]
["[0]" function]
["[0]" try]
["[0]" exception {"+" exception:}]]
@@ -164,13 +164,13 @@
(and (|> (/.check <left> <right>)
(: (/.Check Any))
(/.result /.fresh_context)
- (case> {try.#Failure error} (? error)
- {try.#Success _} false))
+ (pipe.case {try.#Failure error} (? error)
+ {try.#Success _} false))
(|> (/.check <right> <left>)
(: (/.Check Any))
(/.result /.fresh_context)
- (case> {try.#Failure error} (? error)
- {try.#Success _} false)))))]
+ (pipe.case {try.#Failure error} (? error)
+ {try.#Success _} false)))))]
($_ _.and
(_.cover [/.type_check_failed]
(let [scenario (scenario (exception.match? /.type_check_failed))]
@@ -273,26 +273,26 @@
[[var_id var_type] /.var]
(/.peek var_id))
(/.result /.fresh_context)
- (case> {try.#Success {.#None}} true
- _ false))
+ (pipe.case {try.#Success {.#None}} true
+ _ false))
(|> (do /.monad
[[var_id var/0] /.var
[_ var/1] /.var
_ (/.check var/0 var/1)]
(/.peek var_id))
(/.result /.fresh_context)
- (case> {try.#Success {.#None}} true
- _ false))
+ (pipe.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}}
- (same? expected actual)
-
- _
- false)))))
+ (pipe.case {try.#Success {.#Some actual}}
+ (same? expected actual)
+
+ _
+ false)))))
(do random.monad
[nominal (random.ascii/upper 10)
.let [expected {.#Primitive nominal (list)}]]
@@ -364,11 +364,11 @@
(def: succeeds?
(All (_ a) (-> (/.Check a) Bit))
(|>> (/.result /.fresh_context)
- (case> {try.#Success _}
- true
+ (pipe.case {try.#Success _}
+ true
- {try.#Failure error}
- false)))
+ {try.#Failure error}
+ false)))
(def: fails?
(All (_ a) (-> (/.Check a) Bit))
diff --git a/stdlib/source/test/lux/type/poly/json.lux b/stdlib/source/test/lux/type/poly/json.lux
index 668b8ea21..16300a25d 100644
--- a/stdlib/source/test/lux/type/poly/json.lux
+++ b/stdlib/source/test/lux/type/poly/json.lux
@@ -13,7 +13,6 @@
["$[0]" equivalence]
["$[0]" codec]]]
[control
- pipe
["[0]" try]
["p" parser
... TODO: Get rid of this import ASAP
diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux
index 919f7249e..3d4de1e0f 100644
--- a/stdlib/source/test/lux/world/net/http/client.lux
+++ b/stdlib/source/test/lux/world/net/http/client.lux
@@ -5,7 +5,7 @@
[abstract
[monad {"+" Monad do}]]
[control
- [pipe {"+" do>}]
+ ["[0]" pipe]
["[0]" io {"+" IO}]
["[0]" try {"+" Try}]
["[0]" function]
@@ -41,11 +41,11 @@
product.right
(the //.#body)
(function.on {.#None})
- (# ! each (|>> (do> try.monad
- []
- [product.right (# utf8.codec decoded)]
- [(# nat.decimal decoded)]
- [(nat.= expected) in])
+ (# ! each (|>> (pipe.do try.monad
+ []
+ [product.right (# utf8.codec decoded)]
+ [(# nat.decimal decoded)]
+ [(nat.= expected) in])
(try.else false))))
{try.#Failure error}
diff --git a/stdlib/source/test/lux/world/program.lux b/stdlib/source/test/lux/world/program.lux
index de559c620..d1696c608 100644
--- a/stdlib/source/test/lux/world/program.lux
+++ b/stdlib/source/test/lux/world/program.lux
@@ -1,32 +1,32 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]]
- [control
- [pipe {"+" case>}]
- ["[0]" io]
- ["[0]" maybe ("[1]#[0]" functor)]
- ["[0]" try]
- ["[0]" exception]
- [parser
- [environment {"+" Environment}]]]
- [data
- ["[0]" text ("[1]#[0]" equivalence)]
- [collection
- ["[0]" dictionary]
- ["[0]" list]]]
- [math
- ["[0]" random {"+" Random}]
- [number
- ["n" nat]]]]]
- [\\library
- ["[0]" /
- [//
- [file {"+" Path}]]]]
- [\\specification
- ["$[0]" /]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" pipe]
+ ["[0]" io]
+ ["[0]" maybe ("[1]#[0]" functor)]
+ ["[0]" try]
+ ["[0]" exception]
+ [parser
+ [environment {"+" Environment}]]]
+ [data
+ ["[0]" text ("[1]#[0]" equivalence)]
+ [collection
+ ["[0]" dictionary]
+ ["[0]" list]]]
+ [math
+ ["[0]" random {"+" Random}]
+ [number
+ ["n" nat]]]]]
+ [\\library
+ ["[0]" /
+ [//
+ [file {"+" Path}]]]]
+ [\\specification
+ ["$[0]" /]])
(def: (environment env_size)
(-> Nat (Random Environment))
@@ -70,9 +70,9 @@
(|> unknown
(# program variable)
io.run!
- (case> {try.#Success _}
- false
-
- {try.#Failure error}
- (exception.match? /.unknown_environment_variable error)))))
+ (pipe.case {try.#Success _}
+ false
+
+ {try.#Failure error}
+ (exception.match? /.unknown_environment_variable error)))))
))))