From 891b1cfc82322f8017f0a4f6b707d6fe52024545 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 3 Sep 2021 21:51:30 -0400 Subject: Unified tuple and record syntax. --- stdlib/commands.md | 4 + stdlib/project.lux | 28 +- stdlib/source/documentation/lux.lux | 5 +- stdlib/source/documentation/lux/type/poly.lux | 4 +- stdlib/source/library/lux.lux | 298 +++++++++++---------- .../source/library/lux/abstract/monad/indexed.lux | 8 +- .../source/library/lux/control/concatenative.lux | 4 +- .../library/lux/control/concurrency/actor.lux | 28 +- .../library/lux/control/concurrency/atom.lux | 12 +- .../library/lux/control/concurrency/semaphore.lux | 16 +- .../source/library/lux/control/concurrency/stm.lux | 12 +- .../library/lux/control/concurrency/thread.lux | 8 +- stdlib/source/library/lux/control/exception.lux | 8 +- .../source/library/lux/control/function/mutual.lux | 8 +- stdlib/source/library/lux/control/parser/text.lux | 16 +- .../source/library/lux/control/security/policy.lux | 8 +- stdlib/source/library/lux/control/writer.lux | 4 +- .../library/lux/data/collection/dictionary.lux | 8 +- .../lux/data/collection/dictionary/ordered.lux | 16 +- .../source/library/lux/data/collection/queue.lux | 16 +- stdlib/source/library/lux/data/collection/row.lux | 12 +- stdlib/source/library/lux/data/collection/tree.lux | 20 +- .../library/lux/data/collection/tree/finger.lux | 12 +- .../library/lux/data/collection/tree/zipper.lux | 54 ++-- stdlib/source/library/lux/data/color.lux | 64 ++--- stdlib/source/library/lux/data/color/named.lux | 4 +- stdlib/source/library/lux/data/format/css.lux | 4 +- stdlib/source/library/lux/data/format/css/font.lux | 8 +- .../library/lux/data/format/css/selector.lux | 4 +- .../source/library/lux/data/format/css/value.lux | 4 +- stdlib/source/library/lux/data/format/html.lux | 16 +- stdlib/source/library/lux/data/format/tar.lux | 36 +-- stdlib/source/library/lux/data/store.lux | 8 +- stdlib/source/library/lux/data/trace.lux | 10 +- stdlib/source/library/lux/documentation.lux | 22 +- stdlib/source/library/lux/extension.lux | 4 +- stdlib/source/library/lux/ffi.js.lux | 4 +- stdlib/source/library/lux/ffi.jvm.lux | 77 +++--- stdlib/source/library/lux/ffi.lua.lux | 4 +- stdlib/source/library/lux/ffi.old.lux | 94 ++++--- stdlib/source/library/lux/ffi.php.lux | 4 +- stdlib/source/library/lux/ffi.py.lux | 4 +- stdlib/source/library/lux/ffi.rb.lux | 4 +- stdlib/source/library/lux/ffi.scm.lux | 4 +- stdlib/source/library/lux/locale/language.lux | 8 +- stdlib/source/library/lux/locale/territory.lux | 8 +- stdlib/source/library/lux/macro/syntax/check.lux | 4 +- .../library/lux/macro/syntax/declaration.lux | 4 +- .../source/library/lux/macro/syntax/definition.lux | 8 +- stdlib/source/library/lux/macro/syntax/input.lux | 4 +- stdlib/source/library/lux/macro/template.lux | 8 +- stdlib/source/library/lux/math/modular.lux | 12 +- stdlib/source/library/lux/math/number/complex.lux | 84 +++--- stdlib/source/library/lux/math/number/frac.lux | 2 +- stdlib/source/library/lux/math/number/ratio.lux | 20 +- stdlib/source/library/lux/meta.lux | 51 ++-- stdlib/source/library/lux/meta/location.lux | 4 +- stdlib/source/library/lux/target/common_lisp.lux | 8 +- stdlib/source/library/lux/target/jvm/attribute.lux | 12 +- .../library/lux/target/jvm/attribute/code.lux | 4 +- .../lux/target/jvm/attribute/code/exception.lux | 4 +- stdlib/source/library/lux/target/jvm/bytecode.lux | 20 +- .../lux/target/jvm/bytecode/environment.lux | 8 +- .../lux/target/jvm/bytecode/environment/limit.lux | 8 +- stdlib/source/library/lux/target/jvm/class.lux | 8 +- stdlib/source/library/lux/target/jvm/constant.lux | 8 +- .../library/lux/target/jvm/constant/pool.lux | 8 +- stdlib/source/library/lux/target/jvm/field.lux | 8 +- stdlib/source/library/lux/target/jvm/method.lux | 12 +- stdlib/source/library/lux/target/jvm/type.lux | 4 +- stdlib/source/library/lux/target/php.lux | 8 +- stdlib/source/library/lux/target/python.lux | 4 +- stdlib/source/library/lux/target/ruby.lux | 4 +- stdlib/source/library/lux/target/scheme.lux | 4 +- stdlib/source/library/lux/test.lux | 12 +- stdlib/source/library/lux/time.lux | 8 +- stdlib/source/library/lux/time/date.lux | 8 +- stdlib/source/library/lux/tool/compiler.lux | 8 +- .../library/lux/tool/compiler/default/init.lux | 24 +- .../library/lux/tool/compiler/default/platform.lux | 16 +- .../library/lux/tool/compiler/language/lux.lux | 4 +- .../lux/tool/compiler/language/lux/analysis.lux | 28 +- .../lux/tool/compiler/language/lux/directive.lux | 24 +- .../lux/tool/compiler/language/lux/generation.lux | 8 +- .../tool/compiler/language/lux/phase/analysis.lux | 27 +- .../compiler/language/lux/phase/analysis/case.lux | 126 +++++---- .../language/lux/phase/analysis/module.lux | 4 +- .../compiler/language/lux/phase/analysis/scope.lux | 8 +- .../language/lux/phase/analysis/structure.lux | 207 ++++++++------ .../tool/compiler/language/lux/phase/extension.lux | 4 +- .../language/lux/phase/extension/analysis/jvm.lux | 16 +- .../language/lux/phase/extension/directive/jvm.lux | 4 +- .../language/lux/phase/extension/directive/lux.lux | 9 +- .../language/lux/phase/generation/php/runtime.lux | 4 +- .../compiler/language/lux/phase/synthesis/case.lux | 8 +- .../language/lux/phase/synthesis/function.lux | 12 +- .../compiler/language/lux/phase/synthesis/loop.lux | 4 +- .../lux/tool/compiler/language/lux/synthesis.lux | 20 +- .../library/lux/tool/compiler/meta/archive.lux | 12 +- .../lux/tool/compiler/meta/archive/artifact.lux | 20 +- .../lux/tool/compiler/meta/archive/descriptor.lux | 4 +- .../lux/tool/compiler/meta/archive/document.lux | 8 +- .../lux/tool/compiler/meta/archive/signature.lux | 4 +- .../lux/tool/compiler/meta/cache/dependency.lux | 4 +- .../library/lux/tool/compiler/meta/io/context.lux | 4 +- .../lux/tool/compiler/meta/packager/scheme.lux | 8 +- stdlib/source/library/lux/tool/interpreter.lux | 8 +- stdlib/source/library/lux/type.lux | 4 +- stdlib/source/library/lux/type/abstract.lux | 4 +- stdlib/source/library/lux/type/check.lux | 4 +- stdlib/source/library/lux/type/implicit.lux | 8 +- stdlib/source/library/lux/type/quotient.lux | 8 +- stdlib/source/library/lux/type/refinement.lux | 12 +- stdlib/source/library/lux/world/db/jdbc.lux | 8 +- stdlib/source/library/lux/world/file.lux | 8 +- stdlib/source/library/lux/world/file/watch.lux | 16 +- stdlib/source/library/lux/world/input/keyboard.lux | 8 +- stdlib/source/library/lux/world/net.lux | 4 +- stdlib/source/library/lux/world/net/http.lux | 20 +- .../source/library/lux/world/net/http/client.lux | 4 +- stdlib/source/library/lux/world/net/http/mime.lux | 4 +- .../source/library/lux/world/net/http/response.lux | 8 +- .../library/lux/world/output/video/resolution.lux | 8 +- .../library/lux/world/service/authentication.lux | 9 +- stdlib/source/library/lux/world/service/crud.lux | 14 +- .../source/library/lux/world/service/inventory.lux | 14 +- .../source/library/lux/world/service/journal.lux | 18 +- stdlib/source/library/lux/world/service/mail.lux | 5 +- stdlib/source/program/aedifex/artifact.lux | 4 +- .../program/aedifex/artifact/snapshot/stamp.lux | 4 +- .../program/aedifex/artifact/snapshot/version.lux | 4 +- .../aedifex/artifact/snapshot/version/value.lux | 4 +- .../source/program/aedifex/artifact/time/time.lux | 4 +- .../source/program/aedifex/artifact/versioning.lux | 8 +- stdlib/source/program/aedifex/command/deploy.lux | 4 +- stdlib/source/program/aedifex/command/install.lux | 4 +- stdlib/source/program/aedifex/dependency.lux | 4 +- .../program/aedifex/dependency/deployment.lux | 8 +- .../program/aedifex/dependency/resolution.lux | 8 +- stdlib/source/program/aedifex/format.lux | 33 +-- .../source/program/aedifex/metadata/artifact.lux | 12 +- .../source/program/aedifex/metadata/snapshot.lux | 22 +- stdlib/source/program/aedifex/package.lux | 8 +- stdlib/source/program/aedifex/parser.lux | 30 +-- stdlib/source/program/aedifex/pom.lux | 6 +- stdlib/source/program/aedifex/profile.lux | 24 +- .../source/program/aedifex/repository/identity.lux | 4 +- stdlib/source/program/aedifex/runtime.lux | 8 +- stdlib/source/program/compositor/export.lux | 8 +- stdlib/source/program/compositor/static.lux | 4 +- stdlib/source/program/scriptum.lux | 17 +- .../specification/compositor/generation/case.lux | 4 +- .../specification/compositor/generation/common.lux | 8 +- .../compositor/generation/function.lux | 28 +- .../compositor/generation/structure.lux | 4 +- .../aedifex/artifact/snapshot/version/value.lux | 4 +- stdlib/source/test/aedifex/cache.lux | 4 +- stdlib/source/test/aedifex/command/build.lux | 12 +- stdlib/source/test/aedifex/command/deps.lux | 8 +- .../source/test/aedifex/dependency/deployment.lux | 4 +- .../source/test/aedifex/dependency/resolution.lux | 32 +-- stdlib/source/test/aedifex/metadata/artifact.lux | 8 +- stdlib/source/test/aedifex/metadata/snapshot.lux | 4 +- stdlib/source/test/aedifex/repository/remote.lux | 20 +- stdlib/source/test/lux.lux | 44 +-- .../source/test/lux/control/concurrency/actor.lux | 4 +- stdlib/source/test/lux/data/collection/tree.lux | 4 +- stdlib/source/test/lux/data/format/tar.lux | 40 +-- stdlib/source/test/lux/locale/language.lux | 8 +- stdlib/source/test/lux/locale/territory.lux | 8 +- stdlib/source/test/lux/macro.lux | 18 +- stdlib/source/test/lux/macro/syntax/check.lux | 4 +- stdlib/source/test/lux/macro/syntax/definition.lux | 10 +- stdlib/source/test/lux/meta.lux | 160 +++++------ stdlib/source/test/lux/target/jvm.lux | 44 +-- .../compiler/language/lux/phase/synthesis/case.lux | 28 +- .../language/lux/phase/synthesis/function.lux | 93 +++---- .../compiler/language/lux/phase/synthesis/loop.lux | 28 +- .../language/lux/phase/synthesis/variable.lux | 8 +- stdlib/source/test/lux/type/poly/equivalence.lux | 4 +- stdlib/source/test/lux/type/poly/json.lux | 4 +- stdlib/source/test/lux/world/net/http/client.lux | 4 +- 182 files changed, 1577 insertions(+), 1498 deletions(-) (limited to 'stdlib') diff --git a/stdlib/commands.md b/stdlib/commands.md index dc74aa294..893e0d271 100644 --- a/stdlib/commands.md +++ b/stdlib/commands.md @@ -71,6 +71,10 @@ cd ~/lux/stdlib/ \ ## Build ``` +cd ~/lux/stdlib/ \ +&& lein clean \ +&& lein with-profile aedifex lux auto build + cd ~/lux/stdlib/ \ && lux clean \ && lux with jvm with aedifex auto build diff --git a/stdlib/project.lux b/stdlib/project.lux index 5e1b4d02a..5c6601eb0 100644 --- a/stdlib/project.lux +++ b/stdlib/project.lux @@ -1,36 +1,36 @@ -{"" - {#identity ["com.github.luxlang" "stdlib" "0.6.0-SNAPSHOT"] +["" + [#identity ["com.github.luxlang" "stdlib" "0.6.0-SNAPSHOT"] #deploy_repositories {"snapshots" "https://oss.sonatype.org/content/repositories/snapshots/" "releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"} #repositories ["https://oss.sonatype.org/content/repositories/snapshots/" - "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]} + "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]] "jvm" - {#compiler ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT" "jar"]} + [#compiler ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT" "jar"]] "js" - {#compiler ["com.github.luxlang" "lux-js" "0.6.0-SNAPSHOT" "js"]} + [#compiler ["com.github.luxlang" "lux-js" "0.6.0-SNAPSHOT" "js"]] "python" - {#compiler ["com.github.luxlang" "lux-python" "0.6.0-SNAPSHOT" "jar"]} + [#compiler ["com.github.luxlang" "lux-python" "0.6.0-SNAPSHOT" "jar"]] "lua" - {#compiler ["com.github.luxlang" "lux-lua" "0.6.0-SNAPSHOT" "jar"]} + [#compiler ["com.github.luxlang" "lux-lua" "0.6.0-SNAPSHOT" "jar"]] "ruby" - {#compiler ["com.github.luxlang" "lux-ruby" "0.6.0-SNAPSHOT" "jar"]} + [#compiler ["com.github.luxlang" "lux-ruby" "0.6.0-SNAPSHOT" "jar"]] "bibliotheca" - {#description "Standard library for the Lux programming language." - #test "test/lux"} + [#description "Standard library for the Lux programming language." + #test "test/lux"] "documentation" - {#program "documentation/lux" - #test "documentation/lux"} + [#program "documentation/lux" + #test "documentation/lux"] "aedifex" - {#description "A build system/tool made exclusively for Lux." + [#description "A build system/tool made exclusively for Lux." #program "program/aedifex" - #test "test/aedifex"}} + #test "test/aedifex"]] diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index b7f1025ad..85b93f5f7 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -497,8 +497,8 @@ \n "WARNING: Only use it within the type: macro.") [(type: Refer (Record - {#refer_defs Referrals - #refer_open (List Openings)}))]) + [#refer_defs Referrals + #refer_open (List Openings)]))]) (documentation: /.type: "The type-definition macro." @@ -717,7 +717,6 @@ [identifier ["yolo" "lol"] "yolo.lol"] [form (list (bit #1)) "(#1)"] [tuple (list (bit #1)) "[#1]"] - [record (list [(bit #1) (int +123)]) "{#1 +123}"] )] ($_ and diff --git a/stdlib/source/documentation/lux/type/poly.lux b/stdlib/source/documentation/lux/type/poly.lux index bbdbfd0d0..88558bd17 100644 --- a/stdlib/source/documentation/lux/type/poly.lux +++ b/stdlib/source/documentation/lux/type/poly.lux @@ -33,7 +33,7 @@ (type: Record (.Record - {#bit Bit + [#bit Bit #frac Frac #text Text #maybe (Maybe Frac) @@ -43,7 +43,7 @@ #tuple [Bit Text Frac] #recursive Recursive #date Date - #grams (Qty Gram)})) + #grams (Qty Gram)])) (derived: equivalence ($equivalence.equivalence diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index d717434be..e9b07fe8f 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -196,9 +196,10 @@ #1) ... (type: .public Location -... {#module Text -... #line Nat -... #column Nat}) +... (Record +... [#module Text +... #line Nat +... #column Nat])) ("lux def type tagged" Location (#Named ["library/lux" "Location"] (#Product Text (#Product Nat Nat))) @@ -208,8 +209,9 @@ #1) ... (type: .public (Ann m v) -... {#meta m -... #datum v}) +... (Record +... [#meta m +... #datum v])) ("lux def type tagged" Ann (#Named ["library/lux" "Ann"] (#UnivQ #End @@ -442,8 +444,9 @@ .public) ... (type: .public (Bindings k v) -... {#counter Nat -... #mappings (List [k v])}) +... (Record +... [#counter Nat +... #mappings (List [k v])])) ("lux def type tagged" Bindings (#Named ["library/lux" "Bindings"] (#UnivQ #End @@ -472,10 +475,11 @@ .public) ... (type: .public Scope -... {#name (List Text) -... #inner Nat -... #locals (Bindings Text [Type Nat]) -... #captured (Bindings Text [Type Ref])}) +... (Record +... [#name (List Text) +... #inner Nat +... #locals (Bindings Text [Type Nat]) +... #captured (Bindings Text [Type Ref])])) ("lux def type tagged" Scope (#Named ["library/lux" "Scope"] (#Product ... name @@ -540,12 +544,12 @@ ... (type: .public Module ... (Record -... {#module_hash Nat +... [#module_hash Nat ... #module_aliases (List [Text Text]) ... #definitions (List [Text Global]) ... #imports (List Text) ... #module_annotations (Maybe Code) -... #module_state Module_State})) +... #module_state Module_State])) ("lux def type tagged" Module (#Named ["library/lux" "Module"] (#Product @@ -571,9 +575,10 @@ .public) ... (type: .public Type_Context -... {#ex_counter Nat -... #var_counter Nat -... #var_bindings (List [Nat (Maybe Type)])}) +... (Record +... [#ex_counter Nat +... #var_counter Nat +... #var_bindings (List [Nat (Maybe Type)])])) ("lux def type tagged" Type_Context (#Named ["library/lux" "Type_Context"] (#Product ... ex_counter @@ -604,9 +609,10 @@ .public) ... (type: .public Info -... {#target Text -... #version Text -... #mode Mode}) +... (Record +... [#target Text +... #version Text +... #mode Mode])) ("lux def type tagged" Info (#Named ["library/lux" "Info"] (#Product @@ -622,19 +628,20 @@ .public) ... (type: .public Lux -... {#info Info -... #source Source -... #location Location -... #current_module (Maybe Text) -... #modules (List [Text Module]) -... #scopes (List Scope) -... #type_context Type_Context -... #expected (Maybe Type) -... #seed Nat -... #scope_type_vars (List Nat) -... #extensions Any -... #eval (-> Type Code (-> Lux (Either Text [Lux Any]))) -... #host Any}) +... (Record +... [#info Info +... #source Source +... #location Location +... #current_module (Maybe Text) +... #modules (List [Text Module]) +... #scopes (List Scope) +... #type_context Type_Context +... #expected (Maybe Type) +... #seed Nat +... #scope_type_vars (List Nat) +... #extensions Any +... #eval (-> Type Code (-> Lux (Either Text [Lux Any]))) +... #host Any])) ("lux def type tagged" Lux (#Named ["library/lux" "Lux"] ({Lux @@ -1162,15 +1169,15 @@ (def:'' .private (initialized_quantification? lux) #End (#Function Lux Bit) - ({{#info _ #source _ #current_module _ #modules _ + ({[#info _ #source _ #current_module _ #modules _ #scopes scopes #type_context _ #host _ #seed _ #expected _ #location _ #extensions _ - #scope_type_vars _ #eval _} + #scope_type_vars _ #eval _] (list\mix (function'' [scope verdict] ({#1 #1 - _ ({{#name _ #inner _ #captured _ - #locals {#counter _ - #mappings locals}} + _ ({[#name _ #inner _ #captured _ + #locals [#counter _ + #mappings locals]] (list\mix (function'' [local verdict] ({[local _] ({#1 #1 @@ -1518,19 +1525,19 @@ (def:''' .private maybe_monad #End ($' Monad Maybe) - {#in + [#in (function' [x] (#Some x)) #then (function' [f ma] ({#None #None (#Some a) (f a)} - ma))}) + ma))]) (def:''' .private meta_monad #End ($' Monad Meta) - {#in + [#in (function' [x] (function' [state] (#Right state x))) @@ -1543,7 +1550,7 @@ (#Right [state' a]) (f a state')} - (ma state))))}) + (ma state))))]) (macro:' .private (do tokens) ({(#Item monad (#Item [_ (#Tuple bindings)] (#Item body #End))) @@ -1570,7 +1577,8 @@ var)))) body (list\reversed (pairs bindings)))] - (in_meta (list (form$ (list (record$ (list [(record$ (list [(tag$ ["library/lux" "in"]) g!in] [(tag$ ["library/lux" "then"]) g!then])) + (in_meta (list (form$ (list (record$ (list [(tuple$ (list (tag$ ["library/lux" "in"]) g!in + (tag$ ["library/lux" "then"]) g!then)) body'])) monad))))) @@ -1585,7 +1593,7 @@ (-> a ($' m b)) ($' List a) ($' m ($' List b)))) - (let' [{#in in #then _} m] + (let' [[#in in #then _] m] ({#End (in #End) @@ -1604,7 +1612,7 @@ b ($' List a) ($' m b))) - (let' [{#in in #then _} m] + (let' [[#in in #then _] m] ({#End (in y) @@ -1660,11 +1668,11 @@ #End (-> Name ($' Meta Name)) (let' [[module name] full_name - {#info info #source source #current_module _ #modules modules + [#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} state] - ({(#Some {#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _}) + #scope_type_vars scope_type_vars #eval _eval] state] + ({(#Some [#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _]) ({(#Some constant) ({(#Alias real_name) (#Right [state real_name]) @@ -1849,10 +1857,10 @@ (def:'' .private (current_module_name state) #End ($' Meta Text) - ({{#info info #source source #current_module current_module #modules modules + ({[#info info #source source #current_module current_module #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} + #scope_type_vars scope_type_vars #eval _eval] ({(#Some module_name) (#Right [state module_name]) @@ -2201,7 +2209,7 @@ ($' Maybe Macro)) (do maybe_monad [$module (plist\value module modules) - gdef (let' [{#module_hash _ #module_aliases _ #definitions bindings #imports _ #module_annotations _ #module_state _} ("lux type check" Module $module)] + gdef (let' [[#module_hash _ #module_aliases _ #definitions bindings #imports _ #module_annotations _ #module_state _] ("lux type check" Module $module)] (plist\value name bindings))] ({(#Alias [r_module r_name]) (macro'' modules current_module r_module r_name) @@ -2244,11 +2252,11 @@ [current_module current_module_name] (let' [[module name] full_name] (function' [state] - ({{#info info #source source #current_module _ #modules modules + ({[#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} + #scope_type_vars scope_type_vars #eval _eval] (#Right state (macro'' modules current_module module name))} state))))) @@ -2533,16 +2541,16 @@ (def:''' .private (identifier prefix state) #End (-> Text ($' Meta Code)) - ({{#info info #source source #current_module _ #modules modules + ({[#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} - (#Right {#info info #source source #current_module _ #modules modules + #scope_type_vars scope_type_vars #eval _eval] + (#Right [#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed ("lux i64 +" 1 seed) #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} + #scope_type_vars scope_type_vars #eval _eval] (local_identifier$ ($_ text\composite "__gensym__" prefix (nat\encoded seed))))} state)) @@ -3255,10 +3263,10 @@ (def: (module name) (-> Text (Meta Module)) (function (_ state) - (let [{#info info #source source #current_module _ #modules modules + (let [[#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} state] + #scope_type_vars scope_type_vars #eval _eval] state] (case (plist\value name modules) (#Some module) (#Right state module) @@ -3270,7 +3278,7 @@ (-> Name (Meta [Nat (List Name) Bit Type])) (do meta_monad [=module (..module module) - .let [{#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _} =module]] + .let [[#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _] =module]] (case (plist\value (text\composite "#" name) definitions) (#Some (#Slot [exported type group index])) (in_meta [index @@ -3298,7 +3306,7 @@ (#Named [module name] unnamed) (do meta_monad [=module (..module module) - .let [{#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _} =module]] + .let [[#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _] =module]] (case (plist\value name definitions) (#Some (#Type [exported? (#Named _ _type) (#Right slots)])) (case (interface_methods _type) @@ -3319,10 +3327,10 @@ (def: expected_type (Meta Type) (function (_ state) - (let [{#info info #source source #current_module _ #modules modules + (let [[#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} state] + #scope_type_vars scope_type_vars #eval _eval] state] (case expected (#Some type) (#Right state type) @@ -3394,13 +3402,13 @@ (list\each (function (_ tag) [(product\right tag) (tag$ tag)]) tags))] members (monad\each meta_monad - (: (-> Code (Meta [Code Code])) + (: (-> Code (Meta (List Code))) (function (_ token) (case token (^ [_ (#Form (list [_ (#Text "lux def")] [_ (#Identifier "" tag_name)] value meta export_policy))]) (case (plist\value tag_name tag_mappings) (#Some tag) - (in [tag value]) + (in (list tag value)) _ (failure (text\composite "Unknown implementation member: " tag_name))) @@ -3408,7 +3416,7 @@ _ (failure "Invalid implementation member.")))) (list\conjoint tokens'))] - (in (list (record$ members))))) + (in (list (tuple$ (list\conjoint members)))))) (def: (text\interposed separator parts) (-> Text (List Text) Text) @@ -3539,20 +3547,10 @@ _ #None)) -(def: un_paired - (-> (List [Code Code]) (List Code)) - (let [pair_list (: (-> [Code Code] (List Code)) - (function (_ [left right]) - (list left right)))] - (function (_ it) - (|> it - (list\each pair_list) - list\conjoint)))) - (macro: .public (Record tokens) (case tokens - (^ (list [_ (#Record record)])) - (case (everyP slotP (un_paired record)) + (^ (list [_ (#Tuple record)])) + (case (everyP slotP record) (#Some slots) (in_meta (list (` (..Tuple (~+ (list\each product\right slots)))) (tuple$ (list\each (function (_ slot) @@ -3728,14 +3726,14 @@ (type: Refer (Record - {#refer_defs Referrals - #refer_open (List Openings)})) + [#refer_defs Referrals + #refer_open (List Openings)])) (type: Importation (Record - {#import_name Text + [#import_name Text #import_alias (Maybe Text) - #import_refer Refer})) + #import_refer Refer])) (def: (referral_references defs) (-> (List Code) (Meta (List Text))) @@ -3921,10 +3919,10 @@ [_ (#Identifier ["" module_name])] (do meta_monad [absolute_module_name (..absolute_module_name nested? relative_root module_name)] - (in (list {#import_name absolute_module_name + (in (list [#import_name absolute_module_name #import_alias #None - #import_refer {#refer_defs #All - #refer_open (list)}}))) + #import_refer [#refer_defs #All + #refer_open (list)]]))) ... Nested (^ [_ (#Tuple (list& [_ (#Identifier ["" module_name])] extra))]) @@ -3945,10 +3943,10 @@ sub_imports _ - (list& {#import_name absolute_module_name + (list& [#import_name absolute_module_name #import_alias #None - #import_refer {#refer_defs referral - #refer_open openings}} + #import_refer [#refer_defs referral + #refer_open openings]] sub_imports)))) (^ [_ (#Tuple (list& [_ (#Text alias)] [_ (#Identifier ["" module_name])] extra))]) @@ -3970,10 +3968,10 @@ sub_imports _ - (list& {#import_name absolute_module_name + (list& [#import_name absolute_module_name #import_alias (#Some module_alias) - #import_refer {#refer_defs referral - #refer_open openings}} + #import_refer [#refer_defs referral + #refer_open openings]] sub_imports)))) ... Unrecognized syntax. @@ -3989,10 +3987,10 @@ (def: (exported_definitions module state) (-> Text (Meta (List Text))) (let [[current_module modules] (case state - {#info info #source source #current_module current_module #modules modules + [#info info #source source #current_module current_module #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} + #scope_type_vars scope_type_vars #eval _eval] [current_module modules])] (case (plist\value module modules) (#Some =module) @@ -4018,7 +4016,7 @@ (#Slot _) (list)))) - (let [{#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _} =module] + (let [[#module_hash _ #module_aliases _ #definitions definitions #imports _ #module_annotations _ #module_state _] =module] definitions))] (#Right state (list\conjoint to_alias))) @@ -4069,17 +4067,17 @@ (def: (in_env name state) (-> Text Lux (Maybe Type)) (case state - {#info info #source source #current_module _ #modules modules + [#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} + #scope_type_vars scope_type_vars #eval _eval] (list\one (: (-> Scope (Maybe Type)) (function (_ env) (case env - {#name _ + [#name _ #inner _ - #locals {#counter _ #mappings locals} - #captured {#counter _ #mappings closure}} + #locals [#counter _ #mappings locals] + #captured [#counter _ #mappings closure]] (on_either (list\one (: (-> [Text [Type Any]] (Maybe Type)) (function (_ [bname [type _]]) (if (text\= name bname) @@ -4092,15 +4090,15 @@ (def: (definition_type name state) (-> Name Lux (Maybe Type)) (let [[v_module v_name] name - {#info info #source source #current_module _ #modules modules + [#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} state] + #scope_type_vars scope_type_vars #eval _eval] state] (case (plist\value v_module modules) #None #None - (#Some {#definitions definitions #module_hash _ #module_aliases _ #imports _ #module_annotations _ #module_state _}) + (#Some [#definitions definitions #module_hash _ #module_aliases _ #imports _ #module_annotations _ #module_state _]) (case (plist\value v_name definitions) #None #None @@ -4125,15 +4123,15 @@ (def: (definition_value name state) (-> Name (Meta [Type Any])) (let [[v_module v_name] name - {#info info #source source #current_module _ #modules modules + [#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} state] + #scope_type_vars scope_type_vars #eval _eval] state] (case (plist\value v_module modules) #None (#Left (text\composite "Unknown definition: " (name\encoded name))) - (#Some {#definitions definitions #module_hash _ #module_aliases _ #imports _ #module_annotations _ #module_state _}) + (#Some [#definitions definitions #module_hash _ #module_aliases _ #imports _ #module_annotations _ #module_state _]) (case (plist\value v_name definitions) #None (#Left (text\composite "Unknown definition: " (name\encoded name))) @@ -4192,11 +4190,11 @@ (#Left ($_ text\composite "Unknown var: " (name\encoded full_name)))))] (case temp (#Right [compiler (#Var type_id)]) - (let [{#info _ #source _ #current_module _ #modules _ + (let [[#info _ #source _ #current_module _ #modules _ #scopes _ #type_context type_context #host _ #seed _ #expected _ #location _ #extensions extensions - #scope_type_vars _ #eval _eval} compiler - {#ex_counter _ #var_counter _ #var_bindings var_bindings} type_context] + #scope_type_vars _ #eval _eval] compiler + [#ex_counter _ #var_counter _ #var_bindings var_bindings] type_context] (case (type_variable type_id var_bindings) #None temp @@ -4309,13 +4307,15 @@ g!output (..identifier "")] (case (interface_methods type) (#Some members) - (let [pattern (record$ (list\each (: (-> [Name [Nat Type]] [Code Code]) - (function (_ [[r_module r_name] [r_idx r_type]]) - [(tag$ [r_module r_name]) + (let [pattern (|> (zipped/2 tags (enumeration members)) + (list\each (: (-> [Name [Nat Type]] (List Code)) + (function (_ [[r_module r_name] [r_idx r_type]]) + (list (tag$ [r_module r_name]) (if ("lux i64 =" idx r_idx) g!output - g!_)])) - (zipped/2 tags (enumeration members))))] + g!_))))) + list\conjoint + tuple$)] (in_meta (list (` ({(~ pattern) (~ g!output)} (~ record)))))) _ @@ -4415,7 +4415,7 @@ (-> Text Text (Meta Bit)) (do meta_monad [module (module module_name) - .let [{#module_hash _ #module_aliases _ #definitions _ #imports imports #module_annotations _ #module_state _} module]] + .let [[#module_hash _ #module_aliases _ #definitions _ #imports imports #module_annotations _ #module_state _] module]] (in (is_member? imports import_name)))) (def: (referrals module_name options) @@ -4428,8 +4428,8 @@ current_module current_module_name] (case options #End - (in {#refer_defs referral - #refer_open openings}) + (in [#refer_defs referral + #refer_open openings]) _ (failure ($_ text\composite "Wrong syntax for refer @ " current_module @@ -4575,18 +4575,22 @@ [g!slot (..identifier "")] (in_meta [r_slot_name r_idx g!slot])))) (zipped/2 tags (enumeration members)))] - (let [pattern (record$ (list\each (: (-> [Name Nat Code] [Code Code]) - (function (_ [r_slot_name r_idx r_var]) - [(tag$ r_slot_name) - r_var])) - pattern')) - output (record$ (list\each (: (-> [Name Nat Code] [Code Code]) - (function (_ [r_slot_name r_idx r_var]) - [(tag$ r_slot_name) + (let [pattern (|> pattern' + (list\each (: (-> [Name Nat Code] (List Code)) + (function (_ [r_slot_name r_idx r_var]) + (list (tag$ r_slot_name) + r_var)))) + list\conjoint + tuple$) + output (|> pattern' + (list\each (: (-> [Name Nat Code] (List Code)) + (function (_ [r_slot_name r_idx r_var]) + (list (tag$ r_slot_name) (if ("lux i64 =" idx r_idx) value - r_var)])) - pattern'))] + r_var))))) + list\conjoint + tuple$)] (in_meta (list (` ({(~ pattern) (~ output)} (~ record))))))) _ @@ -4654,18 +4658,22 @@ [g!slot (..identifier "")] (in_meta [r_slot_name r_idx g!slot])))) (zipped/2 tags (enumeration members)))] - (let [pattern (record$ (list\each (: (-> [Name Nat Code] [Code Code]) - (function (_ [r_slot_name r_idx r_var]) - [(tag$ r_slot_name) - r_var])) - pattern')) - output (record$ (list\each (: (-> [Name Nat Code] [Code Code]) - (function (_ [r_slot_name r_idx r_var]) - [(tag$ r_slot_name) + (let [pattern (|> pattern' + (list\each (: (-> [Name Nat Code] (List Code)) + (function (_ [r_slot_name r_idx r_var]) + (list (tag$ r_slot_name) + r_var)))) + list\conjoint + tuple$) + output (|> pattern' + (list\each (: (-> [Name Nat Code] (List Code)) + (function (_ [r_slot_name r_idx r_var]) + (list (tag$ r_slot_name) (if ("lux i64 =" idx r_idx) (` ((~ fun) (~ r_var))) - r_var)])) - pattern'))] + r_var))))) + list\conjoint + tuple$)] (in_meta (list (` ({(~ pattern) (~ output)} (~ record))))))) _ @@ -4854,13 +4862,15 @@ (function (_ [module name]) [name (local_identifier$ name)])) (list& hslot tslots)) - pattern (record$ (list\each (: (-> Name [Code Code]) - (function (_ [module name]) - (let [tag (tag$ [module name])] - (case (plist\value name slot_pairings) - (#Some binding) [tag binding] - #None [tag g!_])))) - tags))]] + pattern (|> tags + (list\each (: (-> Name (List Code)) + (function (_ [module name]) + (let [tag (tag$ [module name])] + (case (plist\value name slot_pairings) + (#Some binding) (list tag binding) + #None (list tag g!_)))))) + list\conjoint + tuple$)]] (in_meta (list& pattern body branches))) _ @@ -5109,10 +5119,10 @@ (def: (scope_type_vars state) (Meta (List Nat)) (case state - {#info info #source source #current_module _ #modules modules + [#info info #source source #current_module _ #modules modules #scopes scopes #type_context types #host host #seed seed #expected expected #location location #extensions extensions - #scope_type_vars scope_type_vars #eval _eval} + #scope_type_vars scope_type_vars #eval _eval] (#Right [state scope_type_vars]))) (macro: .public (:parameter tokens) diff --git a/stdlib/source/library/lux/abstract/monad/indexed.lux b/stdlib/source/library/lux/abstract/monad/indexed.lux index 58e7e4633..f74790dca 100644 --- a/stdlib/source/library/lux/abstract/monad/indexed.lux +++ b/stdlib/source/library/lux/abstract/monad/indexed.lux @@ -83,11 +83,11 @@ (#.Some name) (let [name (code.local_identifier name)] (` (let [(~ name) (~ monad) - {#..in (~' in) - #..then (~ g!then)} (~ name)] + [#..in (~' in) + #..then (~ g!then)] (~ name)] (~ body)))) #.None - (` (let [{#..in (~' in) - #..then (~ g!then)} (~ monad)] + (` (let [[#..in (~' in) + #..then (~ g!then)] (~ monad)] (~ body))))))))) diff --git a/stdlib/source/library/lux/control/concatenative.lux b/stdlib/source/library/lux/control/concatenative.lux index 6f3f64403..7e8e04ba2 100644 --- a/stdlib/source/library/lux/control/concatenative.lux +++ b/stdlib/source/library/lux/control/concatenative.lux @@ -31,8 +31,8 @@ (type: Stack (Record - {#bottom (Maybe Code) - #top (List Code)})) + [#bottom (Maybe Code) + #top (List Code)])) (def: aliases^ (Parser (List Alias)) diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index 6d47288df..7353bad84 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -66,9 +66,9 @@ {} (Record - {#obituary [(Async ) + [#obituary [(Async ) (Resolver )] - #mailbox (Atom )}) + #mailbox (Atom )]) (type: .public (Mail s) ) @@ -78,8 +78,8 @@ (type: .public (Behavior o s) (Record - {#on_init (-> o s) - #on_mail (-> (Mail s) s (Actor s) (Async (Try s)))})) + [#on_init (-> o s) + #on_mail (-> (Mail s) s (Actor s) (Async (Try s)))])) (def: .public (spawn! behavior init) (All (_ o s) (-> (Behavior o s) o (IO (Actor s)))) @@ -89,8 +89,8 @@ behavior (Actor s) - (:abstraction {#obituary (async.async []) - #mailbox (atom (async.async []))})) + (:abstraction [#obituary (async.async []) + #mailbox (atom (async.async []))])) process (loop [state (on_init init) [|mailbox| _] (io.run! (atom.read! (value@ #mailbox (:representation self))))] (do {! async.monad} @@ -204,8 +204,8 @@ (def: .public default (All (_ s) (Behavior s s)) - {#on_init function.identity - #on_mail ..default_on_mail}) + [#on_init function.identity + #on_mail ..default_on_mail]) (def: .public (poison! actor) (All (_ s) (-> (Actor s) (IO (Try Any)))) @@ -274,8 +274,8 @@ (def: (~ export_policy) (~ g!actor) (All ((~ g!_) (~+ g!vars)) (..Behavior (~ state_type) ((~ g!type) (~+ g!vars)))) - {#..on_init (|>> ((~! abstract.:abstraction) (~ g!type))) - #..on_mail (~ (..on_mail g!_ ?on_mail))}) + [#..on_init (|>> ((~! abstract.:abstraction) (~ g!type))) + #..on_mail (~ (..on_mail g!_ ?on_mail))]) (~+ messages)))))))) @@ -284,18 +284,18 @@ (with_identifiers [g!_] (in (list (` (: ((~! io.IO) (..Actor (~ state_type))) (..spawn! (: (..Behavior (~ state_type) (~ state_type)) - {#..on_init (|>>) - #..on_mail (~ (..on_mail g!_ ?on_mail))}) + [#..on_init (|>>) + #..on_mail (~ (..on_mail g!_ ?on_mail))]) (: (~ state_type) (~ init))))))))) (type: Signature (Record - {#vars (List Text) + [#vars (List Text) #name Text #inputs (List |input|.Input) #state Text - #self Text})) + #self Text])) (def: signature^ (Parser Signature) diff --git a/stdlib/source/library/lux/control/concurrency/atom.lux b/stdlib/source/library/lux/control/concurrency/atom.lux index 963400278..53120a3c4 100644 --- a/stdlib/source/library/lux/control/concurrency/atom.lux +++ b/stdlib/source/library/lux/control/concurrency/atom.lux @@ -1,6 +1,7 @@ (.module: [library [lux #* + ["." macro] ["." ffi] ["@" target] [abstract @@ -15,11 +16,12 @@ [type abstract]]]) -(with_expansions [ (as_is (ffi.import: (java/util/concurrent/atomic/AtomicReference a) - ["#::." - (new [a]) - (get [] a) - (compareAndSet [a a] boolean)]))] +(with_expansions [ (as_is (macro.log_single_expansion! + (ffi.import: (java/util/concurrent/atomic/AtomicReference a) + ["#::." + (new [a]) + (get [] a) + (compareAndSet [a a] boolean)])))] (for {@.old @.jvm } (as_is))) diff --git a/stdlib/source/library/lux/control/concurrency/semaphore.lux b/stdlib/source/library/lux/control/concurrency/semaphore.lux index f0ff9d7ba..64f3c4af4 100644 --- a/stdlib/source/library/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/library/lux/control/concurrency/semaphore.lux @@ -26,9 +26,9 @@ (type: State (Record - {#max_positions Nat + [#max_positions Nat #open_positions Int - #waiting_list (Queue (Resolver Any))})) + #waiting_list (Queue (Resolver Any))])) (abstract: .public Semaphore {} @@ -42,9 +42,9 @@ (-> Nat Semaphore) (let [max_positions (n.min initial_open_positions ..most_positions_possible)] - (:abstraction (atom.atom {#max_positions max_positions + (:abstraction (atom.atom [#max_positions max_positions #open_positions (.int max_positions) - #waiting_list queue.empty})))) + #waiting_list queue.empty])))) (def: .public (wait! semaphore) (Ex (_ k) (-> Semaphore (Async Any))) @@ -132,17 +132,17 @@ {} (Record - {#limit Limit + [#limit Limit #count (Atom Nat) #start_turnstile Semaphore - #end_turnstile Semaphore}) + #end_turnstile Semaphore]) (def: .public (barrier limit) (-> Limit Barrier) - (:abstraction {#limit limit + (:abstraction [#limit limit #count (atom.atom 0) #start_turnstile (..semaphore 0) - #end_turnstile (..semaphore 0)})) + #end_turnstile (..semaphore 0)])) (def: (un_block! times turnstile) (-> Nat Semaphore (Async Any)) diff --git a/stdlib/source/library/lux/control/concurrency/stm.lux b/stdlib/source/library/lux/control/concurrency/stm.lux index d8bb2568b..523227a27 100644 --- a/stdlib/source/library/lux/control/concurrency/stm.lux +++ b/stdlib/source/library/lux/control/concurrency/stm.lux @@ -77,9 +77,9 @@ (type: (Tx_Frame a) (Record - {#var (Var a) + [#var (Var a) #original a - #current a})) + #current a])) (type: Tx (List (Ex (_ a) (Tx_Frame a)))) @@ -118,13 +118,13 @@ (#.Item [_var _original _current] tx') (if (same? (:as (Var Any) var) (:as (Var Any) _var)) - (#.Item {#var (:as (Var Any) _var) + (#.Item [#var (:as (Var Any) _var) #original (:as Any _original) - #current (:as Any value)} + #current (:as Any value)] tx') - (#.Item {#var _var + (#.Item [#var _var #original _original - #current _current} + #current _current] (with_updated_var var value tx'))))) (def: .public (write value var) diff --git a/stdlib/source/library/lux/control/concurrency/thread.lux b/stdlib/source/library/lux/control/concurrency/thread.lux index 603b44da8..e3a5606c3 100644 --- a/stdlib/source/library/lux/control/concurrency/thread.lux +++ b/stdlib/source/library/lux/control/concurrency/thread.lux @@ -60,9 +60,9 @@ ... Default (type: Thread (Record - {#creation Nat + [#creation Nat #delay Nat - #action (IO Any)})) + #action (IO Any)])) )) (def: .public parallelism @@ -129,9 +129,9 @@ ... Default (do {! io.monad} [now (\ ! each (|>> instant.millis .nat) instant.now) - _ (atom.update! (|>> (#.Item {#creation now + _ (atom.update! (|>> (#.Item [#creation now #delay milli_seconds - #action action})) + #action action])) ..runner)] (in []))))) diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux index 4998142f7..17de72095 100644 --- a/stdlib/source/library/lux/control/exception.lux +++ b/stdlib/source/library/lux/control/exception.lux @@ -28,8 +28,8 @@ (type: .public (Exception a) (Record - {#label Text - #constructor (-> a Text)})) + [#label Text + #constructor (-> a Text)])) (def: .public (match? exception error) (All (_ e) (-> (Exception e) Text Bit)) @@ -101,10 +101,10 @@ (All ((~ g!_) (~+ (list\each |type_variable|.format t_vars))) (..Exception [(~+ (list\each (value@ #|input|.type) inputs))])) (let [(~ g!descriptor) (~ (code.text descriptor))] - {#..label (~ g!descriptor) + [#..label (~ g!descriptor) #..constructor (function ((~ g!self) [(~+ (list\each (value@ #|input|.binding) inputs))]) ((~! text\composite) (~ g!descriptor) - (~ (maybe.else (' "") body))))})))))))) + (~ (maybe.else (' "") body))))])))))))) (def: (report' entries) (-> (List [Text Text]) Text) diff --git a/stdlib/source/library/lux/control/function/mutual.lux b/stdlib/source/library/lux/control/function/mutual.lux index 5ef853829..f303eff44 100644 --- a/stdlib/source/library/lux/control/function/mutual.lux +++ b/stdlib/source/library/lux/control/function/mutual.lux @@ -26,9 +26,9 @@ (type: Mutual (Record - {#declaration Declaration + [#declaration Declaration #type Code - #body Code})) + #body Code])) (.def: mutual (Parser [Declaration Code Code]) @@ -97,8 +97,8 @@ (type: Definition (Record - {#export_policy Code - #mutual Mutual})) + [#export_policy Code + #mutual Mutual])) (.def: definition (Parser Definition) diff --git a/stdlib/source/library/lux/control/parser/text.lux b/stdlib/source/library/lux/control/parser/text.lux index 5943fba26..e19eb72a4 100644 --- a/stdlib/source/library/lux/control/parser/text.lux +++ b/stdlib/source/library/lux/control/parser/text.lux @@ -32,8 +32,8 @@ (type: .public Slice (Record - {#basis Offset - #distance Offset})) + [#basis Offset + #distance Offset])) (def: (left_over offset tape) (-> Offset Text Text) @@ -77,8 +77,8 @@ (in (list\mix (function (_ [slice::basis slice::distance] [total::basis total::distance]) [total::basis ("lux i64 +" slice::distance total::distance)]) - {#basis offset - #distance 0} + [#basis offset + #distance 0] slices)))) (def: .public any @@ -97,8 +97,8 @@ (case (/.char offset tape) (#.Some _) (#try.Success [[("lux i64 +" 1 offset) tape] - {#basis offset - #distance 1}]) + [#basis offset + #distance 1]]) _ (exception.except ..cannot_slice [])))) @@ -230,8 +230,8 @@ (let [output' (/.of_char output)] (if ( (/.contains? output' options)) (#try.Success [[("lux i64 +" 1 offset) tape] - {#basis offset - #distance 1}]) + [#basis offset + #distance 1]]) (exception.except [options output]))) _ diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux index c9e840698..44d233cde 100644 --- a/stdlib/source/library/lux/control/security/policy.lux +++ b/stdlib/source/library/lux/control/security/policy.lux @@ -21,8 +21,8 @@ (type: .public (Privilege brand label) (Record - {#can_upgrade (Can_Upgrade brand label) - #can_downgrade (Can_Downgrade brand label)})) + [#can_upgrade (Can_Upgrade brand label) + #can_downgrade (Can_Downgrade brand label)])) (type: .public (Delegation brand from to) (All (_ value) @@ -41,8 +41,8 @@ (def: privilege Privilege - {#can_upgrade (|>> :abstraction) - #can_downgrade (|>> :representation)}) + [#can_upgrade (|>> :abstraction) + #can_downgrade (|>> :representation)]) (def: .public (with_policy context) (All (_ brand scope) diff --git a/stdlib/source/library/lux/control/writer.lux b/stdlib/source/library/lux/control/writer.lux index b933c4388..771bb95a5 100644 --- a/stdlib/source/library/lux/control/writer.lux +++ b/stdlib/source/library/lux/control/writer.lux @@ -10,8 +10,8 @@ (type: .public (Writer log value) (Record - {#log log - #value value})) + [#log log + #value value])) (def: .public (write message) (All (_ log) (-> log (Writer log Any))) diff --git a/stdlib/source/library/lux/data/collection/dictionary.lux b/stdlib/source/library/lux/data/collection/dictionary.lux index ad65dabbd..becef793e 100644 --- a/stdlib/source/library/lux/data/collection/dictionary.lux +++ b/stdlib/source/library/lux/data/collection/dictionary.lux @@ -560,8 +560,8 @@ (type: .public (Dictionary k v) (Record - {#hash (Hash k) - #root (Node k v)})) + [#hash (Hash k) + #root (Node k v)])) (def: .public key_hash (All (_ k v) (-> (Dictionary k v) (Hash k))) @@ -569,8 +569,8 @@ (def: .public (empty key_hash) (All (_ k v) (-> (Hash k) (Dictionary k v))) - {#hash key_hash - #root empty_node}) + [#hash key_hash + #root empty_node]) (def: .public (has key val dict) (All (_ k v) (-> k v (Dictionary k v) (Dictionary k v))) diff --git a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux index acb2599f2..81096ddef 100644 --- a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux @@ -25,20 +25,20 @@ (type: (Node k v) (Record - {#color Color + [#color Color #key k #value v #left (Maybe (Node k v)) - #right (Maybe (Node k v))})) + #right (Maybe (Node k v))])) (template [ ] [(def: ( key value left right) (All (_ k v) (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v))) - {#color + [#color #key key #value value #left left - #right right})] + #right right])] [red #Red] [black #Black] @@ -46,13 +46,13 @@ (type: .public (Dictionary k v) (Record - {#&order (Order k) - #root (Maybe (Node k v))})) + [#&order (Order k) + #root (Maybe (Node k v))])) (def: .public (empty order) (All (_ k v) (-> (Order k) (Dictionary k v))) - {#&order order - #root #.None}) + [#&order order + #root #.None]) ... TODO: Doing inneficient access of Order functions due to compiler bug. ... TODO: Must improve it as soon as bug is fixed. diff --git a/stdlib/source/library/lux/data/collection/queue.lux b/stdlib/source/library/lux/data/collection/queue.lux index 524c14067..deb07edb2 100644 --- a/stdlib/source/library/lux/data/collection/queue.lux +++ b/stdlib/source/library/lux/data/collection/queue.lux @@ -13,18 +13,18 @@ (type: .public (Queue a) (Record - {#front (List a) - #rear (List a)})) + [#front (List a) + #rear (List a)])) (def: .public empty Queue - {#front (.list) - #rear (.list)}) + [#front (.list) + #rear (.list)]) (def: .public (of_list entries) (All (_ a) (-> (List a) (Queue a))) - {#front entries - #rear (.list)}) + [#front entries + #rear (.list)]) (def: .public (list queue) (All (_ a) (-> (Queue a) (List a))) @@ -90,5 +90,5 @@ (Functor Queue) (def: (each f fa) - {#front (|> fa (value@ #front) (list\each f)) - #rear (|> fa (value@ #rear) (list\each f))})) + [#front (|> fa (value@ #front) (list\each f)) + #rear (|> fa (value@ #rear) (list\each f))])) diff --git a/stdlib/source/library/lux/data/collection/row.lux b/stdlib/source/library/lux/data/collection/row.lux index 59f48d867..6c04e7dd4 100644 --- a/stdlib/source/library/lux/data/collection/row.lux +++ b/stdlib/source/library/lux/data/collection/row.lux @@ -191,17 +191,17 @@ (type: .public (Row a) (Record - {#level Level + [#level Level #size Nat #root (Hierarchy a) - #tail (Base a)})) + #tail (Base a)])) (def: .public empty Row - {#level (level_up root_level) + [#level (level_up root_level) #size 0 #root (empty_hierarchy []) - #tail (array.empty 0)}) + #tail (array.empty 0)]) (def: .public (size row) (All (_ a) (-> (Row a) Nat)) @@ -439,10 +439,10 @@ (Functor Row) (def: (each f xs) - {#level (value@ #level xs) + [#level (value@ #level xs) #size (value@ #size xs) #root (|> xs (value@ #root) (array\each (\ node_functor each f))) - #tail (|> xs (value@ #tail) (array\each f))})) + #tail (|> xs (value@ #tail) (array\each f))])) (implementation: .public apply (Apply Row) diff --git a/stdlib/source/library/lux/data/collection/tree.lux b/stdlib/source/library/lux/data/collection/tree.lux index d16d02c74..26c385f7e 100644 --- a/stdlib/source/library/lux/data/collection/tree.lux +++ b/stdlib/source/library/lux/data/collection/tree.lux @@ -18,8 +18,8 @@ (type: .public (Tree a) (Record - {#value a - #children (List (Tree a))})) + [#value a + #children (List (Tree a))])) (def: .public (flat tree) (All (_ a) (-> (Tree a) (List a))) @@ -31,13 +31,13 @@ (def: .public (leaf value) (All (_ a) (-> a (Tree a))) - {#value value - #children (list)}) + [#value value + #children (list)]) (def: .public (branch value children) (All (_ a) (-> a (List (Tree a)) (Tree a))) - {#value value - #children children}) + [#value value + #children children]) (type: Tree_Code (Rec Tree_Code @@ -56,8 +56,8 @@ (syntax: .public (tree [root tree^]) (in (list (` (~ (loop [[value children] root] - (` {#value (~ value) - #children (list (~+ (list\each recur children)))}))))))) + (` [#value (~ value) + #children (list (~+ (list\each recur children)))]))))))) (implementation: .public (equivalence super) (All (_ a) (-> (Equivalence a) (Equivalence (Tree a)))) @@ -70,9 +70,9 @@ (Functor Tree) (def: (each f fa) - {#value (f (value@ #value fa)) + [#value (f (value@ #value fa)) #children (list\each (each f) - (value@ #children fa))})) + (value@ #children fa))])) (implementation: .public mix (Mix Tree) diff --git a/stdlib/source/library/lux/data/collection/tree/finger.lux b/stdlib/source/library/lux/data/collection/tree/finger.lux index b8313112c..c675916aa 100644 --- a/stdlib/source/library/lux/data/collection/tree/finger.lux +++ b/stdlib/source/library/lux/data/collection/tree/finger.lux @@ -15,10 +15,10 @@ {} (Record - {#monoid (Monoid t) + [#monoid (Monoid t) #tag t #root (Or v - [(Tree @ t v) (Tree @ t v)])}) + [(Tree @ t v) (Tree @ t v)])]) (type: .public (Builder @ t) (Interface @@ -45,15 +45,15 @@ (def: (leaf tag value) (:abstraction - {#monoid monoid + [#monoid monoid #tag tag - #root (0 #0 value)})) + #root (0 #0 value)])) (def: (branch left right) (:abstraction - {#monoid monoid + [#monoid monoid #tag (\ monoid composite (..tag left) (..tag right)) - #root (0 #1 [left right])}))) + #root (0 #1 [left right])]))) (def: .public (value tree) (All (_ @ t v) (-> (Tree @ t v) v)) diff --git a/stdlib/source/library/lux/data/collection/tree/zipper.lux b/stdlib/source/library/lux/data/collection/tree/zipper.lux index 7f168c2d3..15265bf94 100644 --- a/stdlib/source/library/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/library/lux/data/collection/tree/zipper.lux @@ -19,15 +19,15 @@ (type: (Family Zipper a) (Record - {#parent (Zipper a) + [#parent (Zipper a) #lefts (List (Tree a)) - #rights (List (Tree a))})) + #rights (List (Tree a))])) ... https://en.wikipedia.org/wiki/Zipper_(data_structure) (type: .public (Zipper a) (Record - {#family (Maybe (Family Zipper a)) - #node (Tree a)})) + [#family (Maybe (Family Zipper a)) + #node (Tree a)])) (implementation: .public (equivalence super) (All (_ a) @@ -46,8 +46,8 @@ (def: .public (zipper tree) (All (_ a) (-> (Tree a) (Zipper a))) - {#family #.None - #node tree}) + [#family #.None + #node tree]) (def: .public tree (All (_ a) (-> (Zipper a) (Tree a))) @@ -93,10 +93,10 @@ #.None (#.Item head tail) - (#.Some {#family (#.Some {#parent (with@ [#node #//.children] (list) zipper) + (#.Some [#family (#.Some [#parent (with@ [#node #//.children] (list) zipper) #lefts #.End - #rights tail}) - #node head}))) + #rights tail]) + #node head]))) (def: .public (up zipper) (All (_ a) (-> (Zipper a) (Maybe (Zipper a)))) @@ -124,16 +124,16 @@ (case (value@ family) (#.Item next side') (#.Some (for {@.old - {#family (#.Some (|> family + [#family (#.Some (|> family (with@ side') (revised@ (|>> (#.Item (value@ #node zipper)))))) - #node next}} + #node next]} (let [move (: (All (_ a) (-> (List (Tree a)) (Zipper a) (Family Zipper a) (Family Zipper a))) (function (_ side' zipper) (|>> (with@ side') (revised@ (|>> (#.Item (value@ #node zipper)))))))] - {#family (#.Some (move side' zipper family)) - #node next}))) + [#family (#.Some (move side' zipper family)) + #node next]))) #.End #.None) @@ -153,18 +153,18 @@ #.None (#.Item last prevs) - (#.Some (for {@.old {#family (#.Some (|> family + (#.Some (for {@.old [#family (#.Some (|> family (with@ #.End) (revised@ (|>> (#.Item (value@ #node zipper)) (list\composite prevs))))) - #node last}} + #node last]} (let [move (: (All (_ a) (-> (List (Tree a)) (Zipper a) (Family Zipper a) (Family Zipper a))) (function (_ prevs zipper) (|>> (with@ #.End) (revised@ (|>> (#.Item (value@ #node zipper)) (list\composite prevs))))))] - {#family (#.Some (move prevs zipper family)) - #node last}))))))] + [#family (#.Some (move prevs zipper family)) + #node last]))))))] [right rightmost #rights #lefts] [left leftmost #lefts #rights] @@ -293,12 +293,12 @@ (Functor Zipper) (def: (each f (^slots [#family #node])) - {#family (maybe\each (function (_ (^slots [#parent #lefts #rights])) - {#parent (each f parent) + [#family (maybe\each (function (_ (^slots [#parent #lefts #rights])) + [#parent (each f parent) #lefts (list\each (//\each f) lefts) - #rights (list\each (//\each f) rights)}) + #rights (list\each (//\each f) rights)]) family) - #node (//\each f node)})) + #node (//\each f node)])) (implementation: .public comonad (CoMonad Zipper) @@ -310,13 +310,13 @@ (def: (disjoint (^slots [#family #node])) (let [tree_splitter (: (All (_ a) (-> (Tree a) (Tree (Zipper a)))) (function (tree_splitter tree) - {#//.value (..zipper tree) + [#//.value (..zipper tree) #//.children (|> tree (value@ #//.children) - (list\each tree_splitter))}))] - {#family (maybe\each (function (_ (^slots [#parent #lefts #rights])) - {#parent (disjoint parent) + (list\each tree_splitter))]))] + [#family (maybe\each (function (_ (^slots [#parent #lefts #rights])) + [#parent (disjoint parent) #lefts (list\each tree_splitter lefts) - #rights (list\each tree_splitter rights)}) + #rights (list\each tree_splitter rights)]) family) - #node (tree_splitter node)}))) + #node (tree_splitter node)]))) diff --git a/stdlib/source/library/lux/data/color.lux b/stdlib/source/library/lux/data/color.lux index f688297f2..11c31b184 100644 --- a/stdlib/source/library/lux/data/color.lux +++ b/stdlib/source/library/lux/data/color.lux @@ -37,19 +37,19 @@ (type: .public RGB (Record - {#red Nat + [#red Nat #green Nat - #blue Nat})) + #blue Nat])) (type: .public HSL [Frac Frac Frac]) (type: .public CMYK (Record - {#cyan Frac + [#cyan Frac #magenta Frac #yellow Frac - #key Frac})) + #key Frac])) (type: .public HSB [Frac Frac Frac]) @@ -61,9 +61,9 @@ (def: .public (of_rgb [red green blue]) (-> RGB Color) - (:abstraction {#red (n.% ..rgb_limit red) + (:abstraction [#red (n.% ..rgb_limit red) #green (n.% ..rgb_limit green) - #blue (n.% ..rgb_limit blue)})) + #blue (n.% ..rgb_limit blue)])) (def: .public rgb (-> Color RGB) @@ -93,15 +93,15 @@ (def: .public black Color - (..of_rgb {#red 0 + (..of_rgb [#red 0 #green 0 - #blue 0})) + #blue 0])) (def: .public white Color - (..of_rgb {#red ..top + (..of_rgb [#red ..top #green ..top - #blue ..top})) + #blue ..top])) (implementation: .public addition (Monoid Color) @@ -111,9 +111,9 @@ (def: (composite left right) (let [[lR lG lB] (:representation left) [rR rG rB] (:representation right)] - (:abstraction {#red (n.max lR rR) + (:abstraction [#red (n.max lR rR) #green (n.max lG rG) - #blue (n.max lB rB)})))) + #blue (n.max lB rB)])))) (def: (opposite_intensity value) (-> Nat Nat) @@ -122,9 +122,9 @@ (def: .public (complement color) (-> Color Color) (let [[red green blue] (:representation color)] - (:abstraction {#red (opposite_intensity red) + (:abstraction [#red (opposite_intensity red) #green (opposite_intensity green) - #blue (opposite_intensity blue)}))) + #blue (opposite_intensity blue)]))) (implementation: .public subtraction (Monoid Color) @@ -134,9 +134,9 @@ (def: (composite left right) (let [[lR lG lB] (:representation (..complement left)) [rR rG rB] (:representation right)] - (:abstraction {#red (n.min lR rR) + (:abstraction [#red (n.min lR rR) #green (n.min lG rG) - #blue (n.min lB rB)})))) + #blue (n.min lB rB)])))) ) (def: .public (hsl color) @@ -198,18 +198,18 @@ (if (f.= +0.0 saturation) ... Achromatic (let [intensity (..up luminance)] - (of_rgb {#red intensity + (of_rgb [#red intensity #green intensity - #blue intensity})) + #blue intensity])) ... Chromatic (let [q (if (f.< +0.5 luminance) (|> saturation (f.+ +1.0) (f.* luminance)) (|> luminance (f.+ saturation) (f.- (f.* saturation luminance)))) p (|> luminance (f.* +2.0) (f.- q)) third (|> +1.0 (f./ +3.0))] - (of_rgb {#red (|> hue (f.+ third) (hue_rgb p q)) + (of_rgb [#red (|> hue (f.+ third) (hue_rgb p q)) #green (|> hue (hue_rgb p q)) - #blue (|> hue (f.- third) (hue_rgb p q))})))) + #blue (|> hue (f.- third) (hue_rgb p q))])))) (def: .public (hsb color) (-> Color HSB) @@ -256,9 +256,9 @@ red (case mod 0 v 1 q 2 p 3 p 4 t 5 v _ (undefined)) green (case mod 0 t 1 v 2 v 3 q 4 p 5 p _ (undefined)) blue (case mod 0 p 1 p 2 t 3 v 4 v 5 q _ (undefined))] - (of_rgb {#red (..up red) + (of_rgb [#red (..up red) #green (..up green) - #blue (..up blue)}))) + #blue (..up blue)]))) (def: .public (cmyk color) (-> Color CMYK) @@ -273,26 +273,26 @@ cyan (|> +1.0 (f.- red) (f.- key) (f.* f)) magenta (|> +1.0 (f.- green) (f.- key) (f.* f)) yellow (|> +1.0 (f.- blue) (f.- key) (f.* f))] - {#cyan cyan + [#cyan cyan #magenta magenta #yellow yellow - #key key})) + #key key])) (def: .public (of_cmyk [cyan magenta yellow key]) (-> CMYK Color) (if (f.= +1.0 key) - (of_rgb {#red 0 + (of_rgb [#red 0 #green 0 - #blue 0}) + #blue 0]) (let [red (|> (|> +1.0 (f.- cyan)) (f.* (|> +1.0 (f.- key)))) green (|> (|> +1.0 (f.- magenta)) (f.* (|> +1.0 (f.- key)))) blue (|> (|> +1.0 (f.- yellow)) (f.* (|> +1.0 (f.- key))))] - (of_rgb {#red (..up red) + (of_rgb [#red (..up red) #green (..up green) - #blue (..up blue)})))) + #blue (..up blue)])))) (def: (normal ratio) (-> Frac Frac) @@ -317,9 +317,9 @@ .nat))) [redS greenS blueS] (rgb start) [redE greenE blueE] (rgb end)] - (of_rgb {#red (interpolated' redE redS) + (of_rgb [#red (interpolated' redE redS) #green (interpolated' greenE greenS) - #blue (interpolated' blueE blueS)}))) + #blue (interpolated' blueE blueS)]))) (template [ ] [(def: .public ( ratio color) @@ -432,5 +432,5 @@ (type: .public Pigment (Record - {#color Color - #alpha Alpha})) + [#color Color + #alpha Alpha])) diff --git a/stdlib/source/library/lux/data/color/named.lux b/stdlib/source/library/lux/data/color/named.lux index 43fd25f16..5d6a92463 100644 --- a/stdlib/source/library/lux/data/color/named.lux +++ b/stdlib/source/library/lux/data/color/named.lux @@ -8,9 +8,9 @@ (template [ ] [(`` (def: .public Color - (//.of_rgb {#//.red (hex ) + (//.of_rgb [#//.red (hex ) #//.green (hex ) - #//.blue (hex )})))] + #//.blue (hex )])))] ["F0" "F8" "FF" alice_blue] ["FA" "EB" "D7" antique_white] diff --git a/stdlib/source/library/lux/data/format/css.lux b/stdlib/source/library/lux/data/format/css.lux index 57a7d33de..36c94ef17 100644 --- a/stdlib/source/library/lux/data/format/css.lux +++ b/stdlib/source/library/lux/data/format/css.lux @@ -88,8 +88,8 @@ (type: .public Frame (Record - {#when Percentage - #what Style})) + [#when Percentage + #what Style])) (def: .public (key_frames animation frames) (-> (Value Animation) (List Frame) (CSS Special)) diff --git a/stdlib/source/library/lux/data/format/css/font.lux b/stdlib/source/library/lux/data/format/css/font.lux index 2ebe6644d..198621e16 100644 --- a/stdlib/source/library/lux/data/format/css/font.lux +++ b/stdlib/source/library/lux/data/format/css/font.lux @@ -15,14 +15,14 @@ (type: .public Unicode_Range (Record - {#start Nat - #end Nat})) + [#start Nat + #end Nat])) (type: .public Font (Record - {#family Text + [#family Text #source URL #stretch (Maybe (Value Font_Stretch)) #style (Maybe (Value Font_Style)) #weight (Maybe (Value Font_Weight)) - #unicode_range (Maybe Unicode_Range)})) + #unicode_range (Maybe Unicode_Range)])) diff --git a/stdlib/source/library/lux/data/format/css/selector.lux b/stdlib/source/library/lux/data/format/css/selector.lux index a1f801779..f8aab3f86 100644 --- a/stdlib/source/library/lux/data/format/css/selector.lux +++ b/stdlib/source/library/lux/data/format/css/selector.lux @@ -182,8 +182,8 @@ (type: .public Formula (Record - {#constant Int - #variable Int})) + [#constant Int + #variable Int])) (def: .public (formula input) (-> Formula Index) diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux index 20b15f0eb..e49398298 100644 --- a/stdlib/source/library/lux/data/format/css/value.lux +++ b/stdlib/source/library/lux/data/format/css/value.lux @@ -1124,10 +1124,10 @@ (type: .public Rectangle (Record - {#top (Value Length) + [#top (Value Length) #right (Value Length) #bottom (Value Length) - #left (Value Length)})) + #left (Value Length)])) (def: .public (clip rectangle) (-> Rectangle (Value Clip)) diff --git a/stdlib/source/library/lux/data/format/html.lux b/stdlib/source/library/lux/data/format/html.lux index bc17e00f6..b47416398 100644 --- a/stdlib/source/library/lux/data/format/html.lux +++ b/stdlib/source/library/lux/data/format/html.lux @@ -226,8 +226,8 @@ (type: .public Coord (Record - {#horizontal Nat - #vertical Nat})) + [#horizontal Nat + #vertical Nat])) (def: metric_separator ",") (def: coord_separator ",") @@ -238,20 +238,20 @@ (type: .public Rectangle (Record - {#start Coord - #end Coord})) + [#start Coord + #end Coord])) (type: .public Circle (Record - {#center Coord - #radius Nat})) + [#center Coord + #radius Nat])) (type: .public Polygon (Record - {#first Coord + [#first Coord #second Coord #third Coord - #extra (List Coord)})) + #extra (List Coord)])) (def: (%rectangle [start end]) (Format Rectangle) diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux index 6aeaa6539..6450bdf01 100644 --- a/stdlib/source/library/lux/data/format/tar.lux +++ b/stdlib/source/library/lux/data/format/tar.lux @@ -564,13 +564,13 @@ (type: .public Owner (Record - {#name Name - #id ID})) + [#name Name + #id ID])) (type: .public Ownership (Record - {#user Owner - #group Owner})) + [#user Owner + #group Owner])) (type: .public File [Path Instant Mode Ownership Content]) @@ -612,7 +612,7 @@ (type: Header (Record - {#path Path + [#path Path #mode Mode #user_id ID #group_id ID @@ -625,7 +625,7 @@ #user_name Name #group_name Name #major_device Device - #minor_device Device})) + #minor_device Device])) (def: header_writer' (Writer Header) @@ -671,7 +671,7 @@ writer ($_ format.and ..header_writer (format.segment (..rounded_content_size size)))] - (writer [{#path path + (writer [[#path path #mode mode #user_id (value@ [#user #id] ownership) #group_id (value@ [#group #id] ownership) @@ -684,7 +684,7 @@ #user_name (value@ [#user #name] ownership) #group_name (value@ [#group #name] ownership) #major_device ..no_device - #minor_device ..no_device} + #minor_device ..no_device] content])))) (def: normal_file_writer @@ -698,7 +698,7 @@ (def: (symbolic_link_writer path) (Writer Path) (..header_writer - {#path ..no_path + [#path ..no_path #mode ..none #user_id ..no_id #group_id ..no_id @@ -711,12 +711,12 @@ #user_name ..anonymous #group_name ..anonymous #major_device ..no_device - #minor_device ..no_device})) + #minor_device ..no_device])) (def: (directory_writer path) (Writer Path) (..header_writer - {#path path + [#path path #mode ..none #user_id ..no_id #group_id ..no_id @@ -729,7 +729,7 @@ #user_name ..anonymous #group_name ..anonymous #major_device ..no_device - #minor_device ..no_device})) + #minor_device ..no_device])) (def: entry_writer (Writer Entry) @@ -799,7 +799,7 @@ major_device ..small_parser minor_device ..small_parser _ (.segment ..header_padding_size)] - (in {#path path + (in [#path path #mode mode #user_id user_id #group_id group_id @@ -812,7 +812,7 @@ #user_name user_name #group_name group_name #major_device major_device - #minor_device minor_device}))) + #minor_device minor_device]))) (exception: .public (wrong_link_flag {expected Link_Flag} {actual Link_Flag}) (exception.report @@ -839,10 +839,10 @@ (duration.up (|> duration.second duration.millis .nat)) instant.absolute) (value@ #mode header) - {#user {#name (value@ #user_name header) - #id (value@ #user_id header)} - #group {#name (value@ #group_name header) - #id (value@ #group_id header)}} + [#user [#name (value@ #user_name header) + #id (value@ #user_id header)] + #group [#name (value@ #group_name header) + #id (value@ #group_id header)]] content]))) (def: (file_name_parser expected extractor) diff --git a/stdlib/source/library/lux/data/store.lux b/stdlib/source/library/lux/data/store.lux index 24f7005fd..de09fe022 100644 --- a/stdlib/source/library/lux/data/store.lux +++ b/stdlib/source/library/lux/data/store.lux @@ -9,13 +9,13 @@ (type: .public (Store s a) (Record - {#cursor s - #peek (-> s a)})) + [#cursor s + #peek (-> s a)])) (def: (extend f wa) (All (_ s a b) (-> (-> (Store s a) b) (Store s a) (Store s b))) - {#cursor (value@ #cursor wa) - #peek (function (_ s) (f (with@ #cursor s wa)))}) + [#cursor (value@ #cursor wa) + #peek (function (_ s) (f (with@ #cursor s wa)))]) (implementation: .public functor (All (_ s) (Functor (Store s))) diff --git a/stdlib/source/library/lux/data/trace.lux b/stdlib/source/library/lux/data/trace.lux index 35d97e9f9..b0819574c 100644 --- a/stdlib/source/library/lux/data/trace.lux +++ b/stdlib/source/library/lux/data/trace.lux @@ -9,8 +9,8 @@ (type: .public (Trace t a) (Record - {#monoid (Monoid t) - #trace (-> t a)})) + [#monoid (Monoid t) + #trace (-> t a)])) (implementation: .public functor (All (_ t) (Functor (Trace t))) @@ -29,12 +29,12 @@ (def: (disjoint wa) (let [monoid (value@ #monoid wa)] - {#monoid monoid + [#monoid monoid #trace (function (_ t1) - {#monoid monoid + [#monoid monoid #trace (function (_ t2) ((value@ #trace wa) - (\ monoid composite t1 t2)))})}))) + (\ monoid composite t1 t2)))])]))) (def: .public (result context tracer) (All (_ t a) (-> t (Trace t a) a)) diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux index 1c5150f41..d11d897d0 100644 --- a/stdlib/source/library/lux/documentation.lux +++ b/stdlib/source/library/lux/documentation.lux @@ -312,7 +312,7 @@ (-> Nat [Text (List Text)] (List Text) Text Type Text) (case tags (^ (list single_tag)) - (format "{#" single_tag " " (type_definition' level type_function_info #.None module type) "}") + (format "(Record [#" single_tag " " (type_definition' level type_function_info #.None module type) "])") _ (case type @@ -563,34 +563,34 @@ (type: .public Definition (Record - {#definition Text - #documentation (Markdown Block)})) + [#definition Text + #documentation (Markdown Block)])) (type: .public Module (Record - {#module Text + [#module Text #description Text #expected (Set Text) - #definitions (List Definition)})) + #definitions (List Definition)])) (syntax: .public (default [[name parameters] ..declaration]) (let [[_ short] name] (in (list (` (: (.List ..Definition) - (list {#..definition (~ (code.text short)) + (list [#..definition (~ (code.text short)) #..documentation ((~! ..minimal_definition_documentation) ((~ (code.identifier name)) - (~+ (list\each code.local_identifier parameters))))}))))))) + (~+ (list\each code.local_identifier parameters))))]))))))) (syntax: .public (documentation: [[name parameters] ..declaration extra (<>.some .any)]) (let [[_ short] name] (in (list (` (.def: .public (~ (code.local_identifier short)) (.List ..Definition) - (.list {#..definition (~ (code.text short)) + (.list [#..definition (~ (code.text short)) #..documentation ((~! ..definition_documentation) ((~ (code.identifier name)) (~+ (list\each code.local_identifier parameters))) - (~+ extra))}))))))) + (~+ extra))]))))))) (def: definitions_documentation (-> (List Definition) (Markdown Block)) @@ -624,13 +624,13 @@ (do meta.monad [expected (meta.exports name)] (in (list (` (: (List Module) - (list& {#..module (~ (code.text name)) + (list& [#..module (~ (code.text name)) #..description (~ description) #..expected ((~! ..expected) (~ (code.text (|> expected (list\each product.left) ..expected_format)))) - #..definitions ((~! list.together) (list (~+ definitions)))} + #..definitions ((~! list.together) (list (~+ definitions)))] ($_ (\ (~! list.monoid) (~' composite)) (: (List Module) (\ (~! list.monoid) (~' identity))) diff --git a/stdlib/source/library/lux/extension.lux b/stdlib/source/library/lux/extension.lux index b63c91b0c..a2334c5f7 100644 --- a/stdlib/source/library/lux/extension.lux +++ b/stdlib/source/library/lux/extension.lux @@ -21,11 +21,11 @@ (type: Declaration (Record - {#name Code + [#name Code #label Text #phase Text #archive Text - #inputs (List Code)})) + #inputs (List Code)])) (def: (declaration default) (-> Code (Parser Declaration)) diff --git a/stdlib/source/library/lux/ffi.js.lux b/stdlib/source/library/lux/ffi.js.lux index 466807a53..1d25fab7d 100644 --- a/stdlib/source/library/lux/ffi.js.lux +++ b/stdlib/source/library/lux/ffi.js.lux @@ -86,12 +86,12 @@ (type: Common_Method (Record - {#name Text + [#name Text #alias (Maybe Text) #inputs (List Nullable) #io? Bit #try? Bit - #output Nullable})) + #output Nullable])) (type: Static_Method Common_Method) (type: Virtual_Method Common_Method) diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index da46af60c..eac74c9f7 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -217,14 +217,14 @@ (type: Annotation (Record - {#ann_name Text - #ann_params (List Annotation_Parameter)})) + [#ann_name Text + #ann_params (List Annotation_Parameter)])) (type: Member_Declaration (Record - {#member_name Text + [#member_name Text #member_privacy Privacy - #member_anns (List Annotation)})) + #member_anns (List Annotation)])) (type: FieldDecl (Variant @@ -233,10 +233,10 @@ (type: MethodDecl (Record - {#method_tvars (List (Type Var)) + [#method_tvars (List (Type Var)) #method_inputs (List (Type Value)) #method_output (Type Return) - #method_exs (List (Type Class))})) + #method_exs (List (Type Class))])) (type: Method_Definition (Variant @@ -280,8 +280,8 @@ (type: Partial_Call (Record - {#pc_method Name - #pc_args (List Code)})) + [#pc_method Name + #pc_args (List Code)])) (type: ImportMethodKind (Variant @@ -290,31 +290,32 @@ (type: ImportMethodCommons (Record - {#import_member_mode Primitive_Mode + [#import_member_mode Primitive_Mode #import_member_alias Text #import_member_kind ImportMethodKind #import_member_tvars (List (Type Var)) #import_member_args (List [Bit (Type Value)]) #import_member_maybe? Bit #import_member_try? Bit - #import_member_io? Bit})) + #import_member_io? Bit])) (type: ImportConstructorDecl - (Record{})) + (Record + [])) (type: ImportMethodDecl (Record - {#import_method_name Text - #import_method_return (Type Return)})) + [#import_method_name Text + #import_method_return (Type Return)])) (type: ImportFieldDecl (Record - {#import_field_mode Primitive_Mode + [#import_field_mode Primitive_Mode #import_field_name Text #import_field_static? Bit #import_field_maybe? Bit #import_field_setter? Bit - #import_field_type (Type Value)})) + #import_field_type (Type Value)])) (type: Import_Member_Declaration (Variant @@ -739,10 +740,10 @@ inputs (.tuple (<>.some (..type^ total_vars))) output (..return^ total_vars) exs (..throws_decl^ total_vars)] - (in [[name #PublicP anns] {#method_tvars tvars + (in [[name #PublicP anns] [#method_tvars tvars #method_inputs inputs #method_output output - #method_exs exs}])))) + #method_exs exs]])))) (def: state_modifier^ (Parser State) @@ -800,9 +801,9 @@ exs (throws_decl^ total_vars) annotations ..annotations^ body .any] - (in [{#member_name constructor_method_name + (in [[#member_name constructor_method_name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#ConstructorMethod strict_fp? method_vars self_name arguments constructor_args body exs)])))) (def: (virtual_method_def^ class_vars) @@ -821,9 +822,9 @@ exs (throws_decl^ total_vars) annotations ..annotations^ body .any] - (in [{#member_name name + (in [[#member_name name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#VirtualMethod final? strict_fp? method_vars self_name arguments return_type body exs)])))) (def: overriden_method_def^ @@ -842,9 +843,9 @@ exs (throws_decl^ total_vars) annotations ..annotations^ body .any] - (in [{#member_name name + (in [[#member_name name #member_privacy #PublicP - #member_anns annotations} + #member_anns annotations] (#OverridenMethod strict_fp? owner_class method_vars self_name arguments return_type body exs)])))) (def: static_method_def^ @@ -861,9 +862,9 @@ exs (throws_decl^ total_vars) annotations ..annotations^ body .any] - (in [{#member_name name + (in [[#member_name name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#StaticMethod strict_fp? method_vars arguments return_type body exs)])))) (def: abstract_method_def^ @@ -878,9 +879,9 @@ return_type (..return^ total_vars) exs (throws_decl^ total_vars) annotations ..annotations^] - (in [{#member_name name + (in [[#member_name name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#AbstractMethod method_vars arguments return_type exs)])))) (def: native_method_def^ @@ -895,9 +896,9 @@ return_type (..return^ total_vars) exs (throws_decl^ total_vars) annotations ..annotations^] - (in [{#member_name name + (in [[#member_name name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#NativeMethod method_vars arguments return_type exs)])))) (def: (method_def^ class_vars) @@ -952,15 +953,15 @@ ?prim_mode (<>.maybe primitive_mode^) args (..import_member_args^ total_vars) [io? try? maybe?] import_member_return_flags^] - (in (#ConstructorDecl [{#import_member_mode (maybe.else #AutoPrM ?prim_mode) + (in (#ConstructorDecl [[#import_member_mode (maybe.else #AutoPrM ?prim_mode) #import_member_alias (maybe.else "new" ?alias) #import_member_kind #VirtualIMK #import_member_tvars tvars #import_member_args args #import_member_maybe? maybe? #import_member_try? try? - #import_member_io? io?} - {}])) + #import_member_io? io?] + []])) )) (.form (do <>.monad [kind (: (Parser ImportMethodKind) @@ -974,16 +975,16 @@ args (..import_member_args^ total_vars) [io? try? maybe?] import_member_return_flags^ return (..return^ total_vars)] - (in (#MethodDecl [{#import_member_mode (maybe.else #AutoPrM ?prim_mode) + (in (#MethodDecl [[#import_member_mode (maybe.else #AutoPrM ?prim_mode) #import_member_alias (maybe.else name ?alias) #import_member_kind kind #import_member_tvars tvars #import_member_args args #import_member_maybe? maybe? #import_member_try? try? - #import_member_io? io?} - {#import_method_name name - #import_method_return return}])))) + #import_member_io? io?] + [#import_method_name name + #import_method_return return]])))) (.form (do <>.monad [static? (<>.parses? (.this! (' "static"))) name .local_identifier @@ -991,12 +992,12 @@ gtype (..type^ owner_vars) maybe? (<>.parses? (.this! (' "?"))) setter? (<>.parses? (.this! (' #!)))] - (in (#FieldAccessDecl {#import_field_mode (maybe.else #AutoPrM ?prim_mode) + (in (#FieldAccessDecl [#import_field_mode (maybe.else #AutoPrM ?prim_mode) #import_field_name name #import_field_static? static? #import_field_maybe? maybe? #import_field_setter? setter? - #import_field_type gtype})))) + #import_field_type gtype])))) )) (def: bundle diff --git a/stdlib/source/library/lux/ffi.lua.lux b/stdlib/source/library/lux/ffi.lua.lux index b14c2ebe3..60e8a8d48 100644 --- a/stdlib/source/library/lux/ffi.lua.lux +++ b/stdlib/source/library/lux/ffi.lua.lux @@ -81,12 +81,12 @@ (type: Common_Method (Record - {#name Text + [#name Text #alias (Maybe Text) #inputs (List Nilable) #io? Bit #try? Bit - #output Nilable})) + #output Nilable])) (type: Static_Method Common_Method) (type: Virtual_Method Common_Method) diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux index 9140ddab8..2512530d4 100644 --- a/stdlib/source/library/lux/ffi.old.lux +++ b/stdlib/source/library/lux/ffi.old.lux @@ -118,8 +118,8 @@ (type: Class_Declaration (Record - {#class_name Text - #class_params (List Type_Parameter)})) + [#class_name Text + #class_params (List Type_Parameter)])) (type: StackFrame (primitive "java/lang/StackTraceElement")) @@ -129,22 +129,22 @@ (type: Super_Class_Decl (Record - {#super_class_name Text - #super_class_params (List GenericType)})) + [#super_class_name Text + #super_class_params (List GenericType)])) (type: AnnotationParam [Text Code]) (type: Annotation (Record - {#ann_name Text - #ann_params (List AnnotationParam)})) + [#ann_name Text + #ann_params (List AnnotationParam)])) (type: Member_Declaration (Record - {#member_name Text + [#member_name Text #member_privacy Privacy - #member_anns (List Annotation)})) + #member_anns (List Annotation)])) (type: FieldDecl (Variant @@ -153,15 +153,15 @@ (type: MethodDecl (Record - {#method_tvars (List Type_Parameter) + [#method_tvars (List Type_Parameter) #method_inputs (List GenericType) #method_output GenericType - #method_exs (List GenericType)})) + #method_exs (List GenericType)])) (type: ArgDecl (Record - {#arg_name Text - #arg_type GenericType})) + [#arg_name Text + #arg_type GenericType])) (type: ConstructorArg [GenericType Code]) @@ -207,8 +207,8 @@ (type: Partial_Call (Record - {#pc_method Name - #pc_args (List Code)})) + [#pc_method Name + #pc_args (List Code)])) (type: ImportMethodKind (Variant @@ -217,32 +217,32 @@ (type: ImportMethodCommons (Record - {#import_member_mode Primitive_Mode + [#import_member_mode Primitive_Mode #import_member_alias Text #import_member_kind ImportMethodKind #import_member_tvars (List Type_Parameter) #import_member_args (List [Bit GenericType]) #import_member_maybe? Bit #import_member_try? Bit - #import_member_io? Bit})) + #import_member_io? Bit])) (type: ImportConstructorDecl (Record - {})) + [])) (type: ImportMethodDecl (Record - {#import_method_name Text - #import_method_return GenericType})) + [#import_method_name Text + #import_method_return GenericType])) (type: ImportFieldDecl (Record - {#import_field_mode Primitive_Mode + [#import_field_mode Primitive_Mode #import_field_name Text #import_field_static? Bit #import_field_maybe? Bit #import_field_setter? Bit - #import_field_type GenericType})) + #import_field_type GenericType])) (type: Import_Member_Declaration (Variant @@ -686,10 +686,10 @@ inputs (.tuple (<>.some (..generic_type^ type_vars))) output (..generic_type^ type_vars) exs (..throws_decl^ type_vars)] - (in [[name #PublicP anns] {#method_tvars tvars + (in [[name #PublicP anns] [#method_tvars tvars #method_inputs inputs #method_output output - #method_exs exs}])))) + #method_exs exs]])))) (def: state_modifier^ (Parser State) @@ -745,9 +745,9 @@ exs (..throws_decl^ total_vars) annotations ..annotations^ body .any] - (in [{#member_name constructor_method_name + (in [[#member_name constructor_method_name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#ConstructorMethod strict_fp? method_vars arg_decls constructor_args body exs)])))) (def: (virtual_method_def^ class_vars) @@ -766,9 +766,9 @@ exs (..throws_decl^ total_vars) annotations ..annotations^ body .any] - (in [{#member_name name + (in [[#member_name name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#VirtualMethod final? strict_fp? method_vars this_name arg_decls return_type @@ -789,9 +789,9 @@ exs (..throws_decl^ total_vars) annotations ..annotations^ body .any] - (in [{#member_name name + (in [[#member_name name #member_privacy #PublicP - #member_anns annotations} + #member_anns annotations] (#OverridenMethod strict_fp? owner_class method_vars this_name arg_decls return_type @@ -811,9 +811,9 @@ exs (..throws_decl^ total_vars) annotations ..annotations^ body .any] - (in [{#member_name name + (in [[#member_name name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#StaticMethod strict_fp? method_vars arg_decls return_type body exs)])))) (def: abstract_method_def^ @@ -828,9 +828,9 @@ return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) annotations ..annotations^] - (in [{#member_name name + (in [[#member_name name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#AbstractMethod method_vars arg_decls return_type exs)])))) (def: native_method_def^ @@ -845,9 +845,9 @@ return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) annotations ..annotations^] - (in [{#member_name name + (in [[#member_name name #member_privacy pm - #member_anns annotations} + #member_anns annotations] (#NativeMethod method_vars arg_decls return_type exs)])))) (def: (method_def^ class_vars) @@ -898,16 +898,15 @@ ?prim_mode (<>.maybe primitive_mode^) args (..import_member_args^ total_vars) [io? try? maybe?] import_member_return_flags^] - (in (#ConstructorDecl [{#import_member_mode (maybe.else #AutoPrM ?prim_mode) + (in (#ConstructorDecl [[#import_member_mode (maybe.else #AutoPrM ?prim_mode) #import_member_alias (maybe.else "new" ?alias) #import_member_kind #VirtualIMK #import_member_tvars tvars #import_member_args args #import_member_maybe? maybe? #import_member_try? try? - #import_member_io? io?} - {}])) - )) + #import_member_io? io?] + []])))) (.form (do <>.monad [kind (: (Parser ImportMethodKind) (<>.or (.this! (' "static")) @@ -920,17 +919,16 @@ args (..import_member_args^ total_vars) [io? try? maybe?] import_member_return_flags^ return (..generic_type^ total_vars)] - (in (#MethodDecl [{#import_member_mode (maybe.else #AutoPrM ?prim_mode) + (in (#MethodDecl [[#import_member_mode (maybe.else #AutoPrM ?prim_mode) #import_member_alias (maybe.else name ?alias) #import_member_kind kind #import_member_tvars tvars #import_member_args args #import_member_maybe? maybe? #import_member_try? try? - #import_member_io? io?} - {#import_method_name name - #import_method_return return - }])))) + #import_member_io? io?] + [#import_method_name name + #import_method_return return]])))) (.form (do <>.monad [static? (<>.parses? (.this! (' "static"))) name .local_identifier @@ -938,12 +936,12 @@ gtype (..generic_type^ owner_vars) maybe? (<>.parses? (.this! (' "?"))) setter? (<>.parses? (.this! (' #!)))] - (in (#FieldAccessDecl {#import_field_mode (maybe.else #AutoPrM ?prim_mode) + (in (#FieldAccessDecl [#import_field_mode (maybe.else #AutoPrM ?prim_mode) #import_field_name name #import_field_static? static? #import_field_maybe? maybe? #import_field_setter? setter? - #import_field_type gtype})))) + #import_field_type gtype])))) )) (def: bundle @@ -1177,8 +1175,8 @@ ... [Syntax] (def: object_super_class Super_Class_Decl - {#super_class_name "java/lang/Object" - #super_class_params (list)}) + [#super_class_name "java/lang/Object" + #super_class_params (list)]) (syntax: .public (class: [im inheritance_modifier^ class_decl ..class_decl^ diff --git a/stdlib/source/library/lux/ffi.php.lux b/stdlib/source/library/lux/ffi.php.lux index 7320bb059..2cc3fb56f 100644 --- a/stdlib/source/library/lux/ffi.php.lux +++ b/stdlib/source/library/lux/ffi.php.lux @@ -87,12 +87,12 @@ (type: Common_Method (Record - {#name Text + [#name Text #alias (Maybe Alias) #inputs (List Nullable) #io? Bit #try? Bit - #output Nullable})) + #output Nullable])) (type: Static_Method Common_Method) (type: Virtual_Method Common_Method) diff --git a/stdlib/source/library/lux/ffi.py.lux b/stdlib/source/library/lux/ffi.py.lux index b49d7ddf4..3c47972ed 100644 --- a/stdlib/source/library/lux/ffi.py.lux +++ b/stdlib/source/library/lux/ffi.py.lux @@ -82,12 +82,12 @@ (type: Common_Method (Record - {#name Text + [#name Text #alias (Maybe Text) #inputs (List Noneable) #io? Bit #try? Bit - #output Noneable})) + #output Noneable])) (type: Static_Method Common_Method) (type: Virtual_Method Common_Method) diff --git a/stdlib/source/library/lux/ffi.rb.lux b/stdlib/source/library/lux/ffi.rb.lux index e9a5869af..485fd904c 100644 --- a/stdlib/source/library/lux/ffi.rb.lux +++ b/stdlib/source/library/lux/ffi.rb.lux @@ -89,12 +89,12 @@ (type: Common_Method (Record - {#name Text + [#name Text #alias (Maybe Alias) #inputs (List Nilable) #io? Bit #try? Bit - #output Nilable})) + #output Nilable])) (type: Static_Method Common_Method) (type: Virtual_Method Common_Method) diff --git a/stdlib/source/library/lux/ffi.scm.lux b/stdlib/source/library/lux/ffi.scm.lux index fb270b39c..01717e47b 100644 --- a/stdlib/source/library/lux/ffi.scm.lux +++ b/stdlib/source/library/lux/ffi.scm.lux @@ -87,12 +87,12 @@ (type: Common_Method (Record - {#name Text + [#name Text #alias (Maybe Alias) #inputs (List Nilable) #io? Bit #try? Bit - #output Nilable})) + #output Nilable])) (def: common_method (Parser Common_Method) diff --git a/stdlib/source/library/lux/locale/language.lux b/stdlib/source/library/lux/locale/language.lux index cb4314c59..117fc5a73 100644 --- a/stdlib/source/library/lux/locale/language.lux +++ b/stdlib/source/library/lux/locale/language.lux @@ -16,8 +16,8 @@ {} (Record - {#name Text - #code Text}) + [#name Text + #code Text]) (template [ ] [(def: .public @@ -33,8 +33,8 @@ (template [ +] [(def: .public Language - (:abstraction {#name - #code })) + (:abstraction [#name + #code ])) (`` (template [] [(def: .public Language diff --git a/stdlib/source/library/lux/locale/territory.lux b/stdlib/source/library/lux/locale/territory.lux index 4b2dfd4b5..ae762a0fa 100644 --- a/stdlib/source/library/lux/locale/territory.lux +++ b/stdlib/source/library/lux/locale/territory.lux @@ -16,10 +16,10 @@ {} (Record - {#name Text + [#name Text #short Text #long Text - #code Nat}) + #code Nat]) (template [ ] [(def: .public @@ -36,10 +36,10 @@ (template [
+] [(def: .public
Territory - (:abstraction {#name + (:abstraction [#name #short #long - #code })) + #code ])) (`` (template [] [(def: .public Territory
)] diff --git a/stdlib/source/library/lux/macro/syntax/check.lux b/stdlib/source/library/lux/macro/syntax/check.lux index 18b0049ee..d6eb8215e 100644 --- a/stdlib/source/library/lux/macro/syntax/check.lux +++ b/stdlib/source/library/lux/macro/syntax/check.lux @@ -19,8 +19,8 @@ (type: .public Check (Record - {#type Code - #value Code})) + [#type Code + #value Code])) (def: .public equivalence (Equivalence Check) diff --git a/stdlib/source/library/lux/macro/syntax/declaration.lux b/stdlib/source/library/lux/macro/syntax/declaration.lux index ae6ae3ee7..8713b35fc 100644 --- a/stdlib/source/library/lux/macro/syntax/declaration.lux +++ b/stdlib/source/library/lux/macro/syntax/declaration.lux @@ -16,8 +16,8 @@ (type: .public Declaration (Record - {#name Text - #arguments (List Text)})) + [#name Text + #arguments (List Text)])) (def: .public equivalence (Equivalence Declaration) diff --git a/stdlib/source/library/lux/macro/syntax/definition.lux b/stdlib/source/library/lux/macro/syntax/definition.lux index ee7238603..7b87eeba7 100644 --- a/stdlib/source/library/lux/macro/syntax/definition.lux +++ b/stdlib/source/library/lux/macro/syntax/definition.lux @@ -27,11 +27,11 @@ (type: .public Definition (Record - {#name Text + [#name Text #value (Either Check Code) #anns Annotations - #export? Bit})) + #export? Bit])) (def: .public equivalence (Equivalence Definition) @@ -66,9 +66,9 @@ (def: dummy Code - (` {#.module (~ (code.text (value@ #.module location.dummy))) + (` [#.module (~ (code.text (value@ #.module location.dummy))) #.line (~ (code.nat (value@ #.line location.dummy))) - #.column (~ (code.nat (value@ #.column location.dummy)))})) + #.column (~ (code.nat (value@ #.column location.dummy)))])) (def: .public (format (^slots [#name #value #anns #export?])) (-> Definition Code) diff --git a/stdlib/source/library/lux/macro/syntax/input.lux b/stdlib/source/library/lux/macro/syntax/input.lux index 47bf4d6ac..c0f7066c6 100644 --- a/stdlib/source/library/lux/macro/syntax/input.lux +++ b/stdlib/source/library/lux/macro/syntax/input.lux @@ -13,8 +13,8 @@ (type: .public Input (Record - {#binding Code - #type Code})) + [#binding Code + #type Code])) (def: .public equivalence (Equivalence Input) diff --git a/stdlib/source/library/lux/macro/template.lux b/stdlib/source/library/lux/macro/template.lux index 3c18f9f9e..256302d3c 100644 --- a/stdlib/source/library/lux/macro/template.lux +++ b/stdlib/source/library/lux/macro/template.lux @@ -129,9 +129,9 @@ (type: Local (Record - {#name Text + [#name Text #parameters (List Text) - #template (List Code)})) + #template (List Code)])) (exception: .public (irregular_arguments {expected Nat} {actual Nat}) (exception.report @@ -157,9 +157,9 @@ [[name parameters] (.form (<>.and .local_identifier (<>.many .local_identifier))) template (.tuple (<>.some .any))] - (in {#name name + (in [#name name #parameters parameters - #template template}))) + #template template]))) (syntax: .public (let [locals (.tuple (<>.some ..local)) body .any]) diff --git a/stdlib/source/library/lux/math/modular.lux b/stdlib/source/library/lux/math/modular.lux index 5b462ccfd..35f92dc13 100644 --- a/stdlib/source/library/lux/math/modular.lux +++ b/stdlib/source/library/lux/math/modular.lux @@ -31,13 +31,13 @@ {} (Record - {#modulus (Modulus m) - #value Int}) + [#modulus (Modulus m) + #value Int]) (def: .public (modular modulus value) (All (_ %) (-> (Modulus %) Int (Mod %))) - (:abstraction {#modulus modulus - #value (i.mod (//.divisor modulus) value)})) + (:abstraction [#modulus modulus + #value (i.mod (//.divisor modulus) value)])) (template [ ] [(def: .public @@ -110,10 +110,10 @@ (All (_ %) (-> (Mod %) (Mod %) (Mod %))) (let [[modulus param] (:representation param) [_ subject] (:representation subject)] - (:abstraction {#modulus modulus + (:abstraction [#modulus modulus #value (|> subject ( param) - (i.mod (//.divisor modulus)))})))] + (i.mod (//.divisor modulus)))])))] [+ i.+] [- i.-] diff --git a/stdlib/source/library/lux/math/number/complex.lux b/stdlib/source/library/lux/math/number/complex.lux index 6687bd043..8d040123a 100644 --- a/stdlib/source/library/lux/math/number/complex.lux +++ b/stdlib/source/library/lux/math/number/complex.lux @@ -24,13 +24,13 @@ (type: .public Complex (Record - {#real Frac - #imaginary Frac})) + [#real Frac + #imaginary Frac])) (syntax: .public (complex [real .any ?imaginary (<>.maybe .any)]) - (in (list (` {#..real (~ real) - #..imaginary (~ (maybe.else (' +0.0) ?imaginary))})))) + (in (list (` [#..real (~ real) + #..imaginary (~ (maybe.else (' +0.0) ?imaginary))])))) (def: .public i (..complex +0.0 +1.0)) @@ -59,10 +59,10 @@ (template [ ] [(def: .public ( param input) (-> Complex Complex Complex) - {#real ( (value@ #real param) + [#real ( (value@ #real param) (value@ #real input)) #imaginary ( (value@ #imaginary param) - (value@ #imaginary input))})] + (value@ #imaginary input))])] [+ f.+] [- f.-] @@ -89,21 +89,21 @@ (def: .public (*' param input) (-> Frac Complex Complex) - {#real (f.* param + [#real (f.* param (value@ #real input)) #imaginary (f.* param - (value@ #imaginary input))}) + (value@ #imaginary input))]) (def: .public (* param input) (-> Complex Complex Complex) - {#real (f.- (f.* (value@ #imaginary param) + [#real (f.- (f.* (value@ #imaginary param) (value@ #imaginary input)) (f.* (value@ #real param) (value@ #real input))) #imaginary (f.+ (f.* (value@ #real param) (value@ #imaginary input)) (f.* (value@ #imaginary param) - (value@ #real input)))}) + (value@ #real input)))]) (def: .public (/ param input) (-> Complex Complex Complex) @@ -112,18 +112,18 @@ (f.abs real)) (let [quot (f./ imaginary real) denom (|> real (f.* quot) (f.+ imaginary))] - {#real (|> (value@ #real input) (f.* quot) (f.+ (value@ #imaginary input)) (f./ denom)) - #imaginary (|> (value@ #imaginary input) (f.* quot) (f.- (value@ #real input)) (f./ denom))}) + [#real (|> (value@ #real input) (f.* quot) (f.+ (value@ #imaginary input)) (f./ denom)) + #imaginary (|> (value@ #imaginary input) (f.* quot) (f.- (value@ #real input)) (f./ denom))]) (let [quot (f./ real imaginary) denom (|> imaginary (f.* quot) (f.+ real))] - {#real (|> (value@ #imaginary input) (f.* quot) (f.+ (value@ #real input)) (f./ denom)) - #imaginary (|> (value@ #imaginary input) (f.- (f.* quot (value@ #real input))) (f./ denom))})))) + [#real (|> (value@ #imaginary input) (f.* quot) (f.+ (value@ #real input)) (f./ denom)) + #imaginary (|> (value@ #imaginary input) (f.- (f.* quot (value@ #real input))) (f./ denom))])))) (def: .public (/' param subject) (-> Frac Complex Complex) (let [(^slots [#real #imaginary]) subject] - {#real (f./ param real) - #imaginary (f./ param imaginary)})) + [#real (f./ param real) + #imaginary (f./ param imaginary)])) (def: .public (% param input) (-> Complex Complex Complex) @@ -137,34 +137,34 @@ (def: .public (cos subject) (-> Complex Complex) (let [(^slots [#real #imaginary]) subject] - {#real (f.* (math.cosh imaginary) + [#real (f.* (math.cosh imaginary) (math.cos real)) #imaginary (f.opposite (f.* (math.sinh imaginary) - (math.sin real)))})) + (math.sin real)))])) (def: .public (cosh subject) (-> Complex Complex) (let [(^slots [#real #imaginary]) subject] - {#real (f.* (math.cos imaginary) + [#real (f.* (math.cos imaginary) (math.cosh real)) #imaginary (f.* (math.sin imaginary) - (math.sinh real))})) + (math.sinh real))])) (def: .public (sin subject) (-> Complex Complex) (let [(^slots [#real #imaginary]) subject] - {#real (f.* (math.cosh imaginary) + [#real (f.* (math.cosh imaginary) (math.sin real)) #imaginary (f.* (math.sinh imaginary) - (math.cos real))})) + (math.cos real))])) (def: .public (sinh subject) (-> Complex Complex) (let [(^slots [#real #imaginary]) subject] - {#real (f.* (math.cos imaginary) + [#real (f.* (math.cos imaginary) (math.sinh real)) #imaginary (f.* (math.sin imaginary) - (math.cosh real))})) + (math.cosh real))])) (def: .public (tan subject) (-> Complex Complex) @@ -172,8 +172,8 @@ r2 (f.* +2.0 real) i2 (f.* +2.0 imaginary) d (f.+ (math.cos r2) (math.cosh i2))] - {#real (f./ d (math.sin r2)) - #imaginary (f./ d (math.sinh i2))})) + [#real (f./ d (math.sin r2)) + #imaginary (f./ d (math.sinh i2))])) (def: .public (tanh subject) (-> Complex Complex) @@ -181,8 +181,8 @@ r2 (f.* +2.0 real) i2 (f.* +2.0 imaginary) d (f.+ (math.cosh r2) (math.cos i2))] - {#real (f./ d (math.sinh r2)) - #imaginary (f./ d (math.sin i2))})) + [#real (f./ d (math.sinh r2)) + #imaginary (f./ d (math.sin i2))])) (def: .public (abs subject) (-> Complex Frac) @@ -204,14 +204,14 @@ (-> Complex Complex) (let [(^slots [#real #imaginary]) subject r_exp (math.exp real)] - {#real (f.* r_exp (math.cos imaginary)) - #imaginary (f.* r_exp (math.sin imaginary))})) + [#real (f.* r_exp (math.cos imaginary)) + #imaginary (f.* r_exp (math.sin imaginary))])) (def: .public (log subject) (-> Complex Complex) (let [(^slots [#real #imaginary]) subject] - {#real (|> subject ..abs math.log) - #imaginary (math.atan/2 real imaginary)})) + [#real (|> subject ..abs math.log) + #imaginary (math.atan/2 real imaginary)])) (template [ ] [(def: .public ( param input) @@ -231,12 +231,12 @@ (let [(^slots [#real #imaginary]) input t (|> input ..abs (f.+ (f.abs real)) (f./ +2.0) (math.pow +0.5))] (if (f.< +0.0 real) - {#real (f./ (f.* +2.0 t) + [#real (f./ (f.* +2.0 t) (f.abs imaginary)) - #imaginary (f.* t (..with_sign imaginary +1.0))} - {#real t + #imaginary (f.* t (..with_sign imaginary +1.0))] + [#real t #imaginary (f./ (f.* +2.0 t) - imaginary)}))) + imaginary)]))) (def: (root/2-1z input) (-> Complex Complex) @@ -249,13 +249,13 @@ (let [q (f./ imaginary real) scale (f./ (|> real (f.* q) (f.+ imaginary)) +1.0)] - {#real (f.* q scale) - #imaginary (f.opposite scale)}) + [#real (f.* q scale) + #imaginary (f.opposite scale)]) (let [q (f./ real imaginary) scale (f./ (|> imaginary (f.* q) (f.+ real)) +1.0)] - {#real scale - #imaginary (|> scale f.opposite (f.* q))}))) + [#real scale + #imaginary (|> scale f.opposite (f.* q))]))) (def: .public (acos input) (-> Complex Complex) @@ -301,8 +301,8 @@ (math.cos inner)) imaginary (f.* nth_root_of_abs (math.sin inner))] - {#real real - #imaginary imaginary}))))))) + [#real real + #imaginary imaginary]))))))) (def: .public (approximately? margin_of_error standard value) (-> Frac Complex Complex Bit) diff --git a/stdlib/source/library/lux/math/number/frac.lux b/stdlib/source/library/lux/math/number/frac.lux index 4f510366c..5880650e3 100644 --- a/stdlib/source/library/lux/math/number/frac.lux +++ b/stdlib/source/library/lux/math/number/frac.lux @@ -200,7 +200,7 @@ ("lux text concat" "+" ("lux f64 encode" x))))) (def: (decoded input) - (case ("lux f64 decode" [input]) + (case ("lux f64 decode" input) (#.Some value) (#try.Success value) diff --git a/stdlib/source/library/lux/math/number/ratio.lux b/stdlib/source/library/lux/math/number/ratio.lux index 6be8bce44..52f826ae8 100644 --- a/stdlib/source/library/lux/math/number/ratio.lux +++ b/stdlib/source/library/lux/math/number/ratio.lux @@ -24,8 +24,8 @@ (type: .public Ratio (Record - {#numerator Nat - #denominator Nat})) + [#numerator Nat + #denominator Nat])) (def: .public (nat value) (-> Ratio (Maybe Nat)) @@ -36,13 +36,13 @@ (def: (normal (^slots [#numerator #denominator])) (-> Ratio Ratio) (let [common (n.gcd numerator denominator)] - {#numerator (n./ common numerator) - #denominator (n./ common denominator)})) + [#numerator (n./ common numerator) + #denominator (n./ common denominator)])) (syntax: .public (ratio [numerator .any ?denominator (<>.maybe .any)]) - (in (list (` ((~! ..normal) {#..numerator (~ numerator) - #..denominator (~ (maybe.else (' 1) ?denominator))}))))) + (in (list (` ((~! ..normal) [#..numerator (~ numerator) + #..denominator (~ (maybe.else (' 1) ?denominator))]))))) (def: .public (= parameter subject) (-> Ratio Ratio Bit) @@ -123,8 +123,8 @@ (def: .public (reciprocal (^slots [#numerator #denominator])) (-> Ratio Ratio) - {#numerator denominator - #denominator numerator}) + [#numerator denominator + #denominator numerator]) (def: separator ":") @@ -140,8 +140,8 @@ (do try.monad [numerator (n\decoded num) denominator (n\decoded denom)] - (in (normal {#numerator numerator - #denominator denominator}))) + (in (normal [#numerator numerator + #denominator denominator]))) #.None (#.Left (text\composite "Invalid syntax for ratio: " input))))) diff --git a/stdlib/source/library/lux/meta.lux b/stdlib/source/library/lux/meta.lux index 3cc8deedf..87ffc64be 100644 --- a/stdlib/source/library/lux/meta.lux +++ b/stdlib/source/library/lux/meta.lux @@ -1,6 +1,6 @@ (.module: [library - [lux (#- type macro) + [lux (#- type macro try) [abstract [functor (#+ Functor)] [apply (#+ Apply)] @@ -548,24 +548,27 @@ (|>> (value@ #.imports) (list.any? (text\= import))) ..current_module)) -(def: .public (tag tag_name) - (-> Name (Meta [Nat (List Name) Type])) - (do ..monad - [.let [[module name] tag_name] - =module (..module module) - this_module_name ..current_module_name - imported! (..imported? module)] - (case (plist.value (text\composite "#" name) (value@ #.definitions =module)) - (^or (#.Some (#.Label [exported? type group idx])) - (#.Some (#.Slot [exported? type group idx]))) - (if (or (text\= this_module_name module) - (and imported! exported?)) - (in [idx (list\each (|>> [module]) group) type]) - (..failure ($_ text\composite "Cannot access tag: " (name\encoded tag_name) " from module " this_module_name))) - - _ - (..failure ($_ text\composite - "Unknown tag: " (name\encoded tag_name)))))) +(template [ ] + [(def: .public ( tag_name) + (-> Name (Meta [Nat (List Name) Type])) + (do ..monad + [.let [[module name] tag_name] + =module (..module module) + this_module_name ..current_module_name] + (case (plist.value (text\composite "#" name) (value@ #.definitions =module)) + (#.Some ( [exported? type group idx])) + (if (or (text\= this_module_name module) + exported?) + (in [idx (list\each (|>> [module]) group) type]) + (..failure ($_ text\composite "Cannot access " ": " (name\encoded tag_name) " from module " this_module_name))) + + _ + (..failure ($_ text\composite + "Unknown " ": " (name\encoded tag_name))))))] + + [tag #.Label "tag"] + [slot #.Slot "slot"] + ) (def: .public (tag_lists module) (-> Text (Meta (List [(List Name) Type]))) @@ -650,3 +653,13 @@ [eval (\ ! each (value@ #.eval) ..compiler_state)] (eval type code))) + +(def: .public (try computation) + (All (_ it) (-> (Meta it) (Meta (Try it)))) + (function (_ lux) + (case (computation lux) + (#try.Success [lux' output]) + (#try.Success [lux' (#try.Success output)]) + + (#try.Failure error) + (#try.Success [lux (#try.Failure error)])))) diff --git a/stdlib/source/library/lux/meta/location.lux b/stdlib/source/library/lux/meta/location.lux index f8d3a9023..7282e9c1b 100644 --- a/stdlib/source/library/lux/meta/location.lux +++ b/stdlib/source/library/lux/meta/location.lux @@ -14,9 +14,9 @@ (def: .public dummy Location - {#.module "" + [#.module "" #.line 0 - #.column 0}) + #.column 0]) (macro: .public (here tokens compiler) (case tokens diff --git a/stdlib/source/library/lux/target/common_lisp.lux b/stdlib/source/library/lux/target/common_lisp.lux index 5a5b10a06..9714e7743 100644 --- a/stdlib/source/library/lux/target/common_lisp.lux +++ b/stdlib/source/library/lux/target/common_lisp.lux @@ -61,8 +61,8 @@ (type: .public Lambda (Record - {#input Var/* - #output (Expression Any)})) + [#input Var/* + #output (Expression Any)])) (def: .public nil Literal @@ -387,9 +387,9 @@ (type: .public Handler (Record - {#condition_type (Expression Any) + [#condition_type (Expression Any) #condition Var/1 - #body (Expression Any)})) + #body (Expression Any)])) (def: .public (handler_case handlers body) (-> (List Handler) (Expression Any) (Computation Any)) diff --git a/stdlib/source/library/lux/target/jvm/attribute.lux b/stdlib/source/library/lux/target/jvm/attribute.lux index 4d79cfb86..45758f54f 100644 --- a/stdlib/source/library/lux/target/jvm/attribute.lux +++ b/stdlib/source/library/lux/target/jvm/attribute.lux @@ -27,9 +27,9 @@ (type: .public (Info about) (Record - {#name (Index UTF8) + [#name (Index UTF8) #length U4 - #info about})) + #info about])) (def: .public (info_equivalence Equivalence) (All (_ about) @@ -89,9 +89,9 @@ ... TODO: Inline ASAP (def: (constant' @name index) (-> (Index UTF8) (Constant Any) Attribute) - (#Constant {#name @name + (#Constant [#name @name #length (|> /constant.length //unsigned.u4 try.trusted) - #info index})) + #info index])) (def: .public (constant index) (-> (Constant Any) (Resource Attribute)) @@ -102,13 +102,13 @@ ... TODO: Inline ASAP (def: (code' @name specification) (-> (Index UTF8) Code Attribute) - (#Code {#name @name + (#Code [#name @name ... https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3 #length (|> specification (/code.length ..length) //unsigned.u4 try.trusted) - #info specification})) + #info specification])) (def: .public (code specification) (-> Code (Resource Attribute)) diff --git a/stdlib/source/library/lux/target/jvm/attribute/code.lux b/stdlib/source/library/lux/target/jvm/attribute/code.lux index a36208054..207ddf022 100644 --- a/stdlib/source/library/lux/target/jvm/attribute/code.lux +++ b/stdlib/source/library/lux/target/jvm/attribute/code.lux @@ -24,10 +24,10 @@ (type: .public (Code Attribute) (Record - {#limit Limit + [#limit Limit #code Binary #exception_table (Row Exception) - #attributes (Row Attribute)})) + #attributes (Row Attribute)])) (def: .public (length length code) (All (_ Attribute) (-> (-> Attribute Nat) (Code Attribute) Nat)) diff --git a/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux b/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux index a2a4f45c1..6bdf8dfff 100644 --- a/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux +++ b/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux @@ -21,10 +21,10 @@ (type: .public Exception (Record - {#start Address + [#start Address #end Address #handler Address - #catch (Index Class)})) + #catch (Index Class)])) (def: .public equivalence (Equivalence Exception) diff --git a/stdlib/source/library/lux/target/jvm/bytecode.lux b/stdlib/source/library/lux/target/jvm/bytecode.lux index e3c1fc9db..0cb111e13 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode.lux @@ -59,15 +59,15 @@ (type: .public Tracker (Record - {#program_counter Address + [#program_counter Address #next Label - #known Resolver})) + #known Resolver])) (def: fresh Tracker - {#program_counter /address.start + [#program_counter /address.start #next 0 - #known (dictionary.empty n.hash)}) + #known (dictionary.empty n.hash)]) (type: .public Relative (-> Resolver (Try [(Row Exception) Instruction]))) @@ -976,8 +976,8 @@ (do ..monad [index (<| ..lifted ( (..reflection class)) - {#//constant/pool.name method - #//constant/pool.descriptor (type.descriptor type)}) + [#//constant/pool.name method + #//constant/pool.descriptor (type.descriptor type)]) .let [consumption (|> inputs (list\each ..type_size) (list\mix n.+ (if 0 1)) @@ -1001,8 +1001,8 @@ (do ..monad [index (<| ..lifted (//constant/pool.field (..reflection class)) - {#//constant/pool.name field - #//constant/pool.descriptor (type.descriptor type)})] + [#//constant/pool.name field + #//constant/pool.descriptor (type.descriptor type)])] (if (or (same? type.long type) (same? type.double type)) (..bytecode $2 @_ <2> [index]) @@ -1036,10 +1036,10 @@ (in []) (exception.except ..invalid_range_for_try [@start @end])) [_ @handler] (..resolve_label @handler resolver)] - (in [(row.row {#//exception.start @start + (in [(row.row [#//exception.start @start #//exception.end @end #//exception.handler @handler - #//exception.catch @catch}) + #//exception.catch @catch]) _.empty]))) []]])))) diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux index ff778621c..2bf2c5c31 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux @@ -19,16 +19,16 @@ (type: .public Environment (Record - {#limit Limit - #stack (Maybe Stack)})) + [#limit Limit + #stack (Maybe Stack)])) (template [ ] [(def: .public ( type) (-> (Type Method) (Try Environment)) (do try.monad [limit ( type)] - (in {#limit limit - #stack (#.Some /stack.empty)})))] + (in [#limit limit + #stack (#.Some /stack.empty)])))] [static /limit.static] [virtual /limit.virtual] diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux index 515728d71..4ab466ae4 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux @@ -22,16 +22,16 @@ (type: .public Limit (Record - {#stack Stack - #registry Registry})) + [#stack Stack + #registry Registry])) (template [ ] [(def: .public ( type) (-> (Type Method) (Try Limit)) (do try.monad [registry ( type)] - (in {#stack /stack.empty - #registry registry})))] + (in [#stack /stack.empty + #registry registry])))] [static /registry.static] [virtual /registry.virtual] diff --git a/stdlib/source/library/lux/target/jvm/class.lux b/stdlib/source/library/lux/target/jvm/class.lux index 03853a4ee..1dae89e90 100644 --- a/stdlib/source/library/lux/target/jvm/class.lux +++ b/stdlib/source/library/lux/target/jvm/class.lux @@ -30,7 +30,7 @@ (type: .public Class (Rec Class (Record - {#magic Magic + [#magic Magic #minor_version Minor #major_version Major #constant_pool Pool @@ -40,7 +40,7 @@ #interfaces (Row (Index //constant.Class)) #fields (Row Field) #methods (Row Method) - #attributes (Row Attribute)}))) + #attributes (Row Attribute)]))) (modifiers: Class ["0001" public] @@ -100,7 +100,7 @@ =fields (monad.all //constant/pool.monad fields) =methods (monad.all //constant/pool.monad methods)] (in [classes =fields =methods])))] - (in {#magic //magic.code + (in [#magic //magic.code #minor_version //version.default_minor #major_version version #constant_pool pool @@ -110,7 +110,7 @@ #interfaces @interfaces #fields (row.of_list =fields) #methods (row.of_list =methods) - #attributes attributes}))) + #attributes attributes]))) (def: .public (writer class) (Writer Class) diff --git a/stdlib/source/library/lux/target/jvm/constant.lux b/stdlib/source/library/lux/target/jvm/constant.lux index 63eff794c..780816d70 100644 --- a/stdlib/source/library/lux/target/jvm/constant.lux +++ b/stdlib/source/library/lux/target/jvm/constant.lux @@ -134,13 +134,13 @@ (type: .public (Name_And_Type of) (Record - {#name (Index UTF8) - #descriptor (Index (Descriptor of))})) + [#name (Index UTF8) + #descriptor (Index (Descriptor of))])) (type: .public (Reference of) (Record - {#class (Index Class) - #name_and_type (Index (Name_And_Type of))})) + [#class (Index Class) + #name_and_type (Index (Name_And_Type of))])) (template [ ] [(def: .public diff --git a/stdlib/source/library/lux/target/jvm/constant/pool.lux b/stdlib/source/library/lux/target/jvm/constant/pool.lux index d71b3727e..a680980ef 100644 --- a/stdlib/source/library/lux/target/jvm/constant/pool.lux +++ b/stdlib/source/library/lux/target/jvm/constant/pool.lux @@ -122,8 +122,8 @@ (type: .public (Member of) (Record - {#name UTF8 - #descriptor (Descriptor of)})) + [#name UTF8 + #descriptor (Descriptor of)])) (def: .public (name_and_type [name descriptor]) (All (_ of) @@ -131,7 +131,7 @@ (do ..monad [@name (utf8 name) @descriptor (..descriptor descriptor)] - (!add #//.Name_And_Type //.name_and_type_equivalence {#//.name @name #//.descriptor @descriptor}))) + (!add #//.Name_And_Type //.name_and_type_equivalence [#//.name @name #//.descriptor @descriptor]))) (template [ ] [(def: .public ( class member) @@ -139,7 +139,7 @@ (do ..monad [@class (..class (//name.internal class)) @name_and_type (name_and_type member)] - (!add //.reference_equivalence {#//.class @class #//.name_and_type @name_and_type})))] + (!add //.reference_equivalence [#//.class @class #//.name_and_type @name_and_type])))] [field #//.Field Value] [method #//.Method Method] diff --git a/stdlib/source/library/lux/target/jvm/field.lux b/stdlib/source/library/lux/target/jvm/field.lux index 5514a2674..a709da105 100644 --- a/stdlib/source/library/lux/target/jvm/field.lux +++ b/stdlib/source/library/lux/target/jvm/field.lux @@ -23,10 +23,10 @@ (type: .public Field (Rec Field (Record - {#modifier (Modifier Field) + [#modifier (Modifier Field) #name (Index UTF8) #descriptor (Index (Descriptor Value)) - #attributes (Row Attribute)}))) + #attributes (Row Attribute)]))) (modifiers: Field ["0001" public] @@ -66,7 +66,7 @@ (do //constant/pool.monad [@name (//constant/pool.utf8 name) @descriptor (//constant/pool.descriptor (//type.descriptor type))] - (in {#modifier modifier + (in [#modifier modifier #name @name #descriptor @descriptor - #attributes attributes}))) + #attributes attributes]))) diff --git a/stdlib/source/library/lux/target/jvm/method.lux b/stdlib/source/library/lux/target/jvm/method.lux index 09a7d56f1..638d4091f 100644 --- a/stdlib/source/library/lux/target/jvm/method.lux +++ b/stdlib/source/library/lux/target/jvm/method.lux @@ -29,10 +29,10 @@ (type: .public Method (Rec Method (Record - {#modifier (Modifier Method) + [#modifier (Modifier Method) #name (Index UTF8) #descriptor (Index (Descriptor //type/category.Method)) - #attributes (Row Attribute)}))) + #attributes (Row Attribute)]))) (modifiers: Method ["0001" public] @@ -71,18 +71,18 @@ (function (_ _) (#try.Failure error))) [environment exceptions instruction output] (//bytecode.resolve environment code) .let [bytecode (|> instruction //bytecode/instruction.result format.instance)] - @code (//attribute.code {#//attribute/code.limit (value@ #//bytecode/environment.limit environment) + @code (//attribute.code [#//attribute/code.limit (value@ #//bytecode/environment.limit environment) #//attribute/code.code bytecode #//attribute/code.exception_table exceptions - #//attribute/code.attributes (row.row)})] + #//attribute/code.attributes (row.row)])] (in (row.suffix @code attributes))) #.None (in attributes))] - (in {#modifier modifier + (in [#modifier modifier #name @name #descriptor @descriptor - #attributes attributes}))) + #attributes attributes]))) (def: .public equivalence (Equivalence Method) diff --git a/stdlib/source/library/lux/target/jvm/type.lux b/stdlib/source/library/lux/target/jvm/type.lux index 0b89649c3..55c6bd921 100644 --- a/stdlib/source/library/lux/target/jvm/type.lux +++ b/stdlib/source/library/lux/target/jvm/type.lux @@ -38,9 +38,9 @@ (type: .public Constraint (Record - {#name Text + [#name Text #super_class (Type Class) - #super_interfaces (List (Type Class))})) + #super_interfaces (List (Type Class))])) (template [