From fb46beb8bd784ba92949bf2c535dc13c2f003ef0 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 25 Jun 2022 20:24:43 -0400 Subject: De-sigil-ification: suffix : [Part 15] --- stdlib/source/test/aedifex/cache.lux | 2 +- .../source/test/aedifex/dependency/deployment.lux | 2 +- stdlib/source/test/aedifex/repository.lux | 2 +- stdlib/source/test/lux.lux | 26 ++++----- stdlib/source/test/lux/abstract/equivalence.lux | 6 +-- stdlib/source/test/lux/control/parser/type.lux | 6 +-- stdlib/source/test/lux/control/security/policy.lux | 4 +- stdlib/source/test/lux/data/format/json.lux | 6 +-- stdlib/source/test/lux/debug.lux | 10 ++-- stdlib/source/test/lux/locale/language.lux | 2 +- stdlib/source/test/lux/locale/territory.lux | 2 +- stdlib/source/test/lux/macro/pattern.lux | 2 +- stdlib/source/test/lux/target/jvm.lux | 4 +- .../compiler/language/lux/analysis/inference.lux | 38 ++++++------- .../tool/compiler/language/lux/phase/analysis.lux | 16 +++--- .../compiler/language/lux/phase/analysis/case.lux | 10 ++-- .../language/lux/phase/analysis/complex.lux | 28 +++++----- .../language/lux/phase/analysis/function.lux | 8 +-- .../language/lux/phase/extension/analysis/lux.lux | 6 +-- .../language/lux/phase/synthesis/function.lux | 4 +- .../compiler/language/lux/phase/synthesis/loop.lux | 2 +- .../language/lux/phase/synthesis/variable.lux | 4 +- stdlib/source/test/lux/type.lux | 2 +- stdlib/source/test/lux/type/check.lux | 62 +++++++++++----------- stdlib/source/test/lux/type/variance.lux | 20 +++---- stdlib/source/test/lux/world/file.lux | 2 +- 26 files changed, 138 insertions(+), 138 deletions(-) (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/aedifex/cache.lux b/stdlib/source/test/aedifex/cache.lux index 4d3a64634..515ca42b7 100644 --- a/stdlib/source/test/aedifex/cache.lux +++ b/stdlib/source/test/aedifex/cache.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except Type type) + [lux (.except Type) ["_" test (.only Test)] [abstract ["[0]" monad (.only do)]] diff --git a/stdlib/source/test/aedifex/dependency/deployment.lux b/stdlib/source/test/aedifex/dependency/deployment.lux index 181e6b5b7..fee8caf9d 100644 --- a/stdlib/source/test/aedifex/dependency/deployment.lux +++ b/stdlib/source/test/aedifex/dependency/deployment.lux @@ -58,7 +58,7 @@ {try.#Success} io.io))]]) -(type: Cache +(type Cache (Atom (Dictionary URL Binary))) (def (http cache) diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux index 024752e67..1602fab49 100644 --- a/stdlib/source/test/aedifex/repository.lux +++ b/stdlib/source/test/aedifex/repository.lux @@ -50,7 +50,7 @@ (exception.report "URI" (%.text uri))) -(type: Store +(type Store (Dictionary URI Binary)) (def .public empty diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 14bb1ec55..35ba915da 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -185,7 +185,7 @@ false)) ))) -(type: (Returner a) +(type (Returner a) (/.Interface (is (-> Any a) return))) @@ -508,18 +508,18 @@ )))))) )))))) -(/.type: for_type/variant +(/.type for_type/variant (Variant {#Case/0} {#Case/1 Nat} {#Case/2 Int Text})) -(/.type: for_type/record +(/.type for_type/record (Record [#slot/0 Bit #slot/1 Rev])) -(/.type: (for_type/all parameter) +(/.type (for_type/all parameter) [parameter parameter]) (def for_type @@ -560,36 +560,36 @@ _ false)) - (_.coverage [/.type] - (and (case (/.type [expected/0 expected/1]) + (_.coverage [/.type_literal] + (and (case (/.type_literal [expected/0 expected/1]) {.#Product actual/0 actual/1} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) _ false) - (case (/.type (/.Or expected/0 expected/1)) + (case (/.type_literal (/.Or expected/0 expected/1)) {.#Sum actual/0 actual/1} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) _ false) - (case (/.type (-> expected/0 expected/1)) + (case (/.type_literal (-> expected/0 expected/1)) {.#Function actual/0 actual/1} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) _ false) - (case (/.type (expected/0 expected/1)) + (case (/.type_literal (expected/0 expected/1)) {.#Apply actual/1 actual/0} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) _ false))) - (_.coverage [/.type:] + (_.coverage [/.type] (exec (is /.Type ..for_type/variant) (is /.Type ..for_type/record) @@ -694,12 +694,12 @@ (text#= static_char))) ))) -(type: Small +(type Small (Record [#small_left Nat #small_right Text])) -(type: Big +(type Big (Record [#big_left Nat #big_right Small])) @@ -932,7 +932,7 @@ false))) ))) -(type: (Pair l r) +(type (Pair l r) (Record [#left l #right r])) diff --git a/stdlib/source/test/lux/abstract/equivalence.lux b/stdlib/source/test/lux/abstract/equivalence.lux index 2518cdf8c..96a7b3863 100644 --- a/stdlib/source/test/lux/abstract/equivalence.lux +++ b/stdlib/source/test/lux/abstract/equivalence.lux @@ -25,19 +25,19 @@ [\\library ["[0]" / (.only Equivalence)]]) -(type: Variant +(type Variant (.Variant {#Case0 Bit} {#Case1 Int} {#Case2 Frac})) -(type: Recursive +(type Recursive (Rec Recursive (.Variant {#Number Frac} {#Addition Frac Recursive}))) -(type: Record +(type Record (.Record [#bit Bit #int Int diff --git a/stdlib/source/test/lux/control/parser/type.lux b/stdlib/source/test/lux/control/parser/type.lux index 7109f9b76..11f7b7796 100644 --- a/stdlib/source/test/lux/control/parser/type.lux +++ b/stdlib/source/test/lux/control/parser/type.lux @@ -214,17 +214,17 @@ [expected ..primitive] (all _.and (_.coverage [/.recursive] - (|> (.type (Rec @ expected)) + (|> (.type_literal (Rec @ expected)) (/.result (/.recursive /.any)) (!expect (^.multi {try.#Success [@self actual]} (type#= expected actual))))) (_.coverage [/.recursive_self] - (|> (.type (Rec @ @)) + (|> (.type_literal (Rec @ @)) (/.result (/.recursive /.recursive_self)) (!expect (^.multi {try.#Success [@expected @actual]} (same? @expected @actual))))) (_.coverage [/.recursive_call] - (|> (.type (All (self input) (self input))) + (|> (.type_literal (All (self input) (self input))) (/.result (/.polymorphic /.recursive_call)) (!expect {try.#Success [@self inputs ???]}))) (_.coverage [/.not_recursive] diff --git a/stdlib/source/test/lux/control/security/policy.lux b/stdlib/source/test/lux/control/security/policy.lux index 5a403c049..1cfbf5c9e 100644 --- a/stdlib/source/test/lux/control/security/policy.lux +++ b/stdlib/source/test/lux/control/security/policy.lux @@ -32,10 +32,10 @@ (== (can_reveal left) (can_reveal right)))) -(type: Password +(type Password (Private Text)) -(type: (Policy %) +(type (Policy %) (Interface (is (Hash (Password %)) &hash) diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 4dd656edd..8116043d2 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -186,19 +186,19 @@ (at (dictionary.equivalence text.equivalence) = expected actual)))))) )))) -(type: Variant +(type Variant (.Variant {#Bit Bit} {#Text Text} {#Frac Frac})) -(type: Recursive +(type Recursive (Rec Recursive (.Variant {#Number Frac} {#Addition Frac Recursive}))) -(type: Record +(type Record (.Record [#bit Bit #frac Frac diff --git a/stdlib/source/test/lux/debug.lux b/stdlib/source/test/lux/debug.lux index 77c56d59f..a789cdaf6 100644 --- a/stdlib/source/test/lux/debug.lux +++ b/stdlib/source/test/lux/debug.lux @@ -76,7 +76,7 @@ [sample_bit random.bit sample_int random.int sample_frac random.frac] - (in (`` (and (case (/.representation (type [Bit Int Frac]) + (in (`` (and (case (/.representation (type_literal [Bit Int Frac]) [sample_bit sample_int sample_frac]) {try.#Success actual} (text#= (format "[" (%.bit sample_bit) @@ -89,7 +89,7 @@ false) ... TODO: Uncomment after switching from the old (tag+last?) to the new (lefts+right?) representation for variants ... (~~ (with_template [ ] - ... [(|> (/.representation (type (Or Bit Int Frac)) + ... [(|> (/.representation (type_literal (Or Bit Int Frac)) ... (is (Or Bit Int Frac) ... ( ))) ... (try#each (text#= (format "(" (%.nat ) @@ -171,11 +171,11 @@ (|> (/.representation .Any sample_frac) (try#each (text#= "[]")) (try.else false)) - (|> (/.representation (type (List Nat)) (is (List Nat) (list sample_nat))) + (|> (/.representation (type_literal (List Nat)) (is (List Nat) (list sample_nat))) (try#each (text#= (%.list %.nat (list sample_nat)))) (try.else false)) (~~ (with_template [] - [(|> (/.representation (type (Maybe Nat)) (is (Maybe Nat) )) + [(|> (/.representation (type_literal (Maybe Nat)) (is (Maybe Nat) )) (try#each (text#= (%.maybe %.nat ))) (try.else false))] @@ -226,7 +226,7 @@ {try.#Success _} {try.#Failure "OOPS!"})))) -(type: My_Text +(type My_Text Text) (def .public test diff --git a/stdlib/source/test/lux/locale/language.lux b/stdlib/source/test/lux/locale/language.lux index feb665622..12603ae23 100644 --- a/stdlib/source/test/lux/locale/language.lux +++ b/stdlib/source/test/lux/locale/language.lux @@ -23,7 +23,7 @@ [\\library ["[0]" /]]) -(type: Bundle +(type Bundle (Record [#amount Nat #names (Set Text) diff --git a/stdlib/source/test/lux/locale/territory.lux b/stdlib/source/test/lux/locale/territory.lux index 5791c88d0..16483d620 100644 --- a/stdlib/source/test/lux/locale/territory.lux +++ b/stdlib/source/test/lux/locale/territory.lux @@ -23,7 +23,7 @@ [\\library ["[0]" /]]) -(type: Bundle +(type Bundle (Record [#amount Nat #names (Set Text) diff --git a/stdlib/source/test/lux/macro/pattern.lux b/stdlib/source/test/lux/macro/pattern.lux index 2f28518bd..8ebdf71db 100644 --- a/stdlib/source/test/lux/macro/pattern.lux +++ b/stdlib/source/test/lux/macro/pattern.lux @@ -17,7 +17,7 @@ [\\library ["[0]" /]]) -(type: (Pair l r) +(type (Pair l r) (Record [#left l #right r])) diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index b3cd98618..c282c2250 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except Type Primitive Label type int) + [lux (.except Type Primitive Label int) ["[0]" ffi (.only import)] ["@" target] [abstract @@ -150,7 +150,7 @@ {try.#Failure error} false)))) -(type: (Primitive a) +(type (Primitive a) (Record [#unboxed (Type category.Return) #boxed (Type category.Class) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux index 88a527b3e..d862aaf5e 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux @@ -130,7 +130,7 @@ analysis/*)))) (try.else false)) (|> (/.general archive.empty ..analysis - (type (-> type/0 expected)) + (type_literal (-> type/0 expected)) (list term/0)) (//type.expecting expected) (//module.with 0 (product.left name)) @@ -139,7 +139,7 @@ (try#each (|>> product.left (type#= expected))) (try.else false)) (|> (/.general archive.empty ..analysis - (type {.#Named name (-> type/0 expected)}) + (type_literal {.#Named name (-> type/0 expected)}) (list term/0)) (//type.expecting expected) (//module.with 0 (product.left name)) @@ -148,7 +148,7 @@ (try#each (|>> product.left (type#= expected))) (try.else false)) (|> (/.general archive.empty ..analysis - (type (All (_ a) (-> a a))) + (type_literal (All (_ a) (-> a a))) (list term/0)) (//type.expecting type/0) (//module.with 0 (product.left name)) @@ -159,7 +159,7 @@ (try#each (type#= type/0)) (try.else false)) (|> (/.general archive.empty ..analysis - (type ((All (_ a) (-> a a)) type/0)) + (type_literal ((All (_ a) (-> a a)) type/0)) (list term/0)) (//type.expecting type/0) (//module.with 0 (product.left name)) @@ -169,7 +169,7 @@ (try.else false)) (|> (do /phase.monad [[@var varT] (//type.check check.var) - _ (//type.check (check.check varT (type (-> type/0 expected))))] + _ (//type.check (check.check varT (type_literal (-> type/0 expected))))] (/.general archive.empty ..analysis varT (list term/0))) (//type.expecting expected) (//module.with 0 (product.left name)) @@ -180,7 +180,7 @@ (try#each (type#= expected)) (try.else false)) (|> (/.general archive.empty ..analysis - (type (Ex (_ a) (-> a a))) + (type_literal (Ex (_ a) (-> a a))) (list (` ("lux io error" "")))) //type.inferring (//module.with 0 (product.left name)) @@ -203,7 +203,7 @@ (..fails? /.cannot_infer)))) (_.coverage [/.cannot_infer_argument] (|> (/.general archive.empty ..analysis - (type (-> expected expected)) + (type_literal (-> expected expected)) (list term/0)) (//type.expecting expected) (//module.with 0 (product.left name)) @@ -263,11 +263,11 @@ (variant? {.#Named name variantT} lefts right? tagC) cases_independent_of_parameters_conform_to_anything! - (variant? (type (Maybe type/0)) 0 #0 (' [])) + (variant? (type_literal (Maybe type/0)) 0 #0 (' [])) cases_dependent_on_parameters_are_tettered_to_those_parameters! - (and (variant? (type (Maybe type/0)) 0 #1 term/0) - (not (variant? (type (Maybe type/0)) 0 #1 term/1))) + (and (variant? (type_literal (Maybe type/0)) 0 #1 term/0) + (not (variant? (type_literal (Maybe type/0)) 0 #1 term/1))) only_bottom_conforms_to_tags_outside_of_range! (`` (and (~~ (with_template [ ] @@ -277,24 +277,24 @@ [#1 (` ("lux io error" ""))])))) can_handle_universal_quantification! - (and (variant?' (type (All (_ a) (Maybe a))) + (and (variant?' (type_literal (All (_ a) (Maybe a))) {.#Some Maybe} 0 #0 (' [])) - (variant?' (type (All (_ a) (Maybe a))) - {.#Some (type (Maybe type/0))} + (variant?' (type_literal (All (_ a) (Maybe a))) + {.#Some (type_literal (Maybe type/0))} 0 #1 term/0) - (not (variant?' (type (All (_ a) (Maybe a))) + (not (variant?' (type_literal (All (_ a) (Maybe a))) {.#Some Maybe} 0 #1 term/0))) existential_types_do_not_affect_independent_cases! - (variant?' (type (Ex (_ a) (Maybe a))) + (variant?' (type_literal (Ex (_ a) (Maybe a))) {.#None} 0 #0 (' [])) existential_types_affect_dependent_cases! (`` (and (~~ (with_template [ ] - [(bit#= (variant?' (type (Ex (_ a) (Maybe a))) {.#None} 0 #1 ))] + [(bit#= (variant?' (type_literal (Ex (_ a) (Maybe a))) {.#None} 0 #1 ))] [#0 term/0] [#1 (` ("lux io error" ""))]))))] @@ -411,13 +411,13 @@ ..test|variant ..test|record (_.coverage [/.invalid_type_application] - (and (|> (/.general archive.empty ..analysis (type (type/0 type/1)) (list term/0)) + (and (|> (/.general archive.empty ..analysis (type_literal (type/0 type/1)) (list term/0)) (/phase.result state) (..fails? /.invalid_type_application)) - (|> (/.variant lefts right? (type (type/0 type/1))) + (|> (/.variant lefts right? (type_literal (type/0 type/1))) (/phase.result state) (..fails? /.invalid_type_application)) - (|> (/.record lefts (type (type/0 type/1))) + (|> (/.record lefts (type_literal (type/0 type/1))) (/phase.result state) (..fails? /.invalid_type_application)))) )))) 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 894713848..8e4113010 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 @@ -227,10 +227,10 @@ (let [state [extension.#bundle (extension/analysis.bundle ..eval) extension.#state lux] :record: {.#Named [module/0 @text] - (type [.Any .Bit .Nat .Int .Rev .Frac .Text])} + (type_literal [.Any .Bit .Nat .Int .Rev .Frac .Text])} slots/* (list @any @bit @nat @int @rev @frac @text) :variant: {.#Named [module/0 @text] - (type (Or .Any .Bit .Nat .Int .Rev .Frac .Text))} + (type_literal (Or .Any .Bit .Nat .Int .Rev .Frac .Text))} tags/* (list @any @bit @nat @int @rev @frac @text) can_analyse_unary! @@ -284,7 +284,7 @@ (|> (do phase.monad [_ (//module.declare_labels true slots/* false :record:) .let [:either: {.#Named [module/0 module/0] - (type (Or .Any :record:))}] + (type_literal (Or .Any :record:))}] _ (//module.declare_labels false (list @left @right) false :either:) [:it: it] (|> (code.variant (list (code.local @left))) (/.phase ..expander archive.empty) @@ -307,7 +307,7 @@ (|> (do phase.monad [_ (//module.declare_labels true slots/* false :record:) .let [:either: {.#Named [module/0 module/0] - (type (Or .Any :record:))}] + (type_literal (Or .Any :record:))}] _ (//module.declare_labels false (list @left @right) false :either:) [:it: it] (|> (code.variant (list (code.local @right) (` []) @@ -361,7 +361,7 @@ (code.text text/0))) (/.phase ..expander archive.empty) //type.inferring)] - (in (and (type#= (type [.Any .Bit .Nat .Int .Rev .Frac .Text]) + (in (and (type#= (type_literal [.Any .Bit .Nat .Int .Rev .Frac .Text]) :it:) (case it (pattern (//.tuple (list (//.unit) @@ -391,7 +391,7 @@ (let [state [extension.#bundle (extension/analysis.bundle ..eval) extension.#state lux] :record: {.#Named [module/0 @text] - (type [.Any .Bit .Nat .Int .Rev .Frac .Text])} + (type_literal [.Any .Bit .Nat .Int .Rev .Frac .Text])} slots/* (list @any @bit @nat @int @rev @frac @text)] (|> (do phase.monad [_ (//module.declare_labels true slots/* false :record:) @@ -660,11 +660,11 @@ extension.#state lux] :variant: {.#Named [module/0 module/0] - (type (Or .Any .Bit .Nat .Int .Rev .Frac .Text))} + (type_literal (Or .Any .Bit .Nat .Int .Rev .Frac .Text))} tags/* (list @any @bit @nat @int @rev @frac @text) :record: {.#Named [module/0 module/0] - (type (And .Any .Bit .Nat .Int .Rev .Frac .Text))} + (type_literal (And .Any .Bit .Nat .Int .Rev .Frac .Text))} slots/* (list @any @bit @nat @int @rev @frac @text) simple! 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 0564c82db..8f58207b2 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 @@ -92,12 +92,12 @@ (Tuple (All (_ a b c) input/0) (All (_ a b c) input/1) (All (_ a b c) input/2))) - (tuple? (type ((All (_ a b c) (Tuple a b c)) input/0 input/1 input/2)) + (tuple? (type_literal ((All (_ a b c) (Tuple a b c)) input/0 input/1 input/2)) (Tuple input/0 input/1 input/2)) (|> (do check.monad [[@var :var:] check.var _ (check.bind (All (_ a b c) (Tuple a b c)) @var)] - (/.tuple (type (:var: input/0 input/1 input/2)))) + (/.tuple (type_literal (:var: input/0 input/1 input/2)))) (check.result check.fresh_context) (try#each (|>> product.right (type#= (Tuple input/0 input/1 input/2)))) (try.else false)) @@ -122,19 +122,19 @@ (exception.otherwise (text.contains? (the exception.#label /.non_tuple)))) (|> (do check.monad [[@var :var:] check.var - _ (/.tuple (type (:var: input/0 input/1 input/2)))] + _ (/.tuple (type_literal (:var: input/0 input/1 input/2)))] (in false)) (check.result check.fresh_context) (exception.otherwise (text.contains? (the exception.#label /.non_tuple)))) (|> (do check.monad - [_ (/.tuple (type (input/0 input/1 input/2)))] + [_ (/.tuple (type_literal (input/0 input/1 input/2)))] (in false)) (check.result check.fresh_context) (exception.otherwise (text.contains? (the exception.#label /.non_tuple)))) (|> (do check.monad [[@var :var:] check.var _ (check.bind input/0 @var) - _ (/.tuple (type (:var: input/1 input/2)))] + _ (/.tuple (type_literal (:var: input/1 input/2)))] (in false)) (check.result check.fresh_context) (exception.otherwise (text.contains? (the exception.#label /.non_tuple)))))) 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 0e3b6130b..0454ecfb0 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 @@ -180,12 +180,12 @@ (//phase#each product.right) (//phase.result state) (try.else false)) - (and (sum? (type (Maybe tagT)) 0 #0 (` [])) - (sum? (type (Maybe tagT)) 0 #1 tagC)) - (and (sum? (type (All (_ a) (Maybe a))) 0 #0 (` [])) - (not (sum? (type (All (_ a) (Maybe a))) 0 #1 tagC))) - (and (sum? (type (Ex (_ a) (Maybe a))) 0 #0 (` [])) - (sum? (type (Ex (_ a) (Maybe a))) 0 #1 tagC))))) + (and (sum? (type_literal (Maybe tagT)) 0 #0 (` [])) + (sum? (type_literal (Maybe tagT)) 0 #1 tagC)) + (and (sum? (type_literal (All (_ a) (Maybe a))) 0 #0 (` [])) + (not (sum? (type_literal (All (_ a) (Maybe a))) 0 #1 tagC))) + (and (sum? (type_literal (Ex (_ a) (Maybe a))) 0 #0 (` [])) + (sum? (type_literal (Ex (_ a) (Maybe a))) 0 #1 tagC))))) (_.for [/.cannot_analyse_variant] (let [failure? (is (All (_ a) (-> (Exception a) (//analysis.Operation Any) Bit)) (function (_ exception analysis) @@ -200,7 +200,7 @@ (|> (do //phase.monad [[@var varT] (//type.check check.var)] (|> (/.sum ..analysis lefts right? archive.empty tagC) - (//type.expecting (type (varT tagT))))) + (//type.expecting (type_literal (varT tagT))))) (failure? /.invalid_variant_type)))) (_.coverage [/.cannot_infer_sum] (|> (do //phase.monad @@ -281,7 +281,7 @@ ))) ))) -(type: (Triple a) +(type (Triple a) [a a a]) (def test|product @@ -322,9 +322,9 @@ (try.else false))))] (and (product? productT expected) (product? {.#Named name productT} expected) - (product? (type (Ex (_ a) [a a])) (list term/0 term/0)) - (not (product? (type (All (_ a) [a a])) (list term/0 term/0))) - (product? (type (Triple type/0)) (list term/0 term/0 term/0)) + (product? (type_literal (Ex (_ a) [a a])) (list term/0 term/0)) + (not (product? (type_literal (All (_ a) [a a])) (list term/0 term/0))) + (product? (type_literal (Triple type/0)) (list term/0 term/0 term/0)) (|> (do //phase.monad [[@var varT] (//type.check check.var) _ (//type.check (check.check varT productT)) @@ -424,7 +424,7 @@ [[@var varT] (//type.check check.var)] (|> expected (/.product ..analysis archive.empty) - (//type.expecting (type (varT type/0))))) + (//type.expecting (type_literal (varT type/0))))) (failure? /.invalid_tuple_type)))))) ))) @@ -647,13 +647,13 @@ ..test|record (_.coverage [/.not_a_quantified_type] (and (|> (/.sum ..analysis lefts right? archive.empty term/0) - (//type.expecting (type (type/0 type/1))) + (//type.expecting (type_literal (type/0 type/1))) (//phase.result state) (..failure? /.not_a_quantified_type)) (|> types/*,terms/* (list#each product.right) (/.product ..analysis archive.empty) - (//type.expecting (type (type/0 type/1))) + (//type.expecting (type_literal (type/0 type/1))) (//phase.result state) (..failure? /.not_a_quantified_type)))) )))) 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 bae25b39f..16b3e1b60 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 @@ -128,11 +128,11 @@ (function? (Ex (_ a) (-> a a)) term/0) (function? (Rec self (-> input/0 self)) $function/0) - (function? (type ((All (_ a) (-> a a)) output/0)) term/0) - (not (function? (type ((All (_ a) (-> a a)) output/1)) term/0)) + (function? (type_literal ((All (_ a) (-> a a)) output/0)) term/0) + (not (function? (type_literal ((All (_ a) (-> a a)) output/1)) term/0)) - (function? (type ((Ex (_ a) (-> a a)) output/0)) term/0) - (not (function? (type ((Ex (_ a) (-> a a)) output/1)) term/0)) + (function? (type_literal ((Ex (_ a) (-> a a)) output/0)) term/0) + (not (function? (type_literal ((Ex (_ a) (-> a a)) output/1)) term/0)) (function?' (-> input/0 input/1 input/0) (` ([(~ $function/1) (~ $argument/1)] (~ $argument/0))) (function (_ [outer body]) 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 2fbfdc967..19d27a9b6 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 @@ -69,7 +69,7 @@ (_.property "Can 'try' risky IO computations." (check_success+ "lux try" (list (` ("lux io error" "YOLO"))) - (type (Either Text primT)))) + (type_literal (Either Text primT)))) ))) (def i64 @@ -151,7 +151,7 @@ (_.property "Can convert frac number to text." (check_success+ "lux f64 encode" (list subjectC) Text)) (_.property "Can convert text to frac number." - (check_success+ "lux f64 decode" (list encodedC) (type (Maybe Frac)))) + (check_success+ "lux f64 decode" (list encodedC) (type_literal (Maybe Frac)))) ))) (def text @@ -170,7 +170,7 @@ (_.property "Can concatenate one text to another." (check_success+ "lux text concat" (list subjectC paramC) Text)) (_.property "Can find the index of a piece of text inside a larger one that (may) contain it." - (check_success+ "lux text index" (list fromC paramC subjectC) (type (Maybe Nat)))) + (check_success+ "lux text index" (list fromC paramC subjectC) (type_literal (Maybe Nat)))) (_.property "Can query the size/length of a text." (check_success+ "lux text size" (list subjectC) Nat)) (_.property "Can obtain the character code of a text at a given index." 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 44f51ced1..e4631f5ad 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 @@ -72,13 +72,13 @@ _ false))) -(type: Circumstance +(type Circumstance (Record [#loop? Bit #expectation Synthesis #reality Analysis])) -(type: Scenario +(type Scenario (-> Bit (Random Circumstance))) (def (random_unit output?) 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 860312b0b..83fc7eee2 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 @@ -23,7 +23,7 @@ ["[0]" reference (.only Constant) ["[0]" variable (.only Register Variable)]]]]]]) -(type: (Scenario a) +(type (Scenario a) (-> Register Arity Register (Random [Register [a a]]))) (def (primitive offset arity next) 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 6db68f4c9..11b308c86 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 @@ -36,11 +36,11 @@ _ false))) -(type: Context +(type Context [#redundants Nat #necessary (Dictionary Nat Nat)]) -(type: (Scenario a) +(type (Scenario a) (-> Context (Random [a a]))) (with_template [ ] diff --git a/stdlib/source/test/lux/type.lux b/stdlib/source/test/lux/type.lux index d2c1ba0b1..436dc4e85 100644 --- a/stdlib/source/test/lux/type.lux +++ b/stdlib/source/test/lux/type.lux @@ -197,7 +197,7 @@ (_.coverage [/.by_example] (let [example (is (Maybe Nat) {.#None})] - (/#= (.type (List Nat)) + (/#= (.type_literal (List Nat)) (/.by_example [a] (is (Maybe a) example) diff --git a/stdlib/source/test/lux/type/check.lux b/stdlib/source/test/lux/type/check.lux index 194692533..3c45d4db4 100644 --- a/stdlib/source/test/lux/type/check.lux +++ b/stdlib/source/test/lux/type/check.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except type symbol) + [lux (.except symbol type) ["_" test (.only Test)] ["[0]" type (.use "[1]#[0]" equivalence)] [abstract @@ -390,10 +390,10 @@ right (random.only (|>> (= left) not) random)] (in [left right]))) -(type: Super +(.type Super (Ex (_ sub) [Text sub])) -(type: Sub +(.type Sub (Super Bit)) (def (handles_nominal_types! name/0 name/1 parameter/0 parameter/1) @@ -576,28 +576,28 @@ (def (handles_quantification! nominal) (-> Type Bit) (let [universals_satisfy_themselves! - (..succeeds? (/.check (.type (All (_ a) (Maybe a))) - (.type (All (_ a) (Maybe a))))) + (..succeeds? (/.check (.type_literal (All (_ a) (Maybe a))) + (.type_literal (All (_ a) (Maybe a))))) existentials_satisfy_themselves! - (..succeeds? (/.check (.type (Ex (_ a) (Maybe a))) - (.type (Ex (_ a) (Maybe a))))) + (..succeeds? (/.check (.type_literal (Ex (_ a) (Maybe a))) + (.type_literal (Ex (_ a) (Maybe a))))) universals_satisfy_particulars! - (..succeeds? (/.check (.type (Maybe nominal)) - (.type (All (_ a) (Maybe a))))) + (..succeeds? (/.check (.type_literal (Maybe nominal)) + (.type_literal (All (_ a) (Maybe a))))) particulars_do_not_satisfy_universals! - (..fails? (/.check (.type (All (_ a) (Maybe a))) - (.type (Maybe nominal)))) + (..fails? (/.check (.type_literal (All (_ a) (Maybe a))) + (.type_literal (Maybe nominal)))) particulars_satisfy_existentials! - (..succeeds? (/.check (.type (Ex (_ a) (Maybe a))) - (.type (Maybe nominal)))) + (..succeeds? (/.check (.type_literal (Ex (_ a) (Maybe a))) + (.type_literal (Maybe nominal)))) existentials_do_not_satisfy_particulars! - (..fails? (/.check (.type (Maybe nominal)) - (.type (Ex (_ a) (Maybe a)))))] + (..fails? (/.check (.type_literal (Maybe nominal)) + (.type_literal (Ex (_ a) (Maybe a)))))] (and universals_satisfy_themselves! existentials_satisfy_themselves! @@ -635,26 +635,26 @@ (def (handles_application! nominal/0 nominal/1) (-> Type Type Bit) (let [types_flow_through! - (and (..succeeds? (/.check (.type ((All (_ a) a) nominal/0)) + (and (..succeeds? (/.check (.type_literal ((All (_ a) a) nominal/0)) nominal/0)) (..succeeds? (/.check nominal/0 - (.type ((All (_ a) a) nominal/0)))) + (.type_literal ((All (_ a) a) nominal/0)))) - (..succeeds? (/.check (.type ((Ex (_ a) a) nominal/0)) + (..succeeds? (/.check (.type_literal ((Ex (_ a) a) nominal/0)) nominal/0)) (..succeeds? (/.check nominal/0 - (.type ((Ex (_ a) a) nominal/0))))) + (.type_literal ((Ex (_ a) a) nominal/0))))) multiple_parameters! - (and (..succeeds? (/.check (.type ((All (_ a b) [a b]) nominal/0 nominal/1)) - (.type [nominal/0 nominal/1]))) - (..succeeds? (/.check (.type [nominal/0 nominal/1]) - (.type ((All (_ a b) [a b]) nominal/0 nominal/1)))) + (and (..succeeds? (/.check (.type_literal ((All (_ a b) [a b]) nominal/0 nominal/1)) + (.type_literal [nominal/0 nominal/1]))) + (..succeeds? (/.check (.type_literal [nominal/0 nominal/1]) + (.type_literal ((All (_ a b) [a b]) nominal/0 nominal/1)))) - (..succeeds? (/.check (.type ((Ex (_ a b) [a b]) nominal/0 nominal/1)) - (.type [nominal/0 nominal/1]))) - (..succeeds? (/.check (.type [nominal/0 nominal/1]) - (.type ((Ex (_ a b) [a b]) nominal/0 nominal/1)))))] + (..succeeds? (/.check (.type_literal ((Ex (_ a b) [a b]) nominal/0 nominal/1)) + (.type_literal [nominal/0 nominal/1]))) + (..succeeds? (/.check (.type_literal [nominal/0 nominal/1]) + (.type_literal ((Ex (_ a b) [a b]) nominal/0 nominal/1)))))] (and types_flow_through! multiple_parameters!))) @@ -837,10 +837,10 @@ (Random Bit) (do random.monad [example ..clean_type] - (in (and (and (/.subsumes? (.type (List example)) (.type (All (_ a) (List a)))) - (not (/.subsumes? (.type (All (_ a) (List a))) (.type (List example))))) - (and (/.subsumes? (.type (Ex (_ a) (List a))) (.type (List example))) - (not (/.subsumes? (.type (List example)) (.type (Ex (_ a) (List a)))))))))) + (in (and (and (/.subsumes? (.type_literal (List example)) (.type_literal (All (_ a) (List a)))) + (not (/.subsumes? (.type_literal (All (_ a) (List a))) (.type_literal (List example))))) + (and (/.subsumes? (.type_literal (Ex (_ a) (List a))) (.type_literal (List example))) + (not (/.subsumes? (.type_literal (List example)) (.type_literal (Ex (_ a) (List a)))))))))) (def for_subsumption|named (Random Bit) diff --git a/stdlib/source/test/lux/type/variance.lux b/stdlib/source/test/lux/type/variance.lux index da2b5207c..911c68067 100644 --- a/stdlib/source/test/lux/type/variance.lux +++ b/stdlib/source/test/lux/type/variance.lux @@ -11,10 +11,10 @@ ["/[1]" // (.only) ["[1][0]" check]]]]) -(type: Super +(type Super (Ex (_ sub) [Text sub])) -(type: Sub +(type Sub (Super Bit)) (def .public test @@ -22,14 +22,14 @@ (<| (_.covering /._) (all _.and (_.coverage [/.Co] - (and (//check.subsumes? (type (/.Co Super)) (type (/.Co Sub))) - (not (//check.subsumes? (type (/.Co Sub)) (type (/.Co Super)))))) + (and (//check.subsumes? (type_literal (/.Co Super)) (type_literal (/.Co Sub))) + (not (//check.subsumes? (type_literal (/.Co Sub)) (type_literal (/.Co Super)))))) (_.coverage [/.Contra] - (and (//check.subsumes? (type (/.Contra Sub)) (type (/.Contra Super))) - (not (//check.subsumes? (type (/.Contra Super)) (type (/.Contra Sub)))))) + (and (//check.subsumes? (type_literal (/.Contra Sub)) (type_literal (/.Contra Super))) + (not (//check.subsumes? (type_literal (/.Contra Super)) (type_literal (/.Contra Sub)))))) (_.coverage [/.In] - (and (//check.subsumes? (type (/.In Super)) (type (/.In Super))) - (//check.subsumes? (type (/.In Sub)) (type (/.In Sub))) - (not (//check.subsumes? (type (/.In Sub)) (type (/.In Super)))) - (not (//check.subsumes? (type (/.In Super)) (type (/.In Sub)))))) + (and (//check.subsumes? (type_literal (/.In Super)) (type_literal (/.In Super))) + (//check.subsumes? (type_literal (/.In Sub)) (type_literal (/.In Sub))) + (not (//check.subsumes? (type_literal (/.In Sub)) (type_literal (/.In Super)))) + (not (//check.subsumes? (type_literal (/.In Super)) (type_literal (/.In Sub)))))) ))) diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux index f287e0652..5fd673e83 100644 --- a/stdlib/source/test/lux/world/file.lux +++ b/stdlib/source/test/lux/world/file.lux @@ -30,7 +30,7 @@ [\\specification ["$[0]" /]]) -(type: Disk +(type Disk (Dictionary /.Path (Either [Instant Binary] (List Text)))) (def (file? disk @) -- cgit v1.2.3