From e8b797704ad791a783da2cad89b194319213b15c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 30 Apr 2024 17:48:33 -0400 Subject: [PATCH] New type for `Lux` (part 8). --- stdlib/source/library/lux.lux | 132 +++++++++--------- .../lux/compiler/language/lux/analysis.lux | 28 ++-- .../compiler/language/lux/analysis/scope.lux | 96 +++++++------ .../language/lux/phase/analysis/complex.lux | 2 +- stdlib/source/library/lux/compiler/type.lux | 20 ++- stdlib/source/library/lux/debug.lux | 1 + .../source/library/lux/meta/binding/local.lux | 32 ++--- stdlib/source/library/lux/type/implicit.lux | 12 +- stdlib/source/test/lux.lux | 16 ++- stdlib/source/test/lux/meta/binding/local.lux | 38 +++-- 10 files changed, 200 insertions(+), 177 deletions(-) diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 9871c9084..971f19df0 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -438,22 +438,10 @@ (.def# #Alias (tag [{#Some [1 #0 ..global_tags]} Global]) .public) (.def# #Default (tag [{#Some [1 #1 ..global_tags]} Global]) .public) -... (every .public (Bindings k v) -... (Record -... [#counter Natural -... #mappings (Stack [k v])])) (.def# Bindings (.is# Type {#Named [..prelude "Bindings"] - {#Universal {#Empty} - {#Universal {#Empty} - {#Product - ... counter - Natural - ... mappings - {#Reification {#Product {#Parameter 3} - {#Parameter 1}} - Stack}}}}}) + (.type# "bindings")}) .public) (.def# bindings_slots @@ -487,41 +475,20 @@ (.def# #Local (tag [{#Some [0 #0 ..ref_tags]} Ref]) .public) (.def# #Captured (tag [{#Some [0 #1 ..ref_tags]} Ref]) .public) -... TODO: Get rid of both #scope_name & #inner_scopes -... (every .public Scope -... (Record -... [#scope_name (Stack Text) -... #inner_scopes Natural -... #locals (Bindings Text [Type Natural]) -... #captured (Bindings Text [Type Ref])])) (.def# Scope (.is# Type {#Named [..prelude "Scope"] - {#Product - ... name - {#Reification Text Stack} - {#Product - ... inner - Natural - {#Product - ... locals - {#Reification {#Product Type Natural} {#Reification Text Bindings}} - ... captured - {#Reification {#Product Type Ref} {#Reification Text Bindings}}}}}}) + (.type# "scope")}) .public) (.def# scope_slots (.is# {#Reification Name Stack} - {#Top [..prelude "#scope_name"] - {#Top [..prelude "#inner_scopes"] - {#Top [..prelude "#locals"] - {#Top [..prelude "#captured"] - {#Empty}}}}}) + {#Top [..prelude "#locals"] + {#Top [..prelude "#captured"] + {#Empty}}}) #0) -(.def# #scope_name (slot [{#Some [0 #0 ..scope_slots]} Scope]) .public) -(.def# #inner_scopes (slot [{#Some [1 #0 ..scope_slots]} Scope]) .public) -(.def# #locals (slot [{#Some [2 #0 ..scope_slots]} Scope]) .public) -(.def# #captured (slot [{#Some [2 #1 ..scope_slots]} Scope]) .public) +(.def# #locals (slot [{#Some [0 #0 ..scope_slots]} Scope]) .public) +(.def# #captured (slot [{#Some [0 #1 ..scope_slots]} Scope]) .public) ... (every .public (Either l r) ... (Variant @@ -1187,6 +1154,41 @@ depth)))))) body))) +(the' .private (list#mix mix complete partial) + ... (for_any (_ a b) (-> (-> b a a) a (List b) a)) + {#Universal {#Empty} + {#Universal {#Empty} + {#Function {#Function {#Parameter 1} + {#Function {#Parameter 3} + {#Parameter 3}}} + {#Function {#Parameter 3} + {#Function {#Reification {#Parameter 1} List} + {#Parameter 3}}}}}} + (.when# (.list_size# partial) + limit + ((.is# {#Universal {#Empty} + {#Universal {#Empty} + {#Function Natural + {#Function {#Function {#Parameter 1} + {#Function {#Parameter 3} + {#Parameter 3}}} + {#Function {#Parameter 3} + {#Function {#Reification {#Parameter 1} List} + {#Parameter 3}}}}}}} + (function' (list#mix item mix complete partial) + (.when# (.int_<# (.as# Integer limit) + (.as# Integer item)) + #1 + (list#mix (.i64_+# 1 item) + mix + (mix (.list_item# item partial) + complete) + partial) + + #0 + complete))) + 0 mix complete partial))) + (the' .private (initialized_quantification? lux) {#Function Lux Bit} @@ -1198,17 +1200,17 @@ (.when# verdict [#1] #1 _ (.when# scope - [..#scope_name _ ..#inner_scopes _ ..#captured _ + [..#captured _ ..#locals [..#counter _ ..#mappings locals]] - (stack#mix (function' (_ local verdict) - (.when# local - [local _] - (.when# verdict - [#1] #1 - _ (.text_=# ..quantification_level local)))) - #0 - locals)))) + (list#mix (function' (_ local verdict) + (.when# local + [local _] + (.when# verdict + [#1] #1 + _ (.text_=# ..quantification_level local)))) + #0 + locals)))) #0 scopes))) @@ -1799,6 +1801,12 @@ {#Some y} {#Some y}))) +(the' .private (list#one f xs) + (for_any (_ input output) + (-> (-> input ($ Maybe output)) ($ List input) + ($ Maybe output))) + (stack#one f (list#as_stack xs))) + (the' .private (in_env name state) (-> Text Lux ($ Maybe Type)) @@ -1807,17 +1815,15 @@ ..#expected expected ..#provenance provenance ..#eval _eval] state] (stack#one (.is# (-> Scope ($ Maybe Type)) (function' (_ env) - (let' [[..#scope_name _ - ..#inner_scopes _ - ..#locals [..#counter _ ..#mappings locals] + (let' [[..#locals [..#counter _ ..#mappings locals] ..#captured _] env] - (stack#one (.is# (-> (Tuple Text (Tuple Type Any)) ($ Maybe Type)) - (function' (_ it) - (let' [[bname [type _]] it] - (if (text#= name bname) - {#Some type} - {#None})))) - locals)))) + (list#one (.is# (-> (Tuple Text (Tuple Type Any)) ($ Maybe Type)) + (function' (_ it) + (let' [[bname [type _]] it] + (if (text#= name bname) + {#Some type} + {#None})))) + locals)))) scopes))) (the' .private (available? expected_module current_module exported?) @@ -3010,12 +3016,10 @@ ..#source source/pre ..#current_module current_module/pre ..#modules modules/pre - ..#scopes (stack#partial [#scope_name (stack) - #inner_scopes 0 - #locals [#counter 0 - #mappings (stack [..quantification_level [.Natural (.as# Natural -1)]])] + ..#scopes (stack#partial [#locals [#counter 0 + #mappings (list [..quantification_level [.Natural (.as# Natural -1)]])] #captured [#counter 0 - #mappings (stack)]] + #mappings (list)]] scopes/pre) ..#type_context type_context/pre ..#seed seed/pre diff --git a/stdlib/source/library/lux/compiler/language/lux/analysis.lux b/stdlib/source/library/lux/compiler/language/lux/analysis.lux index bf1265551..4d1135f36 100644 --- a/stdlib/source/library/lux/compiler/language/lux/analysis.lux +++ b/stdlib/source/library/lux/compiler/language/lux/analysis.lux @@ -462,14 +462,13 @@ .#source (its @type.#source it) .#provenance (its @type.#provenance it) .#current_module (its @type.#current_module it) - .#modules (list#each (function (_ [name it]) - [name [.#module_hash (its @type.#module_hash it) - .#module_aliases (list.as_stack (its @type.#module_aliases it)) - .#definitions (list.as_stack (its @type.#definitions it)) - .#imports (its @type.#imports it) - .#module_state (its @type.#module_state it)]]) - (its @type.#modules it)) - .#scopes (its @type.#scopes it) + .#modules (its @type.#modules it) + .#scopes (stack#each (function (_ it) + [.#scope_name (stack) + .#inner_scopes 0 + .#locals (revised .#mappings list.as_stack (its @type.#locals it)) + .#captured (revised .#mappings list.as_stack (its @type.#captured it))]) + (its @type.#scopes it)) .#type_context (its @type.#type_context it) .#expected (its @type.#expected it) .#seed (its @type.#seed it) @@ -485,14 +484,11 @@ @type.#source (its .#source it) @type.#provenance (its .#provenance it) @type.#current_module (its .#current_module it) - @type.#modules (list#each (function (_ [name it]) - [name [@type.#module_hash (its .#module_hash it) - @type.#module_aliases (list.of_stack (its .#module_aliases it)) - @type.#definitions (list.of_stack (its .#definitions it)) - @type.#imports (its .#imports it) - @type.#module_state (its .#module_state it)]]) - (its .#modules it)) - @type.#scopes (its .#scopes it) + @type.#modules (its .#modules it) + @type.#scopes (stack#each (function (_ it) + [@type.#locals (revised .#mappings list.of_stack (its .#locals it)) + @type.#captured (revised .#mappings list.of_stack (its .#captured it))]) + (its .#scopes it)) @type.#type_context (its .#type_context it) @type.#expected (its .#expected it) @type.#seed (its .#seed it) diff --git a/stdlib/source/library/lux/compiler/language/lux/analysis/scope.lux b/stdlib/source/library/lux/compiler/language/lux/analysis/scope.lux index e61061457..024a4b034 100644 --- a/stdlib/source/library/lux/compiler/language/lux/analysis/scope.lux +++ b/stdlib/source/library/lux/compiler/language/lux/analysis/scope.lux @@ -6,6 +6,8 @@ [lux (.except local with) [abstract [monad (.only do)]] + [function + [predicate (.only Predicate)]] [control ["[0]" maybe (.use "[1]#[0]" monad)]] [error @@ -15,9 +17,9 @@ ["[0]" text] ["[0]" product] [collection - ["[0]" list] - ["[0]" stack (.use "[1]#[0]" functor mix monoid) - ["[0]" property]]]] + ["[0]" list (.use "[1]#[0]" functor mix monoid) + ["[0]" property]] + ["[0]" stack (.use "[1]#[0]" functor mix monoid)]]] [compiler ["@[0]" type]]]] ["/" // (.only Environment Operation Phase) @@ -29,35 +31,39 @@ ["[0]" variable (.only Variable)]]]]]) (every Local - (Bindings Text [Type Register])) + (@type.Bindings [Type Register])) (every Foreign - (Bindings Text [Type Variable])) + (@type.Bindings [Type Variable])) (the (local? name scope) - (-> Text Scope Bit) + (-> Text + (Predicate @type.Scope)) (|> scope - (its [.#locals .#mappings]) + (its [@type.#locals @type.#mappings]) (property.contains? name))) (the (local name scope) - (-> Text Scope (Maybe [Type Variable])) + (-> Text @type.Scope + (Maybe [Type Variable])) (|> scope - (its [.#locals .#mappings]) + (its [@type.#locals @type.#mappings]) (property.value name) (maybe#each (function (_ [type value]) [type {variable.#Local value}])))) (the (captured? name scope) - (-> Text Scope Bit) + (-> Text + (Predicate @type.Scope)) (|> scope - (its [.#captured .#mappings]) + (its [@type.#captured @type.#mappings]) (property.contains? name))) (the (captured name scope) - (-> Text Scope (Maybe [Type Variable])) + (-> Text @type.Scope + (Maybe [Type Variable])) (loop (again [idx 0 - mappings (its [.#captured .#mappings] scope)]) + mappings (list.as_stack (its [@type.#captured @type.#mappings] scope))]) (when mappings {.#Top [_name [_source_type _source_ref]] mappings'} (if (text.= name _name) @@ -68,12 +74,14 @@ {.#None}))) (the (reference? name scope) - (-> Text Scope Bit) + (-> Text + (Predicate @type.Scope)) (or (local? name scope) (captured? name scope))) (the (reference name scope) - (-> Text Scope (Maybe [Type Variable])) + (-> Text @type.Scope + (Maybe [Type Variable])) (when (..local name scope) {.#Some type} {.#Some type} @@ -82,7 +90,8 @@ (..captured name scope))) (the .public (variable name) - (-> Text (Operation (Maybe [Type Variable]))) + (-> Text + (Operation (Maybe [Type Variable]))) (function (_ state) (let [[inner outer] (|> state (its @type.#scopes) @@ -94,13 +103,13 @@ {.#Top maximum_outer _} (let [[ref_type init_ref] (maybe.else (undefined) (..reference name maximum_outer)) - [ref inner'] (stack#mix (is (-> Scope [Variable (Stack Scope)] [Variable (Stack Scope)]) + [ref inner'] (stack#mix (is (-> @type.Scope [Variable (Stack @type.Scope)] [Variable (Stack @type.Scope)]) (function (_ scope ref+inner) - [{variable.#Foreign (its [.#captured .#counter] scope)} - {.#Top (revised .#captured + [{variable.#Foreign (its [@type.#captured @type.#counter] scope)} + {.#Top (revised @type.#captured (is (-> Foreign Foreign) - (|>> (revised .#counter ++) - (revised .#mappings (property.has name [ref_type (product.left ref+inner)])))) + (|>> (revised @type.#counter ++) + (revised @type.#mappings (property.has name [ref_type (product.left ref+inner)])))) scope) (product.right ref+inner)}])) [init_ref {.#Empty}] @@ -120,19 +129,19 @@ (function (_ state) (when (its @type.#scopes state) {.#Top head tail} - (let [old_mappings (its [.#locals .#mappings] head) - new_var_id (its [.#locals .#counter] head) - new_head (revised .#locals + (let [old_mappings (its [@type.#locals @type.#mappings] head) + new_var_id (its [@type.#locals @type.#counter] head) + new_head (revised @type.#locals (is (Change Local) - (|>> (revised .#counter ++) - (revised .#mappings (property.has name [type new_var_id])))) + (|>> (revised @type.#counter ++) + (revised @type.#mappings (property.has name [type new_var_id])))) head)] (when (phase.value' (has @type.#scopes {.#Top new_head tail} state) action) {try.#Success [state' output]} (when (its @type.#scopes state') {.#Top head' tail'} - (let [scopes' {.#Top (has .#locals (its .#locals head) head') + (let [scopes' {.#Top (has @type.#locals (its @type.#locals head) head') tail'}] {try.#Success [(has @type.#scopes scopes' state') output]}) @@ -147,17 +156,16 @@ (exception.except ..no_scope [])))) (the empty - Scope - (let [bindings (is Bindings - [.#counter 0 - .#mappings (stack)])] - [.#scope_name (stack) - .#inner_scopes 0 - .#locals bindings - .#captured bindings])) + @type.Scope + (let [bindings (is @type.Bindings + [@type.#counter 0 + @type.#mappings (list)])] + [@type.#locals bindings + @type.#captured bindings])) (the .public (reset action) - (for_any (_ a) (-> (Operation a) (Operation a))) + (for_any (_ it) + (Change (Operation it))) (function (_ state) (when (action (has @type.#scopes (stack ..empty) state)) {try.#Success [state' output]} @@ -168,9 +176,9 @@ failure))) (the .public (with action) - (for_any (_ a) - (-> (Operation a) - (Operation [Scope a]))) + (for_any (_ it) + (-> (Operation it) + (Operation [@type.Scope it]))) (function (_ state) (when (action (revised @type.#scopes (|>> {.#Top ..empty}) state)) {try.#Success [state' output]} @@ -190,13 +198,13 @@ (function (_ state) (when (its @type.#scopes state) {.#Top maximum _} - {try.#Success [state (its [.#locals .#counter] maximum)]} + {try.#Success [state (its [@type.#locals @type.#counter] maximum)]} {.#Empty} (exception.except ..no_scope [])))) (the .public environment - (-> Scope (Environment Variable)) - (|>> (its [.#captured .#mappings]) - (stack#each (function (_ [_ [_ ref]]) ref)) - list.of_stack)) + (-> @type.Scope + (Environment Variable)) + (|>> (its [@type.#captured @type.#mappings]) + (list#each (function (_ [_ [_ ref]]) ref)))) diff --git a/stdlib/source/library/lux/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/library/lux/compiler/language/lux/phase/analysis/complex.lux index 6f0e703d7..117859d30 100644 --- a/stdlib/source/library/lux/compiler/language/lux/phase/analysis/complex.lux +++ b/stdlib/source/library/lux/compiler/language/lux/phase/analysis/complex.lux @@ -362,7 +362,7 @@ (-> Text (Meta Bit)) (by meta.monad each - (stack.any? (stack.any? (|>> product.left (text.= name)))) + (stack.any? (list.any? (|>> product.left (text.= name)))) local.all)) (the (slot it) diff --git a/stdlib/source/library/lux/compiler/type.lux b/stdlib/source/library/lux/compiler/type.lux index b0f7f1e3d..ddc62d493 100644 --- a/stdlib/source/library/lux/compiler/type.lux +++ b/stdlib/source/library/lux/compiler/type.lux @@ -24,6 +24,10 @@ #target #version #mode #configuration Module #module_hash #module_aliases #definitions #imports #module_state + Bindings + #counter #mappings + Scope + #locals #captured Type_Context #ex_counter #var_counter #var_bindings Lux @@ -232,6 +236,16 @@ #imports (..List' ..Text) #module_state .Module_State])) +(every .public (Bindings it) + (Record + [#counter ..Natural + #mappings (..Property_List it)])) + +(every .public Scope + (Record + [#locals (..Bindings [..Type ..Natural]) + #captured (..Bindings [..Type .Ref])])) + (every .public Type_Context (Record [#ex_counter ..Natural @@ -245,7 +259,7 @@ #provenance ..Provenance #current_module (Maybe ..Name_Of_Module) #modules (..Property_List ..Module) - #scopes (.Stack .Scope) + #scopes (.Stack ..Scope) #type_context ..Type_Context #expected (Maybe ..Type) #seed ..Natural @@ -352,8 +366,10 @@ ["code" ..Code] ["type" ..Type] ["info" ..Info] - ["type_context" ..Type_Context] ["module" ..Module] + ["bindings" ..Bindings] + ["scope" ..Scope] + ["type_context" ..Type_Context] ["lux" ..Lux] ["eval" ..Eval']) (is (property.List ..Type)) diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index b098610cf..c78cd28dc 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -627,6 +627,7 @@ [provenance meta.provenance locals local.all .let [environment (|> locals + (stack#each list.as_stack) stack#conjoint ... The list is reversed to make sure that, when building the dictionary, ... later bindings overshadow earlier ones if they have the same name. diff --git a/stdlib/source/library/lux/meta/binding/local.lux b/stdlib/source/library/lux/meta/binding/local.lux index 34fae76b1..412929114 100644 --- a/stdlib/source/library/lux/meta/binding/local.lux +++ b/stdlib/source/library/lux/meta/binding/local.lux @@ -8,18 +8,19 @@ [monad (.only do)]] [control ["[0]" maybe]] - [error + [error (.only error) ["[0]" try]] [data ["[0]" product] ["[0]" text] [collection - ["[0]" stack (.use "[1]#[0]" functor)]]] + ["[0]" stack (.use "[1]#[0]" functor)] + ["[0]" list (.use "[1]#[0]" functor) + ["[0]" property]]]] [math [number ["n" natural]]]]] - ["[0]" /// (.only) - ["[0]" provenance]]) + ["[0]" ///]) (the with_template' (.in_module# .prelude .with_template)) (the type_variable (.in_module# .prelude .type_variable)) @@ -67,15 +68,15 @@ (text.= name)))] (when (do maybe.monad [scope (stack.example (function (_ env) - (.or (stack.any? test (is (Stack [Text [Type Any]]) - (its [.#locals .#mappings] env))) - (stack.any? test (is (Stack [Text [Type Any]]) - (its [.#captured .#mappings] env))))) + (.or (list.any? test (is (property.List [Type Any]) + (its [.#locals .#mappings] env))) + (list.any? test (is (property.List [Type Any]) + (its [.#captured .#mappings] env))))) (its .#scopes lux)) - [_ [type _]] (on_either (stack.example test) - (is (Stack [Text [Type Any]]) + [_ [type _]] (on_either (list.example test) + (is (property.List [Type Any]) (its [.#locals .#mappings] scope)) - (is (Stack [Text [Type Any]]) + (is (property.List [Type Any]) (its [.#captured .#mappings] scope)))] (in type)) {.#Some type} @@ -86,18 +87,17 @@ (the .public no_environment Error - (provenance.with (provenance.here) - "No local environment.")) + (error "No local environment.")) (the .public all - (Meta (Stack (Stack [Text Type]))) + (Meta (Stack (property.List Type))) (function (_ lux) (when (stack.inits (its .#scopes lux)) {try.#Success scopes} {try.#Success [lux (stack#each (|>> (its [.#locals .#mappings]) - (stack#each (function (_ [name [type _]]) - [name type]))) + (list#each (function (_ [name [type _]]) + [name type]))) scopes)]} {try.#Failure error} diff --git a/stdlib/source/library/lux/type/implicit.lux b/stdlib/source/library/lux/type/implicit.lux index 518c5adae..d7710048c 100644 --- a/stdlib/source/library/lux/type/implicit.lux +++ b/stdlib/source/library/lux/type/implicit.lux @@ -179,11 +179,13 @@ (Meta (Stack [Name Type]))) (do meta.monad [local_batches local.all - .let [total_locals (stack#mix (function (_ [name type] table) - (try.else table (dictionary.has' name type table))) - (is (Dictionary Text Type) - (dictionary.empty text.hash)) - (stack#conjoint local_batches))]] + .let [total_locals (|> local_batches + (stack#each list.as_stack) + stack#conjoint + (stack#mix (function (_ [name type] table) + (try.else table (dictionary.has' name type table))) + (is (Dictionary Text Type) + (dictionary.empty text.hash))))]] (in (|> total_locals dictionary.entries (list.all (function (_ [name type]) diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index aed6f4680..504589887 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -7,6 +7,8 @@ [program (.only program)] [abstract [monad (.only do)]] + [function + [predicate (.only Predicate)]] [concurrency ["[0]" atom]] [control @@ -18,9 +20,9 @@ ["[0]" text] [collection ["[0]" set (.only Set)] - ["[0]" list (.use "[1]#[0]" functor)] - ["[0]" stack (.use "[1]#[0]" functor) - ["[0]" property]]]] + ["[0]" list (.use "[1]#[0]" functor) + ["[0]" property]] + ["[0]" stack (.use "[1]#[0]" functor)]]] [math ["[0]" random (.use "[1]#[0]" functor)] [number @@ -1203,7 +1205,6 @@ let/3)) actual_locals/2 (|> locals/2 (its .#mappings) - list.of_stack (list#each product.left) (set.of_list text.hash)) @@ -1214,14 +1215,15 @@ captured/2 (its .#captured scope/2) - local? (is (-> Ref Bit) + local? (is (Predicate Ref) (function (_ ref) (when ref {.#Local _} true {.#Captured _} false))) - captured? (is (-> Ref Bit) + captured? (is (Predicate Ref) (|>> local? not)) - binding? (is (-> (-> Ref Bit) Text Bit) + binding? (is (-> (Predicate Ref) + (Predicate Text)) (function (_ is? name) (|> captured/2 (its .#mappings) diff --git a/stdlib/source/test/lux/meta/binding/local.lux b/stdlib/source/test/lux/meta/binding/local.lux index da1587ddf..1c9a505fb 100644 --- a/stdlib/source/test/lux/meta/binding/local.lux +++ b/stdlib/source/test/lux/meta/binding/local.lux @@ -53,25 +53,19 @@ (list [name_4 [false {.#Definition [type_4 []]}]])) - scopes (stack [.#scope_name (stack) - .#inner_scopes 0 - .#locals [.#counter 1 - .#mappings (stack [name_3 [type_3 3]])] + scopes (stack [.#locals [.#counter 1 + .#mappings (list [name_3 [type_3 3]])] .#captured [.#counter 0 - .#mappings (stack)]] - [.#scope_name (stack) - .#inner_scopes 0 - .#locals [.#counter 2 - .#mappings (stack [name_1 [type_1 1]] - [name_2 [type_2 2]])] + .#mappings (list)]] + [.#locals [.#counter 2 + .#mappings (list [name_1 [type_1 1]] + [name_2 [type_2 2]])] .#captured [.#counter 0 - .#mappings (stack)]] - [.#scope_name (stack) - .#inner_scopes 0 - .#locals [.#counter 1 - .#mappings (stack [name_0 [type_0 0]])] + .#mappings (list)]] + [.#locals [.#counter 1 + .#mappings (list [name_0 [type_0 0]])] .#captured [.#counter 0 - .#mappings (stack)]])] + .#mappings (list)]])] .let [expected_lux (is Lux [.#info [.#target "" @@ -96,20 +90,20 @@ .#eval (as_expected [])])]] (all _.and (_.coverage [.Scope - .#scope_name .#inner_scopes .#locals .#captured + .#locals .#captured /.all] - (let [equivalence (is (Equivalence (Stack (Stack [Text Type]))) + (let [equivalence (is (Equivalence (Stack (List [Text Type]))) (stack.equivalence - (stack.equivalence + (list.equivalence (product.equivalence text.equivalence type.equivalence))))] (|> /.all (///.value expected_lux) - (try#each (by equivalence = (stack (stack [name_3 type_3]) - (stack [name_1 type_1] - [name_2 type_2])))) + (try#each (by equivalence = (stack (list [name_3 type_3]) + (list [name_1 type_1] + [name_2 type_2])))) (try.else false)))) (_.coverage [/.type] (and (|> (/.type name_0)