aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/tool/compiler/language
diff options
context:
space:
mode:
authorEduardo Julian2022-03-15 07:24:35 -0400
committerEduardo Julian2022-03-15 07:24:35 -0400
commitbc36487224f670c23002cc4575c0dba3e5dc1be1 (patch)
tree01601f7e5d992ace77a16cfa90240ffc4511a7af /stdlib/source/test/lux/tool/compiler/language
parent4ef1ac1dfe0edd1a11bb7f1fd13c8b6cb8f1bab4 (diff)
De-sigil-ification: ^
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux16
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis/coverage.lux12
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis/module.lux2
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux22
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/analysis/scope.lux2
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux182
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux31
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux12
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/simple.lux10
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux10
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux90
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux50
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux4
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux4
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux8
15 files changed, 231 insertions, 224 deletions
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux
index eb623b548..02c25c3e6 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux
@@ -111,7 +111,7 @@
(`` ($_ _.and
(_.cover [/.unit]
(case (/.unit)
- (^ (/.unit))
+ (pattern (/.unit))
true
_
@@ -119,7 +119,7 @@
(~~ (template [<tag> <expected>]
[(_.cover [<tag>]
(case (<tag> <expected>)
- (^ (<tag> actual))
+ (pattern (<tag> actual))
(same? <expected> actual)
_
@@ -146,7 +146,7 @@
expected_right
expected_left)]
(case (/.variant [expected_lefts expected_right? expected])
- (^ (/.variant [actual_lefts actual_right? actual]))
+ (pattern (/.variant [actual_lefts actual_right? actual]))
(and (same? expected_lefts actual_lefts)
(same? expected_right? actual_right?)
(same? expected actual))
@@ -155,7 +155,7 @@
false)))
(_.cover [/.tuple]
(case (/.tuple (list expected_left expected_right))
- (^ (/.tuple (list actual_left actual_right)))
+ (pattern (/.tuple (list actual_left actual_right)))
(and (same? expected_left actual_left)
(same? expected_right actual_right))
@@ -173,7 +173,7 @@
(~~ (template [<tag> <expected>]
[(_.cover [<tag>]
(case (<tag> <expected>)
- (^ (<tag> actual))
+ (pattern (<tag> actual))
(same? <expected> actual)
_
@@ -206,7 +206,7 @@
(case (|> [expected_abstraction (list expected_parameter/0 expected_parameter/1)]
/.reified
/.reification)
- (^ [actual_abstraction (list actual_parameter/0 actual_parameter/1)])
+ (pattern [actual_abstraction (list actual_parameter/0 actual_parameter/1)])
(and (same? expected_abstraction actual_abstraction)
(same? expected_parameter/0 actual_parameter/0)
(same? expected_parameter/1 actual_parameter/1))
@@ -215,7 +215,7 @@
false))
(_.cover [/.no_op]
(case (/.no_op expected_parameter/0)
- (^ (/.no_op actual))
+ (pattern (/.no_op actual))
(same? expected_parameter/0 actual)
_
@@ -230,7 +230,7 @@
($_ _.and
(_.cover [/.case]
(case (/.case [expected_input expected_match])
- (^ (/.case [actual_input actual_match]))
+ (pattern (/.case [actual_input actual_match]))
(and (same? expected_input actual_input)
(same? expected_match actual_match))
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 e7e26bd54..dfd65e1ba 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
@@ -20,6 +20,8 @@
["[0]" set]
["[0]" dictionary]
["[0]" list ("[1]#[0]" functor mix)]]]
+ [macro
+ ["^" pattern]]
[math
["[0]" random {"+" Random} ("[1]#[0]" monad)]
[number
@@ -144,7 +146,7 @@
(def: test|value
Test
- (<| (let [(^open "/#[0]") /.equivalence])
+ (<| (let [(open "/#[0]") /.equivalence])
(do [! random.monad]
[left ..random
right ..random]
@@ -162,7 +164,7 @@
(def: test|coverage
Test
- (<| (let [(^open "/#[0]") /.equivalence])
+ (<| (let [(open "/#[0]") /.equivalence])
(do [! random.monad]
[[expected pattern] ..random_pattern]
($_ _.and
@@ -198,7 +200,7 @@
(def: test|variant
Test
- (<| (let [(^open "/#[0]") /.equivalence])
+ (<| (let [(open "/#[0]") /.equivalence])
(do [! random.monad]
[[expected/0 pattern/0] ..random_partial_pattern
[expected/1 pattern/1] (random.only (|>> product.left (/#= expected/0) not)
@@ -223,7 +225,7 @@
(Random [/.Coverage Pattern])
(random.only (function (_ [coverage pattern])
(case coverage
- (^or {/.#Alt _} {/.#Seq _})
+ (^.or {/.#Alt _} {/.#Seq _})
false
_
@@ -232,7 +234,7 @@
(def: test|composite
Test
- (<| (let [(^open "/#[0]") /.equivalence])
+ (<| (let [(open "/#[0]") /.equivalence])
(do [! random.monad]
[[expected/0 pattern/0] ..random_value_pattern
[expected/1 pattern/1] (random.only (|>> product.left (/#= expected/0) not)
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 52ab6e6ff..f87e34b08 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
@@ -122,7 +122,7 @@
(/phase.result state)
(try#each (|>> (the .#module_aliases)
(pipe.case
- (^ (list [actual_alias actual_import]))
+ (pattern (list [actual_alias actual_import]))
(and (same? expected_alias actual_alias)
(same? expected_import actual_import))
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux
index e5eb0c0f5..cd72d2b50 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux
@@ -52,11 +52,11 @@
($equivalence.spec /.equivalence ..random))
(_.cover [/.format]
- (bit#= (# /.equivalence = left right)
- (text#= (/.format left) (/.format right))))
+ (bit#= (# /.equivalence = left right)
+ (text#= (/.format left) (/.format right))))
(_.cover [/.unit]
(case (/.unit)
- (^ (/.unit))
+ (pattern (/.unit))
true
_
@@ -64,7 +64,7 @@
(~~ (template [<tag> <value>]
[(_.cover [<tag>]
(case (<tag> <value>)
- (^ (<tag> actual))
+ (pattern (<tag> actual))
(same? <value> actual)
_
@@ -80,7 +80,7 @@
))
(_.cover [/.variant]
(case (/.variant [expected_lefts expected_right? (/.text expected_text)])
- (^ (/.variant [actual_lefts actual_right? (/.text actual_text)]))
+ (pattern (/.variant [actual_lefts actual_right? (/.text actual_text)]))
(and (same? expected_lefts actual_lefts)
(same? expected_right? actual_right?)
(same? expected_text actual_text))
@@ -94,12 +94,12 @@
(/.rev expected_rev)
(/.frac expected_frac)
(/.text expected_text)))
- (^ (/.tuple (list (/.bit actual_bit)
- (/.nat actual_nat)
- (/.int actual_int)
- (/.rev actual_rev)
- (/.frac actual_frac)
- (/.text actual_text))))
+ (pattern (/.tuple (list (/.bit actual_bit)
+ (/.nat actual_nat)
+ (/.int actual_int)
+ (/.rev actual_rev)
+ (/.frac actual_frac)
+ (/.text actual_text))))
(and (same? expected_bit actual_bit)
(same? expected_nat actual_nat)
(same? expected_int actual_int)
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 faf28f47e..bd2309561 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
@@ -158,7 +158,7 @@
(n.= 1 (list.size (the [.#captured .#mappings] scope/1))))))
(try.else false)))
(_.cover [/.environment]
- (let [(^open "list#[0]") (list.equivalence //variable.equivalence)]
+ (let [(open "list#[0]") (list.equivalence //variable.equivalence)]
(and (|> (<| /.with
(/.with_local [name/0 type/0])
(/.with_local [name/1 type/1])
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux
index 6c1e342ec..88577b388 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux
@@ -64,7 +64,7 @@
//type.inferring)]
(in (and (type#= .Any :it:)
(case it
- (^ (//.unit))
+ (pattern (//.unit))
true
_
@@ -87,7 +87,7 @@
//type.inferring)]
(in (and (type#= <type> :it:)
(case it
- (^ (<analysis> it))
+ (pattern (<analysis> it))
(same? <expected> it)
_
@@ -128,7 +128,7 @@
(/.phase ..expander archive.empty)
(//type.expecting :variant:))]
(in (case it
- (^ (//.variant [0 #0 (//.unit)]))
+ (pattern (//.variant [0 #0 (//.unit)]))
true
_
@@ -144,7 +144,7 @@
(/.phase ..expander archive.empty)
(//type.expecting :variant:))]
(in (case it
- (^ (//.variant [<lefts> <right> (<analysis> actual)]))
+ (pattern (//.variant [<lefts> <right> (<analysis> actual)]))
(same? <expected> actual)
_
@@ -170,7 +170,7 @@
(/.phase ..expander archive.empty)
(//type.expecting :either:))]
(in (case it
- (^ (//.variant [0 #0 (//.unit)]))
+ (pattern (//.variant [0 #0 (//.unit)]))
true
_
@@ -196,13 +196,13 @@
(/.phase ..expander archive.empty)
(//type.expecting :either:))]
(in (case it
- (^ (//.variant [0 #1 (//.tuple (list (//.unit)
- (//.bit bit/?)
- (//.nat nat/?)
- (//.int int/?)
- (//.rev rev/?)
- (//.frac frac/?)
- (//.text text/?)))]))
+ (pattern (//.variant [0 #1 (//.tuple (list (//.unit)
+ (//.bit bit/?)
+ (//.nat nat/?)
+ (//.int int/?)
+ (//.rev rev/?)
+ (//.frac frac/?)
+ (//.text text/?)))]))
(and (same? bit/0 bit/?)
(same? nat/0 nat/?)
(same? int/0 int/?)
@@ -242,7 +242,7 @@
(in (and (type#= :variant:
:it:)
(case it
- (^ (//.variant [0 #0 (//.unit)]))
+ (pattern (//.variant [0 #0 (//.unit)]))
true
_
@@ -261,7 +261,7 @@
(in (and (type#= :variant:
:it:)
(case it
- (^ (//.variant [<lefts> <right> (<analysis> actual)]))
+ (pattern (//.variant [<lefts> <right> (<analysis> actual)]))
(same? <expected> actual)
_
@@ -292,7 +292,7 @@
(in (and (type#= :either:
:it:)
(case it
- (^ (//.variant [0 #0 (//.unit)]))
+ (pattern (//.variant [0 #0 (//.unit)]))
true
_
@@ -322,13 +322,13 @@
(in (and (type#= :either:
:it:)
(case it
- (^ (//.variant [0 #1 (//.tuple (list (//.unit)
- (//.bit bit/?)
- (//.nat nat/?)
- (//.int int/?)
- (//.rev rev/?)
- (//.frac frac/?)
- (//.text text/?)))]))
+ (pattern (//.variant [0 #1 (//.tuple (list (//.unit)
+ (//.bit bit/?)
+ (//.nat nat/?)
+ (//.int int/?)
+ (//.rev rev/?)
+ (//.frac frac/?)
+ (//.text text/?)))]))
(and (same? bit/0 bit/?)
(same? nat/0 nat/?)
(same? int/0 int/?)
@@ -364,13 +364,13 @@
(in (and (type#= (type [.Any .Bit .Nat .Int .Rev .Frac .Text])
:it:)
(case it
- (^ (//.tuple (list (//.unit)
- (//.bit bit/?)
- (//.nat nat/?)
- (//.int int/?)
- (//.rev rev/?)
- (//.frac frac/?)
- (//.text text/?))))
+ (pattern (//.tuple (list (//.unit)
+ (//.bit bit/?)
+ (//.nat nat/?)
+ (//.int int/?)
+ (//.rev rev/?)
+ (//.frac frac/?)
+ (//.text text/?))))
(and (same? bit/0 bit/?)
(same? nat/0 nat/?)
(same? int/0 int/?)
@@ -407,13 +407,13 @@
(in (and (type#= :record:
:it:)
(case it
- (^ (//.tuple (list (//.unit)
- (//.bit bit/?)
- (//.nat nat/?)
- (//.int int/?)
- (//.rev rev/?)
- (//.frac frac/?)
- (//.text text/?))))
+ (pattern (//.tuple (list (//.unit)
+ (//.bit bit/?)
+ (//.nat nat/?)
+ (//.int int/?)
+ (//.rev rev/?)
+ (//.frac frac/?)
+ (//.text text/?))))
(and (same? bit/0 bit/?)
(same? nat/0 nat/?)
(same? int/0 int/?)
@@ -442,7 +442,7 @@
(in (and (type#= (All (_ a) (-> a .Nat))
:it:)
(case it
- (^ {//.#Function (list) (//.nat nat/?)})
+ (pattern {//.#Function (list) (//.nat nat/?)})
(same? nat/0 nat/?)
_
@@ -463,7 +463,7 @@
(in (and (type#= (All (_ a) (-> a (All (_ b) (-> b .Nat))))
:it:)
(case it
- (^ {//.#Function (list) {//.#Function (list) (//.nat nat/?)}})
+ (pattern {//.#Function (list) {//.#Function (list) (//.nat nat/?)}})
(same? nat/0 nat/?)
_
@@ -484,7 +484,7 @@
(in (and (type#= (All (_ a) (-> a (All (_ b) (-> b b))))
:it:)
(case it
- (^ {//.#Function (list) {//.#Function (list) (//.local 1)}})
+ (pattern {//.#Function (list) {//.#Function (list) (//.local 1)}})
true
_
@@ -503,7 +503,7 @@
(/.phase ..expander archive.empty)
//type.inferring)]
(in (and (case it
- (^ {//.#Function (list) {//.#Function (list (//.local 1)) (//.foreign 0)}})
+ (pattern {//.#Function (list) {//.#Function (list (//.local 1)) (//.foreign 0)}})
true
_
@@ -529,7 +529,7 @@
... (/.phase ..expander archive.empty)
... //type.inferring)]
... (in (case it
- ... (^ {//.#Function (list) {//.#Function (list) (//.local 0)}})
+ ... (pattern {//.#Function (list) {//.#Function (list) (//.local 0)}})
... true
... _
@@ -547,7 +547,7 @@
... (/.phase ..expander archive.empty)
... //type.inferring)]
... (in (case it
- ... (^ {//.#Function (list) {//.#Function (list (//.local 0)) (//.foreign 0)}})
+ ... (pattern {//.#Function (list) {//.#Function (list (//.local 0)) (//.foreign 0)}})
... true
... _
@@ -572,8 +572,8 @@
//type.inferring)]
(in (and (type#= .Bit :it:)
(case it
- (^ {//.#Apply (//.nat nat/?)
- {//.#Function (list) (//.bit bit/?)}})
+ (pattern {//.#Apply (//.nat nat/?)
+ {//.#Function (list) (//.bit bit/?)}})
(and (same? bit/0 bit/?)
(same? nat/0 nat/?))
@@ -593,8 +593,8 @@
//type.inferring)]
(in (and (type#= .Nat :it:)
(case it
- (^ {//.#Apply (//.nat nat/?)
- {//.#Function (list) (//.local 1)}})
+ (pattern {//.#Apply (//.nat nat/?)
+ {//.#Function (list) (//.local 1)}})
(same? nat/0 nat/?)
_
@@ -615,9 +615,9 @@
//type.inferring)]
(in (and (check.subsumes? (All (_ a) (-> a Bit)) :it:)
(case it
- (^ {//.#Apply (//.nat nat/?)
- {//.#Function (list)
- {//.#Function (list) (//.bit bit/?)}}})
+ (pattern {//.#Apply (//.nat nat/?)
+ {//.#Function (list)
+ {//.#Function (list) (//.bit bit/?)}}})
(and (same? bit/0 bit/?)
(same? nat/0 nat/?))
@@ -642,7 +642,7 @@
//type.inferring)]
(in (and (type#= .Text :it:)
(case it
- (^ {//.#Extension "lux text concat" (list (//.text left) (//.text right))})
+ (pattern {//.#Extension "lux text concat" (list (//.text left) (//.text right))})
(and (same? text/0 left)
(same? text/0 right))
@@ -675,10 +675,10 @@
//type.inferring)]
(in (and (type#= .Frac :it:)
(case it
- (^ {//.#Case (<analysis> input/?)
- [[//.#when (//pattern.bind 0)
- //.#then (//.frac frac/?)]
- (list)]})
+ (pattern {//.#Case (<analysis> input/?)
+ [[//.#when (//pattern.bind 0)
+ //.#then (//.frac frac/?)]
+ (list)]})
(and (same? <input> input/?)
(same? frac/0 frac/?))
@@ -700,11 +700,11 @@
//type.inferring)]
(in (and (type#= .Frac :it:)
(case it
- (^ {//.#Case (<analysis> input/?)
- [[//.#when (<pattern> pattern/?)
- //.#then (//.frac frac/?)]
- (list [//.#when (//pattern.bind 0)
- //.#then (//.frac frac/?)])]})
+ (pattern {//.#Case (<analysis> input/?)
+ [[//.#when (<pattern> pattern/?)
+ //.#then (//.frac frac/?)]
+ (list [//.#when (//pattern.bind 0)
+ //.#then (//.frac frac/?)])]})
(and (same? <input> input/?)
(same? <input> pattern/?)
(same? frac/0 frac/?))
@@ -737,11 +737,11 @@
//type.inferring)]
(in (and (type#= .Frac :it:)
(case it
- (^ {//.#Case (//.bit bit/?)
- [[//.#when (//pattern.bit #0)
- //.#then (//.frac false/?)]
- (list [//.#when (//pattern.bit #1)
- //.#then (//.frac true/?)])]})
+ (pattern {//.#Case (//.bit bit/?)
+ [[//.#when (//pattern.bit #0)
+ //.#then (//.frac false/?)]
+ (list [//.#when (//pattern.bit #1)
+ //.#then (//.frac true/?)])]})
(and (same? bit/0 bit/?)
(same? frac/0 false/?)
(same? frac/0 true/?))
@@ -768,11 +768,11 @@
//type.inferring)]
(in (and (type#= .Frac :it:)
(case it
- (^ {//.#Case (//.variant [<lefts> <right?> (<analysis> analysis/?)])
- [[//.#when (//pattern.variant [<lefts> <right?> (<pattern> pattern/?)])
- //.#then (//.frac match/?)]
- (list [//.#when (//pattern.bind 0)
- //.#then (//.frac mismatch/?)])]})
+ (pattern {//.#Case (//.variant [<lefts> <right?> (<analysis> analysis/?)])
+ [[//.#when (//pattern.variant [<lefts> <right?> (<pattern> pattern/?)])
+ //.#then (//.frac match/?)]
+ (list [//.#when (//pattern.bind 0)
+ //.#then (//.frac mismatch/?)])]})
(and (same? <expected> analysis/?)
(same? <expected> pattern/?)
(same? frac/0 match/?)
@@ -807,11 +807,11 @@
//type.inferring)]
(in (and (type#= .Frac :it:)
(case it
- (^ {//.#Case (//.tuple (list (//.bit bit/?) (//.nat nat/?)))
- [[//.#when (//pattern.tuple (list (//pattern.bit #0) (//pattern.bind 0)))
- //.#then (//.frac false/?)]
- (list [//.#when (//pattern.tuple (list (//pattern.bit #1) (//pattern.bind 0)))
- //.#then (//.frac true/?)])]})
+ (pattern {//.#Case (//.tuple (list (//.bit bit/?) (//.nat nat/?)))
+ [[//.#when (//pattern.tuple (list (//pattern.bit #0) (//pattern.bind 0)))
+ //.#then (//.frac false/?)]
+ (list [//.#when (//pattern.tuple (list (//pattern.bit #1) (//pattern.bind 0)))
+ //.#then (//.frac true/?)])]})
(and (same? bit/0 bit/?)
(same? nat/0 nat/?)
(same? frac/0 false/?)
@@ -850,23 +850,23 @@
//type.inferring)]
(in (and (type#= .Frac :it:)
(case it
- (^ {//.#Case (//.tuple (list (//.unit)
- (//.bit bit/?)
- (//.nat nat/?)
- (//.int int/?)
- (//.rev rev/?)
- (//.frac frac/?)
- (//.text text/?)))
- [[//.#when (//pattern.tuple (list (//pattern.unit)
- (//pattern.bit bit/?')
- (//pattern.nat nat/?')
- (//pattern.int int/?')
- (//pattern.rev rev/?')
- (//pattern.frac frac/?')
- (//pattern.text text/?')))
- //.#then (//.frac match/?)]
- (list [//.#when (//pattern.bind 0)
- //.#then (//.frac mismatch/?)])]})
+ (pattern {//.#Case (//.tuple (list (//.unit)
+ (//.bit bit/?)
+ (//.nat nat/?)
+ (//.int int/?)
+ (//.rev rev/?)
+ (//.frac frac/?)
+ (//.text text/?)))
+ [[//.#when (//pattern.tuple (list (//pattern.unit)
+ (//pattern.bit bit/?')
+ (//pattern.nat nat/?')
+ (//pattern.int int/?')
+ (//pattern.rev rev/?')
+ (//pattern.frac frac/?')
+ (//pattern.text text/?')))
+ //.#then (//.frac match/?)]
+ (list [//.#when (//pattern.bind 0)
+ //.#then (//.frac mismatch/?)])]})
(and (same? bit/0 bit/?) (same? bit/0 bit/?')
(same? nat/0 nat/?) (same? nat/0 nat/?')
(same? int/0 int/?) (same? int/0 int/?')
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 f27af5d36..f6d69fc56 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
@@ -18,6 +18,7 @@
["[0]" list ("[1]#[0]" monad monoid)]
["[0]" set]]]
[macro
+ ["^" pattern]
["[0]" code]]
[math
["[0]" random {"+" Random} ("[1]#[0]" monad)]
@@ -104,18 +105,18 @@
(def: (analysed? expected actual)
(-> Code Analysis Bit)
(case [expected actual]
- (^ [[_ {.#Tuple (list)}] (//analysis.unit)])
+ (pattern [[_ {.#Tuple (list)}] (//analysis.unit)])
true
- (^ [[_ {.#Tuple expected}] (//analysis.tuple actual)])
+ (pattern [[_ {.#Tuple expected}] (//analysis.tuple actual)])
(and (n.= (list.size expected)
(list.size actual))
(list.every? (function (_ [expected actual])
(analysed? expected actual))
(list.zipped/2 expected actual)))
- (^template [<expected> <actual>]
- [(^ [[_ {<expected> expected}] (<actual> actual)])
+ (^.template [<expected> <actual>]
+ [(pattern [[_ {<expected> expected}] (<actual> actual)])
(same? expected actual)])
([.#Bit //analysis.bit]
[.#Nat //analysis.nat]
@@ -149,7 +150,7 @@
[analysis (|> (/.sum ..analysis lefts right? archive.empty code)
(//type.expecting type))]
(in (case analysis
- (^ (//analysis.variant [lefts' right?' analysis]))
+ (pattern (//analysis.variant [lefts' right?' analysis]))
(and (n.= lefts lefts')
(bit#= right? right?')
(..analysed? code analysis))
@@ -168,7 +169,7 @@
analysis (|> (/.sum ..analysis lefts right? archive.empty tagC)
(//type.expecting varT))]
(in (case analysis
- (^ (//analysis.variant [lefts' right?' it]))
+ (pattern (//analysis.variant [lefts' right?' it]))
(and (n.= lefts lefts')
(bit#= right? right?')
(..analysed? tagC it))
@@ -241,7 +242,7 @@
analysis (|> (/.variant ..analysis tag archive.empty tagC)
(//type.expecting variantT))]
(in (case analysis
- (^ (//analysis.variant [lefts' right?' analysis]))
+ (pattern (//analysis.variant [lefts' right?' analysis]))
(and (n.= lefts lefts')
(bit#= right? right?')
(..analysed? tagC analysis))
@@ -259,7 +260,7 @@
[actualT analysis] (|> (/.variant ..analysis tag archive.empty tagC)
//type.inferring)]
(in (case analysis
- (^ (//analysis.variant [lefts' right?' analysis]))
+ (pattern (//analysis.variant [lefts' right?' analysis]))
(and (n.= lefts lefts')
(bit#= right? right?')
(..analysed? tagC analysis)
@@ -306,7 +307,7 @@
(/.product ..analysis archive.empty)
(//type.expecting type))]
(in (case analysis
- (^ (//analysis.tuple actual))
+ (pattern (//analysis.tuple actual))
(and (n.= (list.size expected)
(list.size actual))
(list.every? (function (_ [expected actual])
@@ -331,7 +332,7 @@
(/.product ..analysis archive.empty)
(//type.expecting varT))]
(in (case analysis
- (^ (//analysis.tuple actual))
+ (pattern (//analysis.tuple actual))
(and (n.= (list.size expected)
(list.size actual))
(list.every? (function (_ [expected actual])
@@ -349,7 +350,7 @@
(/.product ..analysis archive.empty)
//type.inferring)]
(in (case analysis
- (^ (//analysis.tuple actual))
+ (pattern (//analysis.tuple actual))
(and (n.= (list.size expected)
(list.size actual))
(list.every? (function (_ [expected actual])
@@ -372,7 +373,7 @@
(list term/0 term/1 term/2 term/2 term/2))))
:inferred: (//type.check (check.clean (list @var) :inferred:))]
(in (case analysis
- (^ (//analysis.tuple (list analysis/0 analysis/1 (//analysis.tuple (list analysis/2 analysis/3 analysis/4)))))
+ (pattern (//analysis.tuple (list analysis/0 analysis/1 (//analysis.tuple (list analysis/2 analysis/3 analysis/4)))))
(and (type#= (Tuple type/0 type/1 type/2 type/2 type/2)
:inferred:)
(..analysed? term/0 analysis/0)
@@ -392,7 +393,7 @@
(/.product ..analysis archive.empty)
(//type.expecting (Tuple type/0 type/1 type/2 type/2 type/2)))]
(in (case analysis
- (^ (//analysis.tuple (list analysis/0 analysis/1 (//analysis.tuple (list analysis/2 analysis/3 analysis/4)))))
+ (pattern (//analysis.tuple (list analysis/0 analysis/1 (//analysis.tuple (list analysis/2 analysis/3 analysis/4)))))
(and (..analysed? term/0 analysis/0)
(..analysed? term/1 analysis/1)
(..analysed? term/2 analysis/2)
@@ -481,7 +482,7 @@
(//phase.result state)
(pipe.case
{try.#Success {.#Some actual}}
- (let [(^open "list#[0]") (list.equivalence (product.equivalence symbol.equivalence code.equivalence))]
+ (let [(open "list#[0]") (list.equivalence (product.equivalence symbol.equivalence code.equivalence))]
(list#= expected (list.reversed actual)))
_
@@ -522,7 +523,7 @@
(|> (/.order false (list))
(//phase.result state)
(pipe.case
- (^ {try.#Success {.#Some [0 (list) actual_type]}})
+ (pattern {try.#Success {.#Some [0 (list) actual_type]}})
(same? .Any actual_type)
_
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 45fef5649..d8c5ce4f8 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
@@ -54,7 +54,7 @@
(//phase.result state)
(try#each (|>> product.right
(pipe.case
- (^ [actual_type (//analysis.local 0)])
+ (pattern [actual_type (//analysis.local 0)])
(type#= expected_type actual_type)
_
@@ -73,7 +73,7 @@
(try#each (|>> product.right
product.right
(pipe.case
- (^ [actual_type (//analysis.foreign 0)])
+ (pattern [actual_type (//analysis.foreign 0)])
(type#= expected_type actual_type)
_
@@ -89,7 +89,7 @@
(//phase.result state)
(try#each (|>> product.right
(pipe.case
- (^ [actual_type (//analysis.constant [actual_module actual_name])])
+ (pattern [actual_type (//analysis.constant [actual_module actual_name])])
(and (type#= expected_type actual_type)
(same? expected_module actual_module)
(same? expected_name actual_name))
@@ -109,7 +109,7 @@
(//phase.result state)
(try#each (|>> product.right
(pipe.case
- (^ [actual_type (//analysis.constant [actual_module actual_name])])
+ (pattern [actual_type (//analysis.constant [actual_module actual_name])])
(and (type#= expected_type actual_type)
(same? import actual_module)
(same? expected_name actual_name))
@@ -130,7 +130,7 @@
(//phase.result state)
(try#each (|>> product.right
(pipe.case
- (^ [actual_type (//analysis.constant [actual_module actual_name])])
+ (pattern [actual_type (//analysis.constant [actual_module actual_name])])
(and (type#= expected_type actual_type)
(same? import actual_module)
(same? expected_name actual_name))
@@ -151,7 +151,7 @@
(//phase.result state)
(try#each (|>> product.right
(pipe.case
- (^ [actual_type (//analysis.constant [actual_module actual_name])])
+ (pattern [actual_type (//analysis.constant [actual_module actual_name])])
(and (type#= .Type actual_type)
(same? expected_module actual_module)
(same? expected_name actual_name))
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 454cebdc6..ea5d4ebb4 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
@@ -35,7 +35,7 @@
(/phase.result [/extension.#bundle /extension.empty
/extension.#state state])
(pipe.case
- (^ {try.#Success analysis})
+ (pattern {try.#Success analysis})
(? analysis)
_
@@ -47,7 +47,7 @@
(/phase.result [/extension.#bundle /extension.empty
/extension.#state state])
(pipe.case
- (^ {try.#Failure error})
+ (pattern {try.#Failure error})
true
_
@@ -59,7 +59,7 @@
(/phase.result [/extension.#bundle /extension.empty
/extension.#state state])
(pipe.case
- (^ {try.#Success [inferred analysis]})
+ (pattern {try.#Success [inferred analysis]})
(and (type#= type inferred)
(? analysis))
@@ -70,7 +70,7 @@
[(: (-> <type> Analysis Bit)
(function (_ expected)
(|>> (pipe.case
- (^ (<tag> actual))
+ (pattern (<tag> actual))
(same? expected actual)
_
@@ -87,7 +87,7 @@
(`` ($_ _.and
(_.cover [/.unit]
(..analysis state module .Any /.unit
- (|>> (pipe.case (^ (/analysis.unit)) true _ false))))
+ (|>> (pipe.case (pattern (/analysis.unit)) true _ false))))
(~~ (template [<analysis> <type> <random> <tag>]
[(do !
[sample <random>]
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 c5d7ccd02..ea325ec72 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
@@ -72,7 +72,7 @@
(//.phase archive.empty)
(phase.result [///bundle.empty synthesis.init])
(pipe.case
- (^ {try.#Success (synthesis.branch/let [inputS registerS outputS])})
+ (pattern {try.#Success (synthesis.branch/let [inputS registerS outputS])})
(and (n.= registerA registerS)
(//primitive.corresponds? inputA inputS)
(//primitive.corresponds? outputA outputS))
@@ -101,7 +101,7 @@
(//.phase archive.empty)
(phase.result [///bundle.empty synthesis.init])
(pipe.case
- (^ {try.#Success (synthesis.branch/if [inputS thenS elseS])})
+ (pattern {try.#Success (synthesis.branch/if [inputS thenS elseS])})
(and (//primitive.corresponds? inputA inputS)
(//primitive.corresponds? thenA thenS)
(//primitive.corresponds? elseA elseS))
@@ -161,7 +161,7 @@
(//.phase archive.empty)
(phase.result [///bundle.empty synthesis.init])
(pipe.case
- (^ {try.#Success (synthesis.branch/get [pathS recordS])})
+ (pattern {try.#Success (synthesis.branch/get [pathS recordS])})
(and (# (list.equivalence (sum.equivalence n.= n.=)) = pathA pathS)
(//primitive.corresponds? recordA recordS))
@@ -189,7 +189,7 @@
(random.set hash 5)
(# random.monad each (|>> set.list
(pipe.case
- (^ (list s0 s1 s2 s3 s4))
+ (pattern (list s0 s1 s2 s3 s4))
[s0 s1 s2 s3 s4]
_
@@ -338,7 +338,7 @@
(|> (/.synthesize_case //.phase archive.empty expected_input match)
(phase.result [///bundle.empty synthesis.init])
(pipe.case
- (^ {try.#Success (synthesis.branch/case [actual_input actual_path])})
+ (pattern {try.#Success (synthesis.branch/case [actual_input actual_path])})
(and (# synthesis.equivalence = expected_input actual_input)
(# synthesis.path_equivalence = expected_path actual_path))
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux
index 79b5c2e8a..ba3f7dc86 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux
@@ -1,40 +1,42 @@
(.using
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- ["[0]" monad {"+" do}]]
- [control
- ["[0]" try]]
- [data
- ["[0]" product]
- ["[0]" text
- ["%" format {"+" format}]]
- [number
- ["n" nat]]
- [collection
- ["[0]" list ("[1]#[0]" functor mix monoid)]
- ["[0]" dictionary {"+" Dictionary}]
- ["[0]" set]]]
- [math
- ["[0]" random {"+" Random}]]]
- ["[0]" // "_"
- ["[1][0]" primitive]]
- [\\
- ["[0]" /
- ["/[1]" //
- ["/[1]" // "_"
- [extension
- ["[1][0]" bundle]]
- ["/[1]" //
- ["[0]" analysis {"+" Analysis}]
- ["[0]" synthesis {"+" Synthesis}]
- [///
- [arity {"+" Arity}]
- ["[0]" reference
- ["[0]" variable {"+" Variable}]]
- ["[0]" phase]
- [meta
- ["[0]" archive]]]]]]]])
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ ["[0]" monad {"+" do}]]
+ [control
+ ["[0]" try]]
+ [data
+ ["[0]" product]
+ ["[0]" text
+ ["%" format {"+" format}]]
+ [number
+ ["n" nat]]
+ [collection
+ ["[0]" list ("[1]#[0]" functor mix monoid)]
+ ["[0]" dictionary {"+" Dictionary}]
+ ["[0]" set]]]
+ [macro
+ ["^" pattern]]
+ [math
+ ["[0]" random {"+" Random}]]]
+ ["[0]" // "_"
+ ["[1][0]" primitive]]
+ [\\
+ ["[0]" /
+ ["/[1]" //
+ ["/[1]" // "_"
+ [extension
+ ["[1][0]" bundle]]
+ ["/[1]" //
+ ["[0]" analysis {"+" Analysis}]
+ ["[0]" synthesis {"+" Synthesis}]
+ [///
+ [arity {"+" Arity}]
+ ["[0]" reference
+ ["[0]" variable {"+" Variable}]]
+ ["[0]" phase]
+ [meta
+ ["[0]" archive]]]]]]]])
(def: (n_function loop? arity body)
(-> Bit Arity Synthesis Synthesis)
@@ -432,8 +434,8 @@
(|> input
(//.phase archive.empty)
(phase.result [///bundle.empty synthesis.init])
- (!expect (^multi {try.#Success actual}
- (# synthesis.equivalence = expected actual)))))))
+ (!expect (^.multi {try.#Success actual}
+ (# synthesis.equivalence = expected actual)))))))
(def: application
Test
@@ -445,15 +447,15 @@
(and (|> (analysis.apply [funcA argsA])
(//.phase archive.empty)
(phase.result [///bundle.empty synthesis.init])
- (!expect (^multi (^ {try.#Success (synthesis.function/apply [funcS argsS])})
- (and (//primitive.corresponds? funcA funcS)
- (list.every? (product.uncurried //primitive.corresponds?)
- (list.zipped/2 argsA argsS))))))
+ (!expect (^.multi (pattern {try.#Success (synthesis.function/apply [funcS argsS])})
+ (and (//primitive.corresponds? funcA funcS)
+ (list.every? (product.uncurried //primitive.corresponds?)
+ (list.zipped/2 argsA argsS))))))
(|> (analysis.apply [funcA (list)])
(//.phase archive.empty)
(phase.result [///bundle.empty synthesis.init])
- (!expect (^multi {try.#Success funcS}
- (//primitive.corresponds? funcA funcS))))))))
+ (!expect (^.multi {try.#Success funcS}
+ (//primitive.corresponds? funcA funcS))))))))
(def: .public test
Test
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
index 4a89589e2..1f220e13a 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
@@ -1,27 +1,27 @@
(.using
- [lux {"-" structure loop function}
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]]
- [control
- ["[0]" try]
- ["[0]" exception]]
- [data
- [number
- ["n" nat]]
- [collection
- ["[0]" list ("[1]#[0]" functor)]]]
- [math
- ["[0]" random {"+" Random} ("[1]#[0]" monad)]]]
- [\\
- ["[0]" /
- [////
- ["[0]" analysis {"+" Environment}]
- ["/[1]" synthesis {"+" Member Path Synthesis}]
- [///
- [arity {"+" Arity}]
- ["[0]" reference {"+" Constant}
- ["[0]" variable {"+" Register Variable}]]]]]])
+ [lux {"-" structure loop function}
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" try]
+ ["[0]" exception]]
+ [data
+ [number
+ ["n" nat]]
+ [collection
+ ["[0]" list ("[1]#[0]" functor)]]]
+ [math
+ ["[0]" random {"+" Random} ("[1]#[0]" monad)]]]
+ [\\
+ ["[0]" /
+ [////
+ ["[0]" analysis {"+" Environment}]
+ ["/[1]" synthesis {"+" Member Path Synthesis}]
+ [///
+ [arity {"+" Arity}]
+ ["[0]" reference {"+" Constant}
+ ["[0]" variable {"+" Register Variable}]]]]]])
(type: (Scenario a)
(-> Register Arity Register (Random [Register [a a]])))
@@ -279,8 +279,8 @@
(list#each (|>> {variable.#Local})))
//.#arity arity
//.#body iteration])
- (^ {.#Some (//.loop/scope [actual_offset actual_inits
- actual])})
+ (pattern {.#Some (//.loop/scope [actual_offset actual_inits
+ actual])})
(and (n.= expected_offset
actual_offset)
(# (list.equivalence //.equivalence) =
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/primitive.lux
index 159207280..80499a5e2 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
@@ -60,8 +60,8 @@
[////analysis.#Text (|>) ////synthesis.#Text (|>)]
))
- (^ [(////analysis.tuple expected)
- (////synthesis.tuple actual)])
+ (pattern [(////analysis.tuple expected)
+ (////synthesis.tuple actual)])
(and (n.= (list.size expected)
(list.size actual))
(list.every? (function (_ [expected actual])
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux
index 2f66190b4..6adfb95b2 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
@@ -49,7 +49,7 @@
(//.phase archive.empty)
(phase.result [///bundle.empty ////synthesis.init])
(pipe.case
- (^ {try.#Success (////synthesis.variant [leftsS right?S valueS])})
+ (pattern {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))
@@ -68,7 +68,7 @@
(//.phase archive.empty)
(phase.result [///bundle.empty ////synthesis.init])
(pipe.case
- (^ {try.#Success (////synthesis.tuple membersS)})
+ (pattern {try.#Success (////synthesis.tuple membersS)})
(and (n.= size (list.size membersS))
(list.every? (product.uncurried //primitive.corresponds?)
(list.zipped/2 membersA membersS)))
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
index 42a9d531a..f6085d963 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
@@ -15,7 +15,9 @@
["n" nat]]
[collection
["[0]" list ("[1]#[0]" functor mix)]
- ["[0]" dictionary {"+" Dictionary}]]]]
+ ["[0]" dictionary {"+" Dictionary}]]]
+ [macro
+ ["^" pattern]]]
[\\
["[0]" /
[////
@@ -329,6 +331,6 @@
[[expected input] (..scenario ..default)]
(_.cover [/.optimization]
(|> (/.optimization input)
- (!expect (^multi {try.#Success actual}
- (# synthesis.equivalence = expected actual))))))
+ (!expect (^.multi {try.#Success actual}
+ (# synthesis.equivalence = expected actual))))))
)))