aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--documentation/book/the_lux_programming_language/index.md4
-rw-r--r--licentia/project.lux4
-rw-r--r--licentia/source/program/licentia/document.lux5
-rw-r--r--licentia/source/program/licentia/input.lux6
-rw-r--r--licentia/source/program/licentia/license.lux82
-rw-r--r--licentia/source/program/licentia/license/addendum.lux4
-rw-r--r--licentia/source/program/licentia/license/copyright.lux5
-rw-r--r--licentia/source/program/licentia/license/definition.lux9
-rw-r--r--licentia/source/program/licentia/license/time.lux5
-rw-r--r--licentia/source/program/licentia/output.lux48
-rw-r--r--licentia/source/test/licentia.lux4
-rw-r--r--lux-bootstrapper/src/lux/analyser.clj4
-rw-r--r--lux-bootstrapper/src/lux/analyser/case.clj86
-rw-r--r--lux-bootstrapper/src/lux/analyser/lux.clj30
-rw-r--r--lux-bootstrapper/src/lux/analyser/record.clj81
-rw-r--r--lux-bootstrapper/src/lux/base.clj22
-rw-r--r--lux-cl/source/program.lux8
-rw-r--r--lux-js/project.lux8
-rw-r--r--lux-js/source/program.lux8
-rw-r--r--lux-jvm/source/luxc/lang/directive/jvm.lux8
-rw-r--r--lux-jvm/source/luxc/lang/host/jvm.lux32
-rw-r--r--lux-jvm/source/program.lux12
-rw-r--r--lux-lua/project.lux4
-rw-r--r--lux-lua/source/program.lux12
-rw-r--r--lux-php/source/program.lux10
-rw-r--r--lux-python/project.lux4
-rw-r--r--lux-python/source/program.lux8
-rw-r--r--lux-r/source/program.lux8
-rw-r--r--lux-ruby/project.lux4
-rw-r--r--lux-ruby/source/program.lux8
-rw-r--r--lux-scheme/source/program.lux8
-rw-r--r--stdlib/commands.md4
-rw-r--r--stdlib/project.lux28
-rw-r--r--stdlib/source/documentation/lux.lux5
-rw-r--r--stdlib/source/documentation/lux/type/poly.lux4
-rw-r--r--stdlib/source/library/lux.lux298
-rw-r--r--stdlib/source/library/lux/abstract/monad/indexed.lux8
-rw-r--r--stdlib/source/library/lux/control/concatenative.lux4
-rw-r--r--stdlib/source/library/lux/control/concurrency/actor.lux28
-rw-r--r--stdlib/source/library/lux/control/concurrency/atom.lux12
-rw-r--r--stdlib/source/library/lux/control/concurrency/semaphore.lux16
-rw-r--r--stdlib/source/library/lux/control/concurrency/stm.lux12
-rw-r--r--stdlib/source/library/lux/control/concurrency/thread.lux8
-rw-r--r--stdlib/source/library/lux/control/exception.lux8
-rw-r--r--stdlib/source/library/lux/control/function/mutual.lux8
-rw-r--r--stdlib/source/library/lux/control/parser/text.lux16
-rw-r--r--stdlib/source/library/lux/control/security/policy.lux8
-rw-r--r--stdlib/source/library/lux/control/writer.lux4
-rw-r--r--stdlib/source/library/lux/data/collection/dictionary.lux8
-rw-r--r--stdlib/source/library/lux/data/collection/dictionary/ordered.lux16
-rw-r--r--stdlib/source/library/lux/data/collection/queue.lux16
-rw-r--r--stdlib/source/library/lux/data/collection/row.lux12
-rw-r--r--stdlib/source/library/lux/data/collection/tree.lux20
-rw-r--r--stdlib/source/library/lux/data/collection/tree/finger.lux12
-rw-r--r--stdlib/source/library/lux/data/collection/tree/zipper.lux54
-rw-r--r--stdlib/source/library/lux/data/color.lux64
-rw-r--r--stdlib/source/library/lux/data/color/named.lux4
-rw-r--r--stdlib/source/library/lux/data/format/css.lux4
-rw-r--r--stdlib/source/library/lux/data/format/css/font.lux8
-rw-r--r--stdlib/source/library/lux/data/format/css/selector.lux4
-rw-r--r--stdlib/source/library/lux/data/format/css/value.lux4
-rw-r--r--stdlib/source/library/lux/data/format/html.lux16
-rw-r--r--stdlib/source/library/lux/data/format/tar.lux36
-rw-r--r--stdlib/source/library/lux/data/store.lux8
-rw-r--r--stdlib/source/library/lux/data/trace.lux10
-rw-r--r--stdlib/source/library/lux/documentation.lux22
-rw-r--r--stdlib/source/library/lux/extension.lux4
-rw-r--r--stdlib/source/library/lux/ffi.js.lux4
-rw-r--r--stdlib/source/library/lux/ffi.jvm.lux77
-rw-r--r--stdlib/source/library/lux/ffi.lua.lux4
-rw-r--r--stdlib/source/library/lux/ffi.old.lux94
-rw-r--r--stdlib/source/library/lux/ffi.php.lux4
-rw-r--r--stdlib/source/library/lux/ffi.py.lux4
-rw-r--r--stdlib/source/library/lux/ffi.rb.lux4
-rw-r--r--stdlib/source/library/lux/ffi.scm.lux4
-rw-r--r--stdlib/source/library/lux/locale/language.lux8
-rw-r--r--stdlib/source/library/lux/locale/territory.lux8
-rw-r--r--stdlib/source/library/lux/macro/syntax/check.lux4
-rw-r--r--stdlib/source/library/lux/macro/syntax/declaration.lux4
-rw-r--r--stdlib/source/library/lux/macro/syntax/definition.lux8
-rw-r--r--stdlib/source/library/lux/macro/syntax/input.lux4
-rw-r--r--stdlib/source/library/lux/macro/template.lux8
-rw-r--r--stdlib/source/library/lux/math/modular.lux12
-rw-r--r--stdlib/source/library/lux/math/number/complex.lux84
-rw-r--r--stdlib/source/library/lux/math/number/frac.lux2
-rw-r--r--stdlib/source/library/lux/math/number/ratio.lux20
-rw-r--r--stdlib/source/library/lux/meta.lux51
-rw-r--r--stdlib/source/library/lux/meta/location.lux4
-rw-r--r--stdlib/source/library/lux/target/common_lisp.lux8
-rw-r--r--stdlib/source/library/lux/target/jvm/attribute.lux12
-rw-r--r--stdlib/source/library/lux/target/jvm/attribute/code.lux4
-rw-r--r--stdlib/source/library/lux/target/jvm/attribute/code/exception.lux4
-rw-r--r--stdlib/source/library/lux/target/jvm/bytecode.lux20
-rw-r--r--stdlib/source/library/lux/target/jvm/bytecode/environment.lux8
-rw-r--r--stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux8
-rw-r--r--stdlib/source/library/lux/target/jvm/class.lux8
-rw-r--r--stdlib/source/library/lux/target/jvm/constant.lux8
-rw-r--r--stdlib/source/library/lux/target/jvm/constant/pool.lux8
-rw-r--r--stdlib/source/library/lux/target/jvm/field.lux8
-rw-r--r--stdlib/source/library/lux/target/jvm/method.lux12
-rw-r--r--stdlib/source/library/lux/target/jvm/type.lux4
-rw-r--r--stdlib/source/library/lux/target/php.lux8
-rw-r--r--stdlib/source/library/lux/target/python.lux4
-rw-r--r--stdlib/source/library/lux/target/ruby.lux4
-rw-r--r--stdlib/source/library/lux/target/scheme.lux4
-rw-r--r--stdlib/source/library/lux/test.lux12
-rw-r--r--stdlib/source/library/lux/time.lux8
-rw-r--r--stdlib/source/library/lux/time/date.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/default/init.lux24
-rw-r--r--stdlib/source/library/lux/tool/compiler/default/platform.lux16
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux28
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/directive.lux24
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/generation.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux27
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux126
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux207
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux16
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux9
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux20
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux20
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive/document.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/io/context.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux8
-rw-r--r--stdlib/source/library/lux/tool/interpreter.lux8
-rw-r--r--stdlib/source/library/lux/type.lux4
-rw-r--r--stdlib/source/library/lux/type/abstract.lux4
-rw-r--r--stdlib/source/library/lux/type/check.lux4
-rw-r--r--stdlib/source/library/lux/type/implicit.lux8
-rw-r--r--stdlib/source/library/lux/type/quotient.lux8
-rw-r--r--stdlib/source/library/lux/type/refinement.lux12
-rw-r--r--stdlib/source/library/lux/world/db/jdbc.lux8
-rw-r--r--stdlib/source/library/lux/world/file.lux8
-rw-r--r--stdlib/source/library/lux/world/file/watch.lux16
-rw-r--r--stdlib/source/library/lux/world/input/keyboard.lux8
-rw-r--r--stdlib/source/library/lux/world/net.lux4
-rw-r--r--stdlib/source/library/lux/world/net/http.lux20
-rw-r--r--stdlib/source/library/lux/world/net/http/client.lux4
-rw-r--r--stdlib/source/library/lux/world/net/http/mime.lux4
-rw-r--r--stdlib/source/library/lux/world/net/http/response.lux8
-rw-r--r--stdlib/source/library/lux/world/output/video/resolution.lux8
-rw-r--r--stdlib/source/library/lux/world/service/authentication.lux9
-rw-r--r--stdlib/source/library/lux/world/service/crud.lux14
-rw-r--r--stdlib/source/library/lux/world/service/inventory.lux14
-rw-r--r--stdlib/source/library/lux/world/service/journal.lux18
-rw-r--r--stdlib/source/library/lux/world/service/mail.lux5
-rw-r--r--stdlib/source/program/aedifex/artifact.lux4
-rw-r--r--stdlib/source/program/aedifex/artifact/snapshot/stamp.lux4
-rw-r--r--stdlib/source/program/aedifex/artifact/snapshot/version.lux4
-rw-r--r--stdlib/source/program/aedifex/artifact/snapshot/version/value.lux4
-rw-r--r--stdlib/source/program/aedifex/artifact/time/time.lux4
-rw-r--r--stdlib/source/program/aedifex/artifact/versioning.lux8
-rw-r--r--stdlib/source/program/aedifex/command/deploy.lux4
-rw-r--r--stdlib/source/program/aedifex/command/install.lux4
-rw-r--r--stdlib/source/program/aedifex/dependency.lux4
-rw-r--r--stdlib/source/program/aedifex/dependency/deployment.lux8
-rw-r--r--stdlib/source/program/aedifex/dependency/resolution.lux8
-rw-r--r--stdlib/source/program/aedifex/format.lux33
-rw-r--r--stdlib/source/program/aedifex/metadata/artifact.lux12
-rw-r--r--stdlib/source/program/aedifex/metadata/snapshot.lux22
-rw-r--r--stdlib/source/program/aedifex/package.lux8
-rw-r--r--stdlib/source/program/aedifex/parser.lux30
-rw-r--r--stdlib/source/program/aedifex/pom.lux6
-rw-r--r--stdlib/source/program/aedifex/profile.lux24
-rw-r--r--stdlib/source/program/aedifex/repository/identity.lux4
-rw-r--r--stdlib/source/program/aedifex/runtime.lux8
-rw-r--r--stdlib/source/program/compositor/export.lux8
-rw-r--r--stdlib/source/program/compositor/static.lux4
-rw-r--r--stdlib/source/program/scriptum.lux17
-rw-r--r--stdlib/source/specification/compositor/generation/case.lux4
-rw-r--r--stdlib/source/specification/compositor/generation/common.lux8
-rw-r--r--stdlib/source/specification/compositor/generation/function.lux28
-rw-r--r--stdlib/source/specification/compositor/generation/structure.lux4
-rw-r--r--stdlib/source/test/aedifex/artifact/snapshot/version/value.lux4
-rw-r--r--stdlib/source/test/aedifex/cache.lux4
-rw-r--r--stdlib/source/test/aedifex/command/build.lux12
-rw-r--r--stdlib/source/test/aedifex/command/deps.lux8
-rw-r--r--stdlib/source/test/aedifex/dependency/deployment.lux4
-rw-r--r--stdlib/source/test/aedifex/dependency/resolution.lux32
-rw-r--r--stdlib/source/test/aedifex/metadata/artifact.lux8
-rw-r--r--stdlib/source/test/aedifex/metadata/snapshot.lux4
-rw-r--r--stdlib/source/test/aedifex/repository/remote.lux20
-rw-r--r--stdlib/source/test/lux.lux44
-rw-r--r--stdlib/source/test/lux/control/concurrency/actor.lux4
-rw-r--r--stdlib/source/test/lux/data/collection/tree.lux4
-rw-r--r--stdlib/source/test/lux/data/format/tar.lux40
-rw-r--r--stdlib/source/test/lux/locale/language.lux8
-rw-r--r--stdlib/source/test/lux/locale/territory.lux8
-rw-r--r--stdlib/source/test/lux/macro.lux18
-rw-r--r--stdlib/source/test/lux/macro/syntax/check.lux4
-rw-r--r--stdlib/source/test/lux/macro/syntax/definition.lux10
-rw-r--r--stdlib/source/test/lux/meta.lux160
-rw-r--r--stdlib/source/test/lux/target/jvm.lux44
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux28
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux93
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux28
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux8
-rw-r--r--stdlib/source/test/lux/type/poly/equivalence.lux4
-rw-r--r--stdlib/source/test/lux/type/poly/json.lux4
-rw-r--r--stdlib/source/test/lux/world/net/http/client.lux4
213 files changed, 1869 insertions, 1747 deletions
diff --git a/documentation/book/the_lux_programming_language/index.md b/documentation/book/the_lux_programming_language/index.md
index 327eab5cc..4351f0be7 100644
--- a/documentation/book/the_lux_programming_language/index.md
+++ b/documentation/book/the_lux_programming_language/index.md
@@ -1,7 +1,7 @@
# Table of contents
* [Introduction](introduction.md)
-* [Chapter 1: Getting started](chapter_*md)
+* [Chapter 1: Getting started](chapter_1.md)
_Where you will learn how to set up a development environment for Lux._
* [Chapter 2: The basics](chapter_2.md)
_Where you will learn the fundamentals of Lux programming._
@@ -21,7 +21,7 @@
_Where we go meta. For real._
* [Chapter 10: Code and macros](chapter_10.md)
_Where magic turns into science._
-* [Chapter 11: Syntax macros](chapter_1*md)
+* [Chapter 11: Syntax macros](chapter_11.md)
_Where science turns into magic once more._
* [Chapter 12: I/O](chapter_12.md)
_Where you will learn how to interact with the outside world._
diff --git a/licentia/project.lux b/licentia/project.lux
index 93f43aa47..6560fdf56 100644
--- a/licentia/project.lux
+++ b/licentia/project.lux
@@ -1,4 +1,4 @@
-{#identity ["com.github.luxlang" "licentia" "0.6.0-SNAPSHOT"]
+[#identity ["com.github.luxlang" "licentia" "0.6.0-SNAPSHOT"]
#description "A program for producing free/open-source/reciprocal licenses."
#deploy_repositories {"snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
@@ -15,4 +15,4 @@
... #compiler ["com.github.luxlang" "lux-ruby" "0.6.0-SNAPSHOT" "jar"]
#program "program/licentia"
- #test "test/licentia"}
+ #test "test/licentia"]
diff --git a/licentia/source/program/licentia/document.lux b/licentia/source/program/licentia/document.lux
index 7b159b8f5..07a4e2b83 100644
--- a/licentia/source/program/licentia/document.lux
+++ b/licentia/source/program/licentia/document.lux
@@ -40,8 +40,9 @@
)
(type: .public Section
- {#title Text
- #content Text})
+ (Record
+ [#title Text
+ #content Text]))
(def: .public (section value)
(-> Section Text)
diff --git a/licentia/source/program/licentia/input.lux b/licentia/source/program/licentia/input.lux
index ede659fcf..f6a438e7f 100644
--- a/licentia/source/program/licentia/input.lux
+++ b/licentia/source/program/licentia/input.lux
@@ -67,8 +67,8 @@
(do <>.monad
[start (<json>.field "start" ..amount)
end (<json>.field "end" ..amount)
- #let [period {#time.start start
- #time.end end}]
+ #let [period [#time.start start
+ #time.end end]]
_ (<>.assert (exception.construct ..invalid_period [period])
(n.<= end start))]
(wrap period))))
@@ -163,6 +163,6 @@
(<json>.field "extension" ..extension)
(<json>.field "black-lists" (<json>.array (<>.some ..black_list)))
(<json>.field "attribution" (<json>.nullable ..attribution))
- (<>.default {#//.commons_clause? false}
+ (<>.default [#//.commons_clause? false]
(<json>.field "addendum" ..addendum))
)))
diff --git a/licentia/source/program/licentia/license.lux b/licentia/source/program/licentia/license.lux
index 9060915a3..052ad1f05 100644
--- a/licentia/source/program/licentia/license.lux
+++ b/licentia/source/program/licentia/license.lux
@@ -6,58 +6,70 @@
["#." copyright]])
(type: .public Identification
- {#name Text
- #version Text})
+ (Record
+ [#name Text
+ #version Text]))
(type: .public Termination
- {#patent_retaliation? Bit
- #termination_period Days
- #grace_period Days})
+ (Record
+ [#patent_retaliation? Bit
+ #termination_period Days
+ #grace_period Days]))
(type: .public Liability
- {#can_accept? Bit
- #disclaim_high_risk? Bit})
+ (Record
+ [#can_accept? Bit
+ #disclaim_high_risk? Bit]))
(type: .public Distribution
- {#can_re_license? Bit
- #can_multi_license? Bit})
+ (Record
+ [#can_re_license? Bit
+ #can_multi_license? Bit]))
(type: .public Commercial
- {#can_sell? Bit
- #require_contributor_credit? Bit
- #allow_contributor_endorsement? Bit})
+ (Record
+ [#can_sell? Bit
+ #require_contributor_credit? Bit
+ #allow_contributor_endorsement? Bit]))
(type: .public Extension
- {#same_license? Bit
- #must_be_distinguishable? Bit
- #notification_period (Maybe (Period Months))
- #must_describe_modifications? Bit})
+ (Record
+ [#same_license? Bit
+ #must_be_distinguishable? Bit
+ #notification_period (Maybe (Period Months))
+ #must_describe_modifications? Bit]))
-(type: .public Entity Text)
+(type: .public Entity
+ Text)
(type: .public Black_List
- {#justification (Maybe Text)
- #entities (List Entity)})
+ (Record
+ [#justification (Maybe Text)
+ #entities (List Entity)]))
-(type: .public URL Text)
+(type: .public URL
+ Text)
(type: .public Attribution
- {#copyright_notice Text
- #phrase (Maybe Text)
- #url URL
- #image (Maybe URL)})
+ (Record
+ [#copyright_notice Text
+ #phrase (Maybe Text)
+ #url URL
+ #image (Maybe URL)]))
(type: .public Addendum
- {#commons_clause? Bit})
+ (Record
+ [#commons_clause? Bit]))
(type: .public License
- {#copyright_holders (List /copyright.Holder)
- #identification (Maybe Identification)
- #termination Termination
- #liability Liability
- #distribution Distribution
- #commercial Commercial
- #extension Extension
- #black_lists (List Black_List)
- #attribution (Maybe Attribution)
- #addendum Addendum})
+ (Record
+ [#copyright_holders (List /copyright.Holder)
+ #identification (Maybe Identification)
+ #termination Termination
+ #liability Liability
+ #distribution Distribution
+ #commercial Commercial
+ #extension Extension
+ #black_lists (List Black_List)
+ #attribution (Maybe Attribution)
+ #addendum Addendum]))
diff --git a/licentia/source/program/licentia/license/addendum.lux b/licentia/source/program/licentia/license/addendum.lux
index a3518f68e..1fffda746 100644
--- a/licentia/source/program/licentia/license/addendum.lux
+++ b/licentia/source/program/licentia/license/addendum.lux
@@ -19,8 +19,8 @@
(-> Addendum Text)
(`` (format (~~ (template [<title> <condition> <content>]
[(if <condition>
- ($.block ($.section {#$.title <title>
- #$.content <content>}))
+ ($.block ($.section [#$.title <title>
+ #$.content <content>]))
"")]
["“Commons Clause” License Condition v1.0"
diff --git a/licentia/source/program/licentia/license/copyright.lux b/licentia/source/program/licentia/license/copyright.lux
index 7c2d838c1..3d48653b6 100644
--- a/licentia/source/program/licentia/license/copyright.lux
+++ b/licentia/source/program/licentia/license/copyright.lux
@@ -5,5 +5,6 @@
[time (#+ Year Period)]])
(type: .public Holder
- {#name Text
- #period (Period Year)})
+ (Record
+ [#name Text
+ #period (Period Year)]))
diff --git a/licentia/source/program/licentia/license/definition.lux b/licentia/source/program/licentia/license/definition.lux
index 81be7ffc6..0765a488f 100644
--- a/licentia/source/program/licentia/license/definition.lux
+++ b/licentia/source/program/licentia/license/definition.lux
@@ -8,8 +8,9 @@
["$" document]])
(type: .public Definition
- {#term Text
- #meaning Text})
+ (Record
+ [#term Text
+ #meaning Text]))
(def: not_a_contribution_notice
(format text.double_quote "Not a Contribution" text.double_quote))
@@ -47,8 +48,8 @@
(template [<name> <term> <meaning>]
[(def: .public <name>
Definition
- {#term <term>
- #meaning <meaning>})]
+ [#term <term>
+ #meaning <meaning>])]
[license "This License"
($.paragraph (list (format "the terms and conditions defined in this document")))]
diff --git a/licentia/source/program/licentia/license/time.lux b/licentia/source/program/licentia/license/time.lux
index de6d613b7..e19f7ef16 100644
--- a/licentia/source/program/licentia/license/time.lux
+++ b/licentia/source/program/licentia/license/time.lux
@@ -12,5 +12,6 @@
Nat)
(type: .public (Period a)
- {#start a
- #end a})
+ (Record
+ [#start a
+ #end a]))
diff --git a/licentia/source/program/licentia/output.lux b/licentia/source/program/licentia/output.lux
index c4dd78214..03380ece9 100644
--- a/licentia/source/program/licentia/output.lux
+++ b/licentia/source/program/licentia/output.lux
@@ -48,8 +48,8 @@
(def: .public (grant termination)
(-> Termination Text)
(`` (format (~~ (template [<title> <content>]
- [($.block ($.section {#$.title <title>
- #$.content <content>}))]
+ [($.block ($.section [#$.title <title>
+ #$.content <content>]))]
["Grant of Copyright License"
grant.copyright]
@@ -70,8 +70,8 @@
(def: .public limitation
Text
(`` (format (~~ (template [<title> <content>]
- [($.block ($.section {#$.title <title>
- #$.content <content>}))]
+ [($.block ($.section [#$.title <title>
+ #$.content <content>]))]
["Limitations on Grant Scope"
limitation.grant]
@@ -85,8 +85,8 @@
(def: .public assurance
Text
(`` (format (~~ (template [<title> <content>]
- [($.block ($.section {#$.title <title>
- #$.content <content>}))]
+ [($.block ($.section [#$.title <title>
+ #$.content <content>]))]
["Representation"
assurance.representation]
@@ -98,8 +98,8 @@
(-> Liability Text)
(`` (format (~~ (template [<title> <condition> <content>]
[(if <condition>
- ($.block ($.section {#$.title <title>
- #$.content <content>}))
+ ($.block ($.section [#$.title <title>
+ #$.content <content>]))
"")]
["Disclaimer of Warranty"
@@ -126,8 +126,8 @@
(-> Distribution Text)
(`` (format (~~ (template [<title> <condition> <content>]
[(if <condition>
- ($.block ($.section {#$.title <title>
- #$.content <content>}))
+ ($.block ($.section [#$.title <title>
+ #$.content <content>]))
"")]
[(format "Distribution of a " _.source_code_form)
@@ -147,8 +147,8 @@
(-> Commercial Text)
(`` (format (~~ (template [<title> <condition> <content>]
[(if <condition>
- ($.block ($.section {#$.title <title>
- #$.content <content>}))
+ ($.block ($.section [#$.title <title>
+ #$.content <content>]))
"")]
["Non-Commerciality"
@@ -174,8 +174,8 @@
[false ""])]
(`` (format (~~ (template [<condition> <title> <content>]
[(if <condition>
- ($.block ($.section {#$.title <title>
- #$.content <content>}))
+ ($.block ($.section [#$.title <title>
+ #$.content <content>]))
"")]
[(value@ #license.same_license? value) "License Retention"
@@ -216,8 +216,8 @@
(-> Bit Text)
(`` (format (~~ (template [<title> <condition> <content>]
[(if <condition>
- ($.block ($.section {#$.title <title>
- #$.content <content>}))
+ ($.block ($.section [#$.title <title>
+ #$.content <content>]))
"")]
["Entire Agreement"
@@ -271,25 +271,25 @@
""
black_lists
- ($.block ($.section {#$.title (format "Denial of " _.license)
+ ($.block ($.section [#$.title (format "Denial of " _.license)
#$.content (|> black_lists
(list\each black_list.black_list)
- (text.interposed ..black_list_spacing))})))
+ (text.interposed ..black_list_spacing))])))
- ($.section {#$.title "Definitions"
+ ($.section [#$.title "Definitions"
#$.content (|> definition.all
(list\each (|>> ..definition $.block))
- (text.interposed ""))})
+ (text.interposed ""))])
- ($.block ($.section {#$.title (format "Acceptance of " _.license)
- #$.content limitation.acceptance}))
+ ($.block ($.section [#$.title (format "Acceptance of " _.license)
+ #$.content limitation.acceptance]))
(..grant (value@ #license.termination value))
..limitation
..assurance
- ($.block ($.section {#$.title (format _.submission " of " ($.plural _.contribution))
- #$.content submission.contribution}))
+ ($.block ($.section [#$.title (format _.submission " of " ($.plural _.contribution))
+ #$.content submission.contribution]))
(..liability (value@ #license.liability value))
(..distribution (value@ #license.distribution value))
diff --git a/licentia/source/test/licentia.lux b/licentia/source/test/licentia.lux
index e9178a996..7238b6c71 100644
--- a/licentia/source/test/licentia.lux
+++ b/licentia/source/test/licentia.lux
@@ -53,8 +53,8 @@
end (\ ! each
(|>> (n.% wiggle_room) (n.max 1))
random.nat)]
- (wrap {#time.start start
- #time.end end})))
+ (wrap [#time.start start
+ #time.end end])))
(def: copyright_holder
(Random copyright.Holder)
diff --git a/lux-bootstrapper/src/lux/analyser.clj b/lux-bootstrapper/src/lux/analyser.clj
index ccd0144f6..27323be2b 100644
--- a/lux-bootstrapper/src/lux/analyser.clj
+++ b/lux-bootstrapper/src/lux/analyser.clj
@@ -88,10 +88,6 @@
(&/$Tuple ?elems)
(&/with-analysis-meta location exo-type
- (&&lux/analyse-tuple analyse (&/$Right exo-type) ?elems))
-
- (&/$Record ?elems)
- (&/with-analysis-meta location exo-type
(&&lux/analyse-record analyse exo-type ?elems))
(&/$Tag ?ident)
diff --git a/lux-bootstrapper/src/lux/analyser/case.clj b/lux-bootstrapper/src/lux/analyser/case.clj
index 062467ca3..49d781c3b 100644
--- a/lux-bootstrapper/src/lux/analyser/case.clj
+++ b/lux-bootstrapper/src/lux/analyser/case.clj
@@ -298,51 +298,51 @@
=kont kont]
(return (&/T [($TextTestAC ?value) =kont])))
- (&/$Tuple ?members)
- (|case ?members
- (&/$End)
- (|do [_ (&type/check value-type &type/Any)
- =kont kont]
- (return (&/T [($TupleTestAC (&/|list)) =kont])))
+ (&/$Tuple (&/$End))
+ (|do [_ (&type/check value-type &type/Any)
+ =kont kont]
+ (return (&/T [($TupleTestAC (&/|list)) =kont])))
- (&/$Item ?member (&/$End))
- (analyse-pattern var?? value-type ?member kont)
+ (&/$Tuple (&/$Item ?member (&/$End)))
+ (analyse-pattern var?? value-type ?member kont)
- _
- (|do [must-infer? (&type/unknown? value-type)
- value-type* (if must-infer?
- (|do [member-types (&/map% (fn [_] &type/create-var+) (&/|range (&/|length ?members)))]
- (return (&type/fold-prod member-types)))
- (adjust-type value-type))]
- (|case value-type*
- (&/$Product _)
- (|let [num-elems (&/|length ?members)
- [_shorter _tuple-types] (&type/tuple-types-for (&/|length ?members) value-type*)]
- (if (= num-elems _shorter)
- (|do [[=tests =kont] (&/fold (fn [kont* vm]
- (|let [[v m] vm]
- (|do [[=test [=tests =kont]] (analyse-pattern &/$None v m kont*)]
- (return (&/T [(&/$Item =test =tests) =kont])))))
- (|do [=kont kont]
- (return (&/T [&/$End =kont])))
- (&/|reverse (&/zip2 _tuple-types ?members)))]
- (return (&/T [($TupleTestAC =tests) =kont])))
- (&/fail-with-loc (str "[Pattern-matching Error] Pattern-matching mismatch. Requires tuple[" (&/|length (&type/flatten-prod value-type*)) "]. Given tuple [" (&/|length ?members) "].\n"
- " At: " (&/show-ast pattern) "\n"
- "Expected type: " (&type/show-type value-type*) "\n"
- " Actual type: " (&type/show-type value-type)))))
-
- _
- (&/fail-with-loc (str "[Pattern-matching Error] Tuples require tuple-types: " (&type/show-type value-type))))))
-
- (&/$Record pairs)
- (|do [[rec-members rec-type] (&&record/order-record pairs)
- must-infer? (&type/unknown? value-type)
- rec-type* (if must-infer?
- (&type/instantiate-inference rec-type)
- (return value-type))
- _ (&type/check value-type rec-type*)]
- (analyse-pattern &/$None rec-type* (&/T [meta (&/$Tuple rec-members)]) kont))
+ (&/$Tuple ?members)
+ (|do [rec-members&rec-type (&&record/order-record ?members)]
+ (|case rec-members&rec-type
+ (&/$Some [rec-members rec-type])
+ (|do [must-infer? (&type/unknown? value-type)
+ rec-type* (if must-infer?
+ (&type/instantiate-inference rec-type)
+ (return value-type))
+ _ (&type/check value-type rec-type*)]
+ (analyse-pattern &/$None rec-type* (&/T [meta (&/$Tuple rec-members)]) kont))
+
+ (&/$None)
+ (|do [must-infer? (&type/unknown? value-type)
+ value-type* (if must-infer?
+ (|do [member-types (&/map% (fn [_] &type/create-var+) (&/|range (&/|length ?members)))]
+ (return (&type/fold-prod member-types)))
+ (adjust-type value-type))]
+ (|case value-type*
+ (&/$Product _)
+ (|let [num-elems (&/|length ?members)
+ [_shorter _tuple-types] (&type/tuple-types-for (&/|length ?members) value-type*)]
+ (if (= num-elems _shorter)
+ (|do [[=tests =kont] (&/fold (fn [kont* vm]
+ (|let [[v m] vm]
+ (|do [[=test [=tests =kont]] (analyse-pattern &/$None v m kont*)]
+ (return (&/T [(&/$Item =test =tests) =kont])))))
+ (|do [=kont kont]
+ (return (&/T [&/$End =kont])))
+ (&/|reverse (&/zip2 _tuple-types ?members)))]
+ (return (&/T [($TupleTestAC =tests) =kont])))
+ (&/fail-with-loc (str "[Pattern-matching Error] Pattern-matching mismatch. Requires tuple[" (&/|length (&type/flatten-prod value-type*)) "]. Given tuple [" (&/|length ?members) "].\n"
+ " At: " (&/show-ast pattern) "\n"
+ "Expected type: " (&type/show-type value-type*) "\n"
+ " Actual type: " (&type/show-type value-type)))))
+
+ _
+ (&/fail-with-loc (str "[Pattern-matching Error] Tuples require tuple-types: " (&type/show-type value-type)))))))
(&/$Tag ?ident)
(|do [[=module =name] (&&/resolved-ident ?ident)
diff --git a/lux-bootstrapper/src/lux/analyser/lux.clj b/lux-bootstrapper/src/lux/analyser/lux.clj
index 8b93faea8..7b8019211 100644
--- a/lux-bootstrapper/src/lux/analyser/lux.clj
+++ b/lux-bootstrapper/src/lux/analyser/lux.clj
@@ -245,20 +245,24 @@
)))
(defn analyse-record [analyse exo-type ?elems]
- (|do [[rec-members rec-type] (&&record/order-record ?elems)]
- (|case exo-type
- (&/$Var id)
- (|do [verdict (&type/bound? id)]
- (if verdict
- (analyse-tuple analyse (&/$Right exo-type) rec-members)
- (|do [[[tuple-type tuple-location] tuple-analysis] (&&/cap-1 (analyse-tuple analyse (&/$Left rec-type) rec-members))
- _ (&type/check exo-type tuple-type)]
- (return (&/|list (&&/|meta exo-type tuple-location
- tuple-analysis))))))
+ (|do [rec-members&rec-type (&&record/order-record ?elems)]
+ (|case rec-members&rec-type
+ (&/$Some [rec-members rec-type])
+ (|case exo-type
+ (&/$Var id)
+ (|do [verdict (&type/bound? id)]
+ (if verdict
+ (analyse-tuple analyse (&/$Right exo-type) rec-members)
+ (|do [[[tuple-type tuple-location] tuple-analysis] (&&/cap-1 (analyse-tuple analyse (&/$Left rec-type) rec-members))
+ _ (&type/check exo-type tuple-type)]
+ (return (&/|list (&&/|meta exo-type tuple-location
+ tuple-analysis))))))
- _
- (analyse-tuple analyse (&/$Right exo-type) rec-members)
- )))
+ _
+ (analyse-tuple analyse (&/$Right exo-type) rec-members))
+
+ (&/$None)
+ (analyse-tuple analyse (&/$Right exo-type) ?elems))))
(defn ^:private analyse-global [analyse exo-type module name]
(|do [[[r-module r-name] [exported? endo-type ?annotations ?value]] (&&module/find-def module name)
diff --git a/lux-bootstrapper/src/lux/analyser/record.clj b/lux-bootstrapper/src/lux/analyser/record.clj
index 7af3c17ac..09fd8b988 100644
--- a/lux-bootstrapper/src/lux/analyser/record.clj
+++ b/lux-bootstrapper/src/lux/analyser/record.clj
@@ -8,37 +8,56 @@
;; [Exports]
(defn order-record
- "(-> (List (, Syntax Syntax)) (Lux (List Syntax)))"
+ "(-> (List Syntax) (Lux (Maybe (List Syntax))))"
[pairs]
- (|do [[module slot-group slot-type] (|case pairs
- (&/$End)
- (|do [module &/get-module-name]
- (return (&/T [module &/$End &type/Any])))
-
- (&/$Item [[_ (&/$Tag slot1)] _] _)
- (|do [[module name] (&&/resolved-ident slot1)
- [_exported? type slots _index] (&&module/find-slot module (str "#" name))]
- (return (&/T [module slots type])))
+ (if (even? (&/|length pairs))
+ (let [pairs (&/|as-pairs pairs)]
+ (|do [module&slot-group&slot-type (|case pairs
+ (&/$End)
+ (|do [module &/get-module-name]
+ (return (&/$Some (&/T [module &/$End &type/Any]))))
+
+ (&/$Item [[_ (&/$Tag slot0)] _] _)
+ (|do [[module name] (&&/resolved-ident slot0)
+ _exported?&type&slots&_index (fn [lux]
+ (|case ((&&module/find-slot module (str "#" name)) lux)
+ (&/$Left error)
+ (&/$Right (&/T [lux &/$None]))
+
+ (&/$Right [lux* output])
+ (&/$Right (&/T [lux* (&/$Some output)]))))]
+ (|case _exported?&type&slots&_index
+ (&/$Some [_exported? type slots _index])
+ (return (&/$Some (&/T [module slots type])))
- _
- (&/fail-with-loc "[Analyser Error] Wrong syntax for records. Odd elements must be slots."))
- =pairs (&/map% (fn [kv]
- (|case kv
- [[_ (&/$Tag k)] v]
- (|do [=k (&&/resolved-ident k)]
- (return (&/T [(&/ident->text =k) v])))
+ (&/$None)
+ (return &/$None)))
- _
- (&/fail-with-loc "[Analyser Error] Wrong syntax for records. Odd elements must be slots.")))
- pairs)
- _ (let [num-expected (&/|length slot-group)
- num-got (&/|length =pairs)]
- (&/assert! (= num-expected num-got)
- (str "[Analyser Error] Wrong number of record members. Expected " num-expected ", but got " num-got ".")))
- =members (&/map% (fn [slot]
- (let [slot (&/ident->text (&/T [module slot]))]
- (if-let [member (&/|get slot =pairs)]
- (return member)
- (&/fail-with-loc (str "[Analyser Error] Missing slot: " slot)))))
- slot-group)]
- (return (&/T [=members slot-type]))))
+ _
+ (return &/$None))]
+ (|case module&slot-group&slot-type
+ (&/$Some [module slot-group slot-type])
+ (|do [=pairs (&/map% (fn [kv]
+ (|case kv
+ [[_ (&/$Tag k)] v]
+ (|do [=k (&&/resolved-ident k)]
+ (return (&/T [(&/ident->text =k) v])))
+
+ _
+ (&/fail-with-loc "[Analyser Error] Wrong syntax for records. Odd elements must be slots.")))
+ pairs)
+ _ (let [num-expected (&/|length slot-group)
+ num-got (&/|length =pairs)]
+ (&/assert! (= num-expected num-got)
+ (str "[Analyser Error] Wrong number of record members. Expected " num-expected ", but got " num-got ".")))
+ =members (&/map% (fn [slot]
+ (let [slot (&/ident->text (&/T [module slot]))]
+ (if-let [member (&/|get slot =pairs)]
+ (return member)
+ (&/fail-with-loc (str "[Analyser Error] Missing slot: " slot)))))
+ slot-group)]
+ (return (&/$Some (&/T [=members slot-type]))))
+
+ (&/$None)
+ (return &/$None))))
+ (return &/$None)))
diff --git a/lux-bootstrapper/src/lux/base.clj b/lux-bootstrapper/src/lux/base.clj
index f95c4d6d5..b19bb4fae 100644
--- a/lux-bootstrapper/src/lux/base.clj
+++ b/lux-bootstrapper/src/lux/base.clj
@@ -273,7 +273,7 @@
:else pattern))
(defmacro |case [value & branches]
- (assert (= 0 (mod (count branches) 2)))
+ (assert (even? (count branches)))
(let [value* (if (vector? value)
[`(T [~@value])]
[value])]
@@ -381,7 +381,7 @@
))))
(defmacro |do [steps return]
- (assert (= 0 (rem (count steps) 2)) "The number of steps must be even!")
+ (assert (even? (count steps)) "The number of steps must be even!")
(reduce (fn [inner [label computation]]
(case label
:let `(|let ~computation ~inner)
@@ -580,20 +580,22 @@
(defn list-join [xss]
(fold |++ $End xss))
-(defn |as-pairs [xs]
- (|case xs
- ($Item x ($Item y xs*))
- ($Item (T [x y]) (|as-pairs xs*))
-
- _
- $End))
-
(defn |reverse [xs]
(fold (fn [tail head]
($Item head tail))
$End
xs))
+(defn |as-pairs [xs]
+ (loop [input xs
+ output $End]
+ (|case input
+ ($Item headL ($Item headR tail))
+ (recur tail ($Item (T [headL headR]) output))
+
+ _
+ (|reverse output))))
+
(defn add-loc [meta ^String msg]
(if (.startsWith msg "@")
msg
diff --git a/lux-cl/source/program.lux b/lux-cl/source/program.lux
index 3b52fcdd2..55ea81ec4 100644
--- a/lux-cl/source/program.lux
+++ b/lux-cl/source/program.lux
@@ -337,11 +337,11 @@
(IO (Platform [_.Tag Register] (_.Expression Any) (_.Expression Any)))
(do io.monad
[host ..host]
- (wrap {#platform.&file_system (file.async file.default)
+ (wrap [#platform.&file_system (file.async file.default)
#platform.host host
#platform.phase common_lisp.generate
#platform.runtime runtime.generate
- #platform.write (|>> _.code (\ encoding.utf8 encoded))})))
+ #platform.write (|>> _.code (\ encoding.utf8 encoded))])))
(def: get_ecl_cli_inputs
(let [@idx (_.var "i")]
@@ -411,10 +411,10 @@
(do io.monad
[platform ..platform]
(exec (do promise.monad
- [_ (/.compiler {#/static.host @.common_lisp
+ [_ (/.compiler [#/static.host @.common_lisp
#/static.host_module_extension extension
#/static.target (/cli.target service)
- #/static.artifact_extension extension}
+ #/static.artifact_extension extension]
..expander
analysis.bundle
(io.io platform)
diff --git a/lux-js/project.lux b/lux-js/project.lux
index 2163ba34c..ec5be294c 100644
--- a/lux-js/project.lux
+++ b/lux-js/project.lux
@@ -1,5 +1,5 @@
{""
- {#identity ["com.github.luxlang" "lux-js" "0.6.0-SNAPSHOT"]
+ [#identity ["com.github.luxlang" "lux-js" "0.6.0-SNAPSHOT"]
#description "A JavaScript compiler for Lux."
#deploy_repositories {"snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
@@ -10,8 +10,8 @@
#dependencies [["com.github.luxlang" "stdlib" "0.6.0-SNAPSHOT" "tar"]]
- #program "program"}
+ #program "program"]
"jvm"
- {#compiler ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT" "jar"]
- #dependencies [["org.openjdk.nashorn" "nashorn-core" "15.1" "jar"]]}}
+ [#compiler ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT" "jar"]
+ #dependencies [["org.openjdk.nashorn" "nashorn-core" "15.1" "jar"]]]}
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux
index ea9011dac..0fcf22f56 100644
--- a/lux-js/source/program.lux
+++ b/lux-js/source/program.lux
@@ -587,14 +587,14 @@
(IO (Platform [Register Text] _.Expression _.Statement))
(do io.monad
[host ..host]
- (in {#platform.&file_system (for {@.old (file.async file.default)
+ (in [#platform.&file_system (for {@.old (file.async file.default)
@.jvm (file.async file.default)
@.js file.default})
#platform.host host
#platform.phase js.generate
#platform.runtime runtime.generate
#platform.phase_wrapper ..phase_wrapper
- #platform.write (|>> _.code (\ utf8.codec encoded))})))
+ #platform.write (|>> _.code (\ utf8.codec encoded))])))
(def: (program context program)
(Program _.Expression _.Statement)
@@ -660,10 +660,10 @@
(program: [service /cli.service]
(let [extension ".js"]
(exec (do async.monad
- [_ (/.compiler {#/static.host @.js
+ [_ (/.compiler [#/static.host @.js
#/static.host_module_extension extension
#/static.target (/cli.target service)
- #/static.artifact_extension extension}
+ #/static.artifact_extension extension]
..expander
analysis.bundle
..platform
diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux
index 22715276b..8be0777a8 100644
--- a/lux-jvm/source/luxc/lang/directive/jvm.lux
+++ b/lux-jvm/source/luxc/lang/directive/jvm.lux
@@ -619,12 +619,12 @@
(type: Method_Declaration
(Record
- {#name Text
+ [#name Text
#annotations (List Annotation)
#type_variables (List (Type Var))
#exceptions (List (Type Class))
#arguments (List (Type Value))
- #return (Type Value)}))
+ #return (Type Value)]))
(def: method_declaration
(Parser Method_Declaration)
@@ -819,9 +819,9 @@
(def: (constraint tv)
(-> (Type Var) Constraint)
- {#/type.name (parser.name tv)
+ [#/type.name (parser.name tv)
#/type.super_class java/lang/Object
- #/type.super_interfaces (list)})
+ #/type.super_interfaces (list)])
(def: visibility
(-> ffi.Privacy jvm.Visibility)
diff --git a/lux-jvm/source/luxc/lang/host/jvm.lux b/lux-jvm/source/luxc/lang/host/jvm.lux
index df9575ef4..44cc680eb 100644
--- a/lux-jvm/source/luxc/lang/host/jvm.lux
+++ b/lux-jvm/source/luxc/lang/host/jvm.lux
@@ -10,7 +10,7 @@
[data
[binary (#+ Binary)]
[collection
- ["." list ("#/." functor)]]]
+ ["." list ("#\." monad)]]]
[macro
["." code]
[syntax (#+ syntax:)]]
@@ -96,10 +96,10 @@
options (<code>.tuple (<>.many <code>.local_identifier))])
(let [g!type (code.local_identifier type)
g!none (code.local_identifier none)
- g!tags+ (list/each code.local_tag options)
+ g!tags+ (list\each code.local_tag options)
g!_left (code.local_identifier "_left")
g!_right (code.local_identifier "_right")
- g!options+ (list/each (function (_ option)
+ g!options+ (list\each (function (_ option)
(` (def: .public (~ (code.local_identifier option))
(~ g!type)
(|> (~ g!none)
@@ -107,22 +107,28 @@
options)]
(in (list& (` (type: .public (~ g!type)
(.Record
- (~ (code.record (list/each (function (_ tag)
- [tag (` .Bit)])
- g!tags+))))))
+ (~ (|> g!tags+
+ (list\each (function (_ tag)
+ (list tag (` .Bit))))
+ list\conjoint
+ code.tuple)))))
(` (def: .public (~ g!none)
(~ g!type)
- (~ (code.record (list/each (function (_ tag)
- [tag (` #0)])
- g!tags+)))))
+ (~ (|> g!tags+
+ (list\each (function (_ tag)
+ (list tag (` #0))))
+ list\conjoint
+ code.tuple))))
(` (def: .public ((~ (code.local_identifier ++)) (~ g!_left) (~ g!_right))
(-> (~ g!type) (~ g!type) (~ g!type))
- (~ (code.record (list/each (function (_ tag)
- [tag (` (or (value@ (~ tag) (~ g!_left))
- (value@ (~ tag) (~ g!_right))))])
- g!tags+)))))
+ (~ (|> g!tags+
+ (list\each (function (_ tag)
+ (list tag (` (or (value@ (~ tag) (~ g!_left))
+ (value@ (~ tag) (~ g!_right)))))))
+ list\conjoint
+ code.tuple))))
g!options+))))
diff --git a/lux-jvm/source/program.lux b/lux-jvm/source/program.lux
index 3a2e3a55b..304e2195f 100644
--- a/lux-jvm/source/program.lux
+++ b/lux-jvm/source/program.lux
@@ -234,14 +234,14 @@
[... host jvm/host.host
[loader host] jvm.host]
(in [loader
- {#platform.&file_system (file.async file.default)
+ [#platform.&file_system (file.async file.default)
#platform.host host
... #platform.phase jvm.generate
#platform.phase expression.translate
... #platform.runtime runtime.generate
#platform.runtime runtime.translate
#platform.phase_wrapper ..phase_wrapper
- #platform.write product.right}])))
+ #platform.write product.right]])))
(def: (extender phase_wrapper)
(-> phase.Wrapper Extender)
@@ -277,16 +277,16 @@
(async.future (\ world/program.default exit +0)))
(program: [service /cli.service]
- (let [static {#/static.host @.jvm
+ (let [static [#/static.host @.jvm
#/static.host_module_extension ".jvm"
#/static.target (/cli.target service)
- #/static.artifact_extension ".class"}]
+ #/static.artifact_extension ".class"]]
(exec (do async.monad
[[loader platform] (async.future ..platform)
- _ (/.compiler {#/static.host @.jvm
+ _ (/.compiler [#/static.host @.jvm
#/static.host_module_extension ".jvm"
#/static.target (/cli.target service)
- #/static.artifact_extension ".class"}
+ #/static.artifact_extension ".class"]
..expander
(analysis.bundle loader)
(io.io platform)
diff --git a/lux-lua/project.lux b/lux-lua/project.lux
index 855257f3f..4d0c10a35 100644
--- a/lux-lua/project.lux
+++ b/lux-lua/project.lux
@@ -1,5 +1,5 @@
{""
- {#identity ["com.github.luxlang" "lux-lua" "0.6.0-SNAPSHOT"]
+ [#identity ["com.github.luxlang" "lux-lua" "0.6.0-SNAPSHOT"]
#deploy_repositories {"snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
"releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"}
@@ -13,4 +13,4 @@
["net.sandius.rembulan" "rembulan-stdlib" "0.1-SNAPSHOT" "jar"]
["net.sandius.rembulan" "rembulan-compiler" "0.1-SNAPSHOT" "jar"]]
- #program "program"}}
+ #program "program"]}
diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux
index 0f153241d..a8e8c4e93 100644
--- a/lux-lua/source/program.lux
+++ b/lux-lua/source/program.lux
@@ -781,24 +781,24 @@
(do io.monad
[[baggage host] ..host]
(in [baggage
- {#platform.&file_system (file.async file.default)
+ [#platform.&file_system (file.async file.default)
#platform.host host
#platform.phase lua.generate
#platform.runtime runtime.generate
#platform.phase_wrapper ..phase_wrapper
- #platform.write (|>> _.code (\ utf8.codec encoded))}])))]
+ #platform.write (|>> _.code (\ utf8.codec encoded))]])))]
(for {@.old <jvm>
@.jvm <jvm>
@.lua (def: platform
(IO (Platform [Register _.Label] _.Expression _.Statement))
(do io.monad
[host ..host]
- (in {#platform.&file_system (file.async file.default)
+ (in [#platform.&file_system (file.async file.default)
#platform.host host
#platform.phase lua.generate
#platform.runtime runtime.generate
#platform.phase_wrapper ..phase_wrapper
- #platform.write (|>> _.code (\ utf8.codec encoded))})))}))
+ #platform.write (|>> _.code (\ utf8.codec encoded))])))}))
(def: (program context program)
(Program _.Expression _.Statement)
@@ -819,10 +819,10 @@
@.lua platform}))
..platform]
(exec (do async.monad
- [_ (/.compiler {#/static.host @.lua
+ [_ (/.compiler [#/static.host @.lua
#/static.host_module_extension extension
#/static.target (/cli.target service)
- #/static.artifact_extension extension}
+ #/static.artifact_extension extension]
(for {@.old (..expander baggage)
@.jvm (..expander baggage)
@.lua ..expander})
diff --git a/lux-php/source/program.lux b/lux-php/source/program.lux
index 13664b166..a756c18a8 100644
--- a/lux-php/source/program.lux
+++ b/lux-php/source/program.lux
@@ -155,7 +155,7 @@
(ffi.import: php/runtime/invoke/InvokeHelper
["#::."
("static" callAny [php/runtime/Memory [php/runtime/Memory] php/runtime/env/Environment php/runtime/env/TraceInfo]
- "try" php/runtime/Memory)])
+ "try" php/runtime/Memory)])
(ffi.import: php/runtime/lang/Closure
["#::."
@@ -504,11 +504,11 @@
(IO (Platform [Nat _.Label] _.Expression _.Statement))
(do io.monad
[host ..host]
- (wrap {#platform.&file_system (file.async file.default)
+ (wrap [#platform.&file_system (file.async file.default)
#platform.host host
#platform.phase php.generate
#platform.runtime runtime.generate
- #platform.write (|>> _.code (\ utf8.codec encoded))})))
+ #platform.write (|>> _.code (\ utf8.codec encoded))])))
(def: (program context program)
(Program _.Expression _.Statement)
@@ -561,10 +561,10 @@
(do io.monad
[platform ..platform]
(exec (do promise.monad
- [_ (/.compiler {#/static.host @.php
+ [_ (/.compiler [#/static.host @.php
#/static.host_module_extension extension
#/static.target (/cli.target service)
- #/static.artifact_extension extension}
+ #/static.artifact_extension extension]
..expander
analysis.bundle
(io.io platform)
diff --git a/lux-python/project.lux b/lux-python/project.lux
index f429d8687..57672fdea 100644
--- a/lux-python/project.lux
+++ b/lux-python/project.lux
@@ -1,5 +1,5 @@
{""
- {#identity ["com.github.luxlang" "lux-python" "0.6.0-SNAPSHOT"]
+ [#identity ["com.github.luxlang" "lux-python" "0.6.0-SNAPSHOT"]
#deploy_repositories {"snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
"releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"}
@@ -11,4 +11,4 @@
#dependencies [["com.github.luxlang" "stdlib" "0.6.0-SNAPSHOT" "tar"]
["org.python" "jython-standalone" "2.7.2" "jar"]]
- #program "program"}}
+ #program "program"]}
diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux
index 9ddb061e8..713d4e854 100644
--- a/lux-python/source/program.lux
+++ b/lux-python/source/program.lux
@@ -471,12 +471,12 @@
(IO (Platform Register (_.Expression Any) (_.Statement Any)))
(do io.monad
[host ..host]
- (in {#platform.&file_system (file.async file.default)
+ (in [#platform.&file_system (file.async file.default)
#platform.host host
#platform.phase python.generate
#platform.runtime runtime.generate
#platform.phase_wrapper ..phase_wrapper
- #platform.write (|>> _.code (\ utf8.codec encoded))})))
+ #platform.write (|>> _.code (\ utf8.codec encoded))])))
(def: (program context program)
(Program (_.Expression Any) (_.Statement Any))
@@ -512,10 +512,10 @@
(let [extension ".py"]
(exec
(do async.monad
- [_ (/.compiler {#/static.host @.python
+ [_ (/.compiler [#/static.host @.python
#/static.host_module_extension extension
#/static.target (/cli.target service)
- #/static.artifact_extension extension}
+ #/static.artifact_extension extension]
..expander
analysis.bundle
..platform
diff --git a/lux-r/source/program.lux b/lux-r/source/program.lux
index 8a5792e17..18f074100 100644
--- a/lux-r/source/program.lux
+++ b/lux-r/source/program.lux
@@ -543,11 +543,11 @@
(do io.monad
[[interpreter host] ..host]
(wrap [interpreter
- {#platform.&file_system (file.async file.default)
+ [#platform.&file_system (file.async file.default)
#platform.host host
#platform.phase r.generate
#platform.runtime runtime.generate
- #platform.write (|>> _.code (\ utf8.codec encoded))}])))
+ #platform.write (|>> _.code (\ utf8.codec encoded))]])))
(def: (program context program)
(Program _.Expression _.Expression)
@@ -594,10 +594,10 @@
(do io.monad
[[interpreter platform] ..platform]
(exec (do promise.monad
- [_ (/.compiler {#/static.host @.r
+ [_ (/.compiler [#/static.host @.r
#/static.host_module_extension extension
#/static.target (/cli.target service)
- #/static.artifact_extension extension}
+ #/static.artifact_extension extension]
(..expander interpreter)
analysis.bundle
(io.io platform)
diff --git a/lux-ruby/project.lux b/lux-ruby/project.lux
index 99f794bc8..b9e998cde 100644
--- a/lux-ruby/project.lux
+++ b/lux-ruby/project.lux
@@ -1,5 +1,5 @@
{""
- {#identity ["com.github.luxlang" "lux-ruby" "0.6.0-SNAPSHOT"]
+ [#identity ["com.github.luxlang" "lux-ruby" "0.6.0-SNAPSHOT"]
#description "A Ruby compiler for Lux."
#deploy_repositories {"snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
@@ -12,4 +12,4 @@
#dependencies [["com.github.luxlang" "stdlib" "0.6.0-SNAPSHOT" "tar"]
["org.jruby" "jruby-complete" "9.2.15.0" "jar"]]
- #program "program"}}
+ #program "program"]}
diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux
index c76b44b96..d2b32c0be 100644
--- a/lux-ruby/source/program.lux
+++ b/lux-ruby/source/program.lux
@@ -800,12 +800,12 @@
(IO (Platform Register _.Expression _.Statement))
(do io.monad
[host ..host]
- (in {#platform.&file_system (file.async file.default)
+ (in [#platform.&file_system (file.async file.default)
#platform.host host
#platform.phase ruby.generate
#platform.runtime runtime.generate
#platform.phase_wrapper ..phase_wrapper
- #platform.write (|>> _.code (\ utf8.codec encoded))})))
+ #platform.write (|>> _.code (\ utf8.codec encoded))])))
(def: (program context program)
(Program _.Expression _.Statement)
@@ -820,10 +820,10 @@
(program: [service /cli.service]
(let [extension ".rb"]
(exec (do async.monad
- [_ (/.compiler {#/static.host @.ruby
+ [_ (/.compiler [#/static.host @.ruby
#/static.host_module_extension extension
#/static.target (/cli.target service)
- #/static.artifact_extension extension}
+ #/static.artifact_extension extension]
..expander
analysis.bundle
..platform
diff --git a/lux-scheme/source/program.lux b/lux-scheme/source/program.lux
index 3371bb506..4e261a4de 100644
--- a/lux-scheme/source/program.lux
+++ b/lux-scheme/source/program.lux
@@ -395,11 +395,11 @@
(IO (Platform _.Var _.Expression _.Expression))
(do io.monad
[host ..host]
- (wrap {#platform.&file_system (file.async file.default)
+ (wrap [#platform.&file_system (file.async file.default)
#platform.host host
#platform.phase scheme.generate
#platform.runtime runtime.generate
- #platform.write (|>> _.code (\ encoding.utf8 encoded))})))
+ #platform.write (|>> _.code (\ encoding.utf8 encoded))])))
(def: (program context program)
(Program _.Expression _.Expression)
@@ -450,10 +450,10 @@
[platform ..platform
now instant.now]
(exec (do promise.monad
- [_ (/.compiler {#/static.host @.scheme
+ [_ (/.compiler [#/static.host @.scheme
#/static.host_module_extension extension
#/static.target (/cli.target service)
- #/static.artifact_extension extension}
+ #/static.artifact_extension extension]
..expander
analysis.bundle
(io.io platform)
diff --git a/stdlib/commands.md b/stdlib/commands.md
index dc74aa294..893e0d271 100644
--- a/stdlib/commands.md
+++ b/stdlib/commands.md
@@ -72,6 +72,10 @@ cd ~/lux/stdlib/ \
```
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
<tests>
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>)
+ [#obituary [(Async <Obituary>)
(Resolver <Obituary>)]
- #mailbox (Atom <Mailbox>)})
+ #mailbox (Atom <Mailbox>)])
(type: .public (Mail s)
<Mail>)
@@ -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 [<jvm> (as_is (ffi.import: (java/util/concurrent/atomic/AtomicReference a)
- ["#::."
- (new [a])
- (get [] a)
- (compareAndSet [a a] boolean)]))]
+(with_expansions [<jvm> (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>
@.jvm <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 (<modifier> (/.contains? output' options))
(#try.Success [[("lux i64 +" 1 offset) tape]
- {#basis offset
- #distance 1}])
+ [#basis offset
+ #distance 1]])
(exception.except <exception> [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 [<create> <color>]
[(def: (<create> key value left right)
(All (_ k v) (-> k v (Maybe (Node k v)) (Maybe (Node k v)) (Node k v)))
- {#color <color>
+ [#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@ <side> family)
(#.Item next side')
(#.Some (for {@.old
- {#family (#.Some (|> family
+ [#family (#.Some (|> family
(with@ <side> side')
(revised@ <op_side> (|>> (#.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> side')
(revised@ <op_side> (|>> (#.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@ <side> #.End)
(revised@ <op_side> (|>> (#.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@ <side> #.End)
(revised@ <op_side> (|>> (#.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 [<name> <target>]
[(def: .public (<name> 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 [<red> <green> <blue> <name>]
[(`` (def: .public <name>
Color
- (//.of_rgb {#//.red (hex <red>)
+ (//.of_rgb [#//.red (hex <red>)
#//.green (hex <green>)
- #//.blue (hex <blue>)})))]
+ #//.blue (hex <blue>)])))]
["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
_ (<binary>.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 <code>.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 (<code>.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 <code>.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 <code>.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 <code>.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 <code>.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?]
+ []]))
))
(<code>.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]]))))
(<code>.form (do <>.monad
[static? (<>.parses? (<code>.this! (' "static")))
name <code>.local_identifier
@@ -991,12 +992,12 @@
gtype (..type^ owner_vars)
maybe? (<>.parses? (<code>.this! (' "?")))
setter? (<>.parses? (<code>.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 (<code>.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 <code>.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 <code>.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 <code>.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 <code>.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?]
+ []]))))
(<code>.form (do <>.monad
[kind (: (Parser ImportMethodKind)
(<>.or (<code>.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]]))))
(<code>.form (do <>.monad
[static? (<>.parses? (<code>.this! (' "static")))
name <code>.local_identifier
@@ -938,12 +936,12 @@
gtype (..generic_type^ owner_vars)
maybe? (<>.parses? (<code>.this! (' "?")))
setter? (<>.parses? (<code>.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 [<name> <tag>]
[(def: .public <name>
@@ -33,8 +33,8 @@
(template [<code> <name> <definition> <alias>+]
[(def: .public <definition>
Language
- (:abstraction {#name <name>
- #code <code>}))
+ (:abstraction [#name <name>
+ #code <code>]))
(`` (template [<alias>]
[(def: .public <alias>
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 [<name> <field> <type>]
[(def: .public <name>
@@ -36,10 +36,10 @@
(template [<short> <long> <number> <name> <main> <neighbor>+]
[(def: .public <main>
Territory
- (:abstraction {#name <name>
+ (:abstraction [#name <name>
#short <short>
#long <long>
- #code <number>}))
+ #code <number>]))
(`` (template [<neighbor>]
[(def: .public <neighbor> Territory <main>)]
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] (<code>.form (<>.and <code>.local_identifier
(<>.many <code>.local_identifier)))
template (<code>.tuple (<>.some <code>.any))]
- (in {#name name
+ (in [#name name
#parameters parameters
- #template template})))
+ #template template])))
(syntax: .public (let [locals (<code>.tuple (<>.some ..local))
body <code>.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 [<name> <type> <side>]
[(def: .public <name>
@@ -110,10 +110,10 @@
(All (_ %) (-> (Mod %) (Mod %) (Mod %)))
(let [[modulus param] (:representation param)
[_ subject] (:representation subject)]
- (:abstraction {#modulus modulus
+ (:abstraction [#modulus modulus
#value (|> subject
(<op> 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 <code>.any
?imaginary (<>.maybe <code>.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 [<name> <op>]
[(def: .public (<name> param input)
(-> Complex Complex Complex)
- {#real (<op> (value@ #real param)
+ [#real (<op> (value@ #real param)
(value@ #real input))
#imaginary (<op> (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 [<name> <type> <op>]
[(def: .public (<name> 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 <code>.any
?denominator (<>.maybe <code>.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 [<name> <tag> <description>]
+ [(def: .public (<name> 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 (<tag> [exported? type group idx]))
+ (if (or (text\= this_module_name module)
+ exported?)
+ (in [idx (list\each (|>> [module]) group) type])
+ (..failure ($_ text\composite "Cannot access " <description> ": " (name\encoded tag_name) " from module " this_module_name)))
+
+ _
+ (..failure ($_ text\composite
+ "Unknown " <description> ": " (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<about>)
(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
(<method> (..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 <static?> 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 <consumption> $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 [<name> <limit>]
[(def: .public (<name> type)
(-> (Type Method) (Try Environment))
(do try.monad
[limit (<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 [<name> <registry>]
[(def: .public (<name> type)
(-> (Type Method) (Try Limit))
(do try.monad
[registry (<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 [<type> <equivalence> <writer>]
[(def: .public <equivalence>
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 [<name> <tag> <of>]
[(def: .public (<name> class member)
@@ -139,7 +139,7 @@
(do ..monad
[@class (..class (//name.internal class))
@name_and_type (name_and_type member)]
- (!add <tag> //.reference_equivalence {#//.class @class #//.name_and_type @name_and_type})))]
+ (!add <tag> //.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 [<name> <style>]
[(def: .public (<name> type)
diff --git a/stdlib/source/library/lux/target/php.lux b/stdlib/source/library/lux/target/php.lux
index a14b3e0ce..57fca8e65 100644
--- a/stdlib/source/library/lux/target/php.lux
+++ b/stdlib/source/library/lux/target/php.lux
@@ -94,8 +94,8 @@
(type: .public Argument
(Record
- {#reference? Bit
- #var Var}))
+ [#reference? Bit
+ #var Var]))
(def: .public ;
(-> Expression Statement)
@@ -477,9 +477,9 @@
(type: .public Except
(Record
- {#class Constant
+ [#class Constant
#exception Var
- #handler Statement}))
+ #handler Statement]))
(def: (catch except)
(-> Except Text)
diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux
index 6b24b6ae2..f0d4e23f2 100644
--- a/stdlib/source/library/lux/target/python.lux
+++ b/stdlib/source/library/lux/target/python.lux
@@ -396,9 +396,9 @@
(type: .public Except
(Record
- {#classes (List SVar)
+ [#classes (List SVar)
#exception SVar
- #handler (Statement Any)}))
+ #handler (Statement Any)]))
(def: .public (try body! excepts)
(-> (Statement Any) (List Except) (Statement Any))
diff --git a/stdlib/source/library/lux/target/ruby.lux b/stdlib/source/library/lux/target/ruby.lux
index fb1eaed26..501c4d1e7 100644
--- a/stdlib/source/library/lux/target/ruby.lux
+++ b/stdlib/source/library/lux/target/ruby.lux
@@ -308,9 +308,9 @@
(type: .public Rescue
(Record
- {#classes (List Text)
+ [#classes (List Text)
#exception LVar
- #rescue Statement}))
+ #rescue Statement]))
(def: .public (begin body! rescues)
(-> Statement (List Rescue) Statement)
diff --git a/stdlib/source/library/lux/target/scheme.lux b/stdlib/source/library/lux/target/scheme.lux
index 97aabfb76..5bce310fc 100644
--- a/stdlib/source/library/lux/target/scheme.lux
+++ b/stdlib/source/library/lux/target/scheme.lux
@@ -60,8 +60,8 @@
(type: .public Arguments
(Record
- {#mandatory (List Var)
- #rest (Maybe Var)}))
+ [#mandatory (List Var)
+ #rest (Maybe Var)]))
(def: .public manual
(-> Text Code)
diff --git a/stdlib/source/library/lux/test.lux b/stdlib/source/library/lux/test.lux
index b5275fa01..feab6c2f6 100644
--- a/stdlib/source/library/lux/test.lux
+++ b/stdlib/source/library/lux/test.lux
@@ -42,26 +42,26 @@
(type: .public Tally
(Record
- {#successes Nat
+ [#successes Nat
#failures Nat
#expected_coverage (Set Name)
- #actual_coverage (Set Name)}))
+ #actual_coverage (Set Name)]))
(def: (total parameter subject)
(-> Tally Tally Tally)
- {#successes (n.+ (value@ #successes parameter) (value@ #successes subject))
+ [#successes (n.+ (value@ #successes parameter) (value@ #successes subject))
#failures (n.+ (value@ #failures parameter) (value@ #failures subject))
#expected_coverage (set.union (value@ #expected_coverage parameter)
(value@ #expected_coverage subject))
#actual_coverage (set.union (value@ #actual_coverage parameter)
- (value@ #actual_coverage subject))})
+ (value@ #actual_coverage subject))])
(def: start
Tally
- {#successes 0
+ [#successes 0
#failures 0
#expected_coverage (set.empty name.hash)
- #actual_coverage (set.empty name.hash)})
+ #actual_coverage (set.empty name.hash)])
(template [<name> <category>]
[(def: <name>
diff --git a/stdlib/source/library/lux/time.lux b/stdlib/source/library/lux/time.lux
index 9b7ce7118..87556b1a8 100644
--- a/stdlib/source/library/lux/time.lux
+++ b/stdlib/source/library/lux/time.lux
@@ -169,10 +169,10 @@
(type: .public Clock
(Record
- {#hour Nat
+ [#hour Nat
#minute Nat
#second Nat
- #milli_second Nat}))
+ #milli_second Nat]))
(def: .public (clock time)
(-> Time Clock)
@@ -180,13 +180,13 @@
[hours time] [(duration.ticks duration.hour time) (duration.framed duration.hour time)]
[minutes time] [(duration.ticks duration.minute time) (duration.framed duration.minute time)]
[seconds millis] [(duration.ticks duration.second time) (duration.framed duration.second time)]]
- {#hour (.nat hours)
+ [#hour (.nat hours)
#minute (.nat minutes)
#second (.nat seconds)
#milli_second (|> millis
(..positive duration.second)
duration.millis
- .nat)}))
+ .nat)]))
(def: .public (time clock)
(-> Clock (Try Time))
diff --git a/stdlib/source/library/lux/time/date.lux b/stdlib/source/library/lux/time/date.lux
index 559638614..d606449c5 100644
--- a/stdlib/source/library/lux/time/date.lux
+++ b/stdlib/source/library/lux/time/date.lux
@@ -71,9 +71,9 @@
{}
(Record
- {#year Year
+ [#year Year
#month Month
- #day Nat})
+ #day Nat])
(def: .public (date year month day_of_month)
(-> Year Month Nat (Try Date))
@@ -81,9 +81,9 @@
(exception.except ..invalid_day [year month day_of_month])
(#try.Success
(:abstraction
- {#year year
+ [#year year
#month month
- #day day_of_month}))))
+ #day day_of_month]))))
(def: .public epoch
Date
diff --git a/stdlib/source/library/lux/tool/compiler.lux b/stdlib/source/library/lux/tool/compiler.lux
index b1408854c..5bb3c0fd2 100644
--- a/stdlib/source/library/lux/tool/compiler.lux
+++ b/stdlib/source/library/lux/tool/compiler.lux
@@ -26,17 +26,17 @@
(type: .public Input
(Record
- {#module Module
+ [#module Module
#file Path
#hash Nat
- #code Code}))
+ #code Code]))
(type: .public (Compilation s d o)
(Record
- {#dependencies (List Module)
+ [#dependencies (List Module)
#process (-> s Archive
(Try [s (Either (Compilation s d o)
- [Descriptor (Document d) Output])]))}))
+ [Descriptor (Document d) Output])]))]))
(type: .public (Compiler s d o)
(-> Input (Compilation s d o)))
diff --git a/stdlib/source/library/lux/tool/compiler/default/init.lux b/stdlib/source/library/lux/tool/compiler/default/init.lux
index 2bbbb5ede..7748186b2 100644
--- a/stdlib/source/library/lux/tool/compiler/default/init.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/init.lux
@@ -67,12 +67,12 @@
analysis_state [(analysisE.bundle eval host_analysis)
(///analysis.state (///analysis.info ///version.version target))]]
[extension.empty
- {#///directive.analysis {#///directive.state analysis_state
- #///directive.phase (analysisP.phase expander)}
- #///directive.synthesis {#///directive.state synthesis_state
- #///directive.phase synthesisP.phase}
- #///directive.generation {#///directive.state generation_state
- #///directive.phase generate}}]))
+ [#///directive.analysis [#///directive.state analysis_state
+ #///directive.phase (analysisP.phase expander)]
+ #///directive.synthesis [#///directive.state synthesis_state
+ #///directive.phase synthesisP.phase]
+ #///directive.generation [#///directive.state generation_state
+ #///directive.phase generate]]]))
(def: .public (with_default_directives expander host_analysis program anchorT,expressionT,directiveT extender)
(All (_ anchor expression directive)
@@ -235,7 +235,7 @@
(let [execute! (directiveP.phase wrapper expander)]
(function (_ key parameters input)
(let [dependencies (default_dependencies prelude input)]
- {#///.dependencies dependencies
+ [#///.dependencies dependencies
#///.process (function (_ state archive)
(do {! try.monad}
[.let [hash (text\hash (value@ #///.code input))]
@@ -250,12 +250,12 @@
#.None
(do !
[[state [analysis_module [final_buffer final_registry]]] (///phase.result' state (..end module))
- .let [descriptor {#descriptor.hash hash
+ .let [descriptor [#descriptor.hash hash
#descriptor.name module
#descriptor.file (value@ #///.file input)
#descriptor.references (set.of_list text.hash dependencies)
#descriptor.state #.Compiled
- #descriptor.registry final_registry}]]
+ #descriptor.registry final_registry]]]
(in [state
(#.Right [descriptor
(document.write key analysis_module)
@@ -266,7 +266,7 @@
(#.Some [source requirements temporary_payload])
(let [[temporary_buffer temporary_registry] temporary_payload]
(in [state
- (#.Left {#///.dependencies (|> requirements
+ (#.Left [#///.dependencies (|> requirements
(value@ #///directive.imports)
(list\each product.left))
#///.process (function (_ state archive)
@@ -284,5 +284,5 @@
(value@ #///directive.referrals)
(monad.each ! (execute! archive)))
temporary_payload (..get_current_payload temporary_payload)]
- (..iteration wrapper archive expander module source temporary_payload (..module_aliases analysis_module))))))})]))
- )))))}))))
+ (..iteration wrapper archive expander module source temporary_payload (..module_aliases analysis_module))))))])]))
+ )))))]))))
diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux
index 33c22c1f7..0452ef5b6 100644
--- a/stdlib/source/library/lux/tool/compiler/default/platform.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux
@@ -66,12 +66,12 @@
<Operation> (as_is ///generation.Operation <type_vars>)]
(type: .public (Platform <type_vars>)
(Record
- {#&file_system (file.System Async)
+ [#&file_system (file.System Async)
#host (///generation.Host expression directive)
#phase (///generation.Phase <type_vars>)
#runtime (<Operation> [Registry Output])
#phase_wrapper (-> Archive (<Operation> ///phase.Wrapper))
- #write (-> directive Binary)}))
+ #write (-> directive Binary)]))
... TODO: Get rid of this
(type: (Action a)
@@ -131,12 +131,12 @@
(def: (runtime_descriptor registry)
(-> Registry Descriptor)
- {#descriptor.hash 0
+ [#descriptor.hash 0
#descriptor.name archive.runtime_module
#descriptor.file ""
#descriptor.references (set.empty text.hash)
#descriptor.state #.Compiled
- #descriptor.registry registry})
+ #descriptor.registry registry])
(def: runtime_document
(Document .Module)
@@ -304,14 +304,14 @@
(type: Dependence
(Record
- {#depends_on Mapping
- #depended_by Mapping}))
+ [#depends_on Mapping
+ #depended_by Mapping]))
(def: independence
Dependence
(let [empty (dictionary.empty text.hash)]
- {#depends_on empty
- #depended_by empty}))
+ [#depends_on empty
+ #depended_by empty]))
(def: (depend module import dependence)
(-> Module Module Dependence Dependence)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux.lux
index 5bb42e533..5ad1e959e 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux.lux
@@ -92,6 +92,6 @@
(def: .public key
(Key .Module)
- (key.key {#signature.name (name_of ..compiler)
- #signature.version /version.version}
+ (key.key [#signature.name (name_of ..compiler)
+ #signature.version /version.version]
(module.empty 0)))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
index 326c95b78..bdc195879 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
@@ -50,9 +50,9 @@
(type: .public (Variant a)
(Record
- {#lefts Nat
+ [#lefts Nat
#right? Bit
- #value a}))
+ #value a]))
(def: .public (tag lefts right?)
(-> Nat Bit Nat)
@@ -89,8 +89,8 @@
(type: .public (Branch' e)
(Record
- {#when Pattern
- #then e}))
+ [#when Pattern
+ #then e]))
(type: .public (Match' e)
[(Branch' e) (List (Branch' e))])
@@ -421,15 +421,15 @@
(def: fresh_bindings
(All (_ k v) (Bindings k v))
- {#.counter 0
- #.mappings (list)})
+ [#.counter 0
+ #.mappings (list)])
(def: fresh_scope
Scope
- {#.name (list)
+ [#.name (list)
#.inner 0
#.locals fresh_bindings
- #.captured fresh_bindings})
+ #.captured fresh_bindings])
(def: .public (with_scope action)
(All (_ a) (-> (Operation a) (Operation [Scope a])))
@@ -538,19 +538,19 @@
(def: type_context
Type_Context
- {#.ex_counter 0
+ [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)})
+ #.var_bindings (list)])
(def: .public (info version host)
(-> Version Text Info)
- {#.target host
+ [#.target host
#.version (%.nat version)
- #.mode #.Build})
+ #.mode #.Build])
(def: .public (state info)
(-> Info Lux)
- {#.info info
+ [#.info info
#.source ..dummy_source
#.location location.dummy
#.current_module #.None
@@ -562,4 +562,4 @@
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []})
+ #.host []])
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/directive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/directive.lux
index e5fb06e7d..ea9d244af 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/directive.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/directive.lux
@@ -22,37 +22,37 @@
(type: .public (Component state phase)
(Record
- {#state state
- #phase phase}))
+ [#state state
+ #phase phase]))
(type: .public (State anchor expression directive)
(Record
- {#analysis (Component analysis.State+
+ [#analysis (Component analysis.State+
analysis.Phase)
#synthesis (Component synthesis.State+
synthesis.Phase)
#generation (Component (generation.State+ anchor expression directive)
- (generation.Phase anchor expression directive))}))
+ (generation.Phase anchor expression directive))]))
(type: .public Import
(Record
- {#module Module
- #alias Text}))
+ [#module Module
+ #alias Text]))
(type: .public Requirements
(Record
- {#imports (List Import)
- #referrals (List Code)}))
+ [#imports (List Import)
+ #referrals (List Code)]))
(def: .public no_requirements
Requirements
- {#imports (list)
- #referrals (list)})
+ [#imports (list)
+ #referrals (list)])
(def: .public (merge_requirements left right)
(-> Requirements Requirements Requirements)
- {#imports (list\composite (value@ #imports left) (value@ #imports right))
- #referrals (list\composite (value@ #referrals left) (value@ #referrals right))})
+ [#imports (list\composite (value@ #imports left) (value@ #imports right))
+ #referrals (list\composite (value@ #referrals left) (value@ #referrals right))])
(template [<special> <general>]
[(type: .public (<special> anchor expression directive)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux
index 6f9a03763..91b758c78 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux
@@ -67,14 +67,14 @@
(type: .public (State anchor expression directive)
(Record
- {#module Module
+ [#module Module
#anchor (Maybe anchor)
#host (Host expression directive)
#buffer (Maybe (Buffer directive))
#registry artifact.Registry
#counter Nat
#context (Maybe artifact.ID)
- #log (Row Text)}))
+ #log (Row Text)]))
(template [<special> <general>]
[(type: .public (<special> anchor expression directive)
@@ -93,14 +93,14 @@
(-> (Host expression directive)
Module
(..State anchor expression directive)))
- {#module module
+ [#module module
#anchor #.None
#host host
#buffer #.None
#registry artifact.empty
#counter 0
#context #.None
- #log row.empty})
+ #log row.empty])
(def: .public empty_buffer Buffer row.empty)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux
index c8cfe9c0e..9f5e6d12a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux
@@ -37,8 +37,8 @@
(type: (Fix a)
(-> a a))
-(def: (compile|primitive else code')
- (Fix (-> (Code' (Ann Location)) (Operation Analysis)))
+(def: (compile|literal archive compile else code')
+ (-> Archive Phase (Fix (-> (Code' (Ann Location)) (Operation Analysis))))
(case code'
(^template [<tag> <analyser>]
[(<tag> value)
@@ -50,12 +50,6 @@
[#.Frac /primitive.frac]
[#.Text /primitive.text])
- _
- (else code')))
-
-(def: (compile|structure archive compile else code')
- (-> Archive Phase (Fix (-> (Code' (Ann Location)) (Operation Analysis))))
- (case code'
(^ (#.Form (list& [_ (#.Tag tag)]
values)))
(case values
@@ -77,17 +71,8 @@
(#.Tag tag)
(/structure.tagged_sum compile tag archive (' []))
- (^ (#.Tuple (list)))
- /primitive.unit
-
- (^ (#.Tuple (list singleton)))
- (compile archive singleton)
-
(^ (#.Tuple elems))
- (/structure.product archive compile elems)
-
- (^ (#.Record pairs))
- (/structure.record archive compile pairs)
+ (/structure.record archive compile elems)
_
(else code')))
@@ -139,6 +124,6 @@
... The location must be set in the state for the sake
... of having useful error messages.
(/.with_location location
- (compile|primitive (compile|structure archive compile
- (compile|others expander archive compile))
- code')))))
+ (compile|literal archive compile
+ (compile|others expander archive compile)
+ code')))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
index d008fde0e..9777b1a31 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
@@ -188,66 +188,74 @@
(analyse_pattern #.None inputT singleton next)
[location (#.Tuple sub_patterns)]
- (/.with_location location
- (do {! ///.monad}
- [inputT' (simplify_case inputT)]
- (.case inputT'
- (#.Product _)
- (let [matches (loop [types (type.flat_tuple inputT')
- patterns sub_patterns
- output (: (List [Type Code])
- #.End)]
- (.case [types patterns]
- [#.End #.End]
- output
-
- [(#.Item headT #.End) (#.Item headP #.End)]
- (#.Item [headT headP] output)
-
- [remainingT (#.Item headP #.End)]
- (#.Item [(type.tuple remainingT) headP] output)
-
- [(#.Item headT #.End) remainingP]
- (#.Item [headT (code.tuple remainingP)] output)
-
- [(#.Item headT tailT) (#.Item headP tailP)]
- (recur tailT tailP (#.Item [headT headP] output))
-
- _
- (undefined)))]
- (do !
- [[memberP+ thenA] (list\mix (: (All (_ a)
- (-> [Type Code] (Operation [(List Pattern) a])
- (Operation [(List Pattern) a])))
- (function (_ [memberT memberC] then)
- (do !
- [[memberP [memberP+ thenA]] ((:as (All (_ a) (-> (Maybe Nat) Type Code (Operation a) (Operation [Pattern a])))
- analyse_pattern)
- #.None memberT memberC then)]
- (in [(list& memberP memberP+) thenA]))))
- (do !
- [nextA next]
- (in [(list) nextA]))
- matches)]
- (in [(/.pattern/tuple memberP+)
- thenA])))
-
- _
- (/.except ..cannot_match_with_pattern [inputT' pattern])
- )))
+ (do {! ///.monad}
+ [record (//structure.normal sub_patterns)
+ record_size,members,recordT (: (Operation (Maybe [Nat (List Code) Type]))
+ (.case record
+ (#.Some record)
+ (//structure.order record)
+
+ #.None
+ (in #.None)))]
+ (.case record_size,members,recordT
+ (#.Some [record_size members recordT])
+ (do !
+ [_ (.case inputT
+ (#.Var _id)
+ (//type.with_env
+ (check.check inputT recordT))
+
+ _
+ (in []))]
+ (analyse_pattern (#.Some record_size) inputT [location (#.Tuple members)] next))
+
+ #.None
+ (/.with_location location
+ (do {! ///.monad}
+ [inputT' (simplify_case inputT)]
+ (.case inputT'
+ (#.Product _)
+ (let [matches (loop [types (type.flat_tuple inputT')
+ patterns sub_patterns
+ output (: (List [Type Code])
+ #.End)]
+ (.case [types patterns]
+ [#.End #.End]
+ output
+
+ [(#.Item headT #.End) (#.Item headP #.End)]
+ (#.Item [headT headP] output)
+
+ [remainingT (#.Item headP #.End)]
+ (#.Item [(type.tuple remainingT) headP] output)
+
+ [(#.Item headT #.End) remainingP]
+ (#.Item [headT (code.tuple remainingP)] output)
+
+ [(#.Item headT tailT) (#.Item headP tailP)]
+ (recur tailT tailP (#.Item [headT headP] output))
+
+ _
+ (undefined)))]
+ (do !
+ [[memberP+ thenA] (list\mix (: (All (_ a)
+ (-> [Type Code] (Operation [(List Pattern) a])
+ (Operation [(List Pattern) a])))
+ (function (_ [memberT memberC] then)
+ (do !
+ [[memberP [memberP+ thenA]] ((:as (All (_ a) (-> (Maybe Nat) Type Code (Operation a) (Operation [Pattern a])))
+ analyse_pattern)
+ #.None memberT memberC then)]
+ (in [(list& memberP memberP+) thenA]))))
+ (do !
+ [nextA next]
+ (in [(list) nextA]))
+ matches)]
+ (in [(/.pattern/tuple memberP+)
+ thenA])))
- [location (#.Record record)]
- (do ///.monad
- [record (//structure.normal record)
- [record_size members recordT] (//structure.order record)
- _ (.case inputT
- (#.Var _id)
- (//type.with_env
- (check.check inputT recordT))
-
- _
- (in []))]
- (analyse_pattern (#.Some record_size) inputT [location (#.Tuple members)] next))
+ _
+ (/.except ..cannot_match_with_pattern [inputT' pattern]))))))
[location (#.Tag tag)]
(/.with_location location
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux
index b6817b6c8..0499c2d8a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux
@@ -73,12 +73,12 @@
(def: .public (empty hash)
(-> Nat Module)
- {#.module_hash hash
+ [#.module_hash hash
#.module_aliases (list)
#.definitions (list)
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active})
+ #.module_state #.Active])
(def: .public (set_annotations annotations)
(-> Code (Operation Any))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
index 0d01a4936..17423da65 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
@@ -144,8 +144,8 @@
(template [<name> <val_type>]
[(def: <name>
(Bindings Text [Type <val_type>])
- {#.counter 0
- #.mappings (list)})]
+ [#.counter 0
+ #.mappings (list)])]
[init_locals Nat]
[init_captured Variable]
@@ -153,10 +153,10 @@
(def: (scope parent_name child_name)
(-> (List Text) Text Scope)
- {#.name (list& child_name parent_name)
+ [#.name (list& child_name parent_name)
#.inner 0
#.locals init_locals
- #.captured init_captured})
+ #.captured init_captured])
(def: .public (with_scope name action)
(All (_ a) (-> Text (Operation a) (Operation a)))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux
index f44670a38..2d6d3140c 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux
@@ -6,7 +6,8 @@
["." monad (#+ do)]]
[control
["." maybe]
- ["ex" exception (#+ exception:)]
+ ["." try]
+ ["." exception (#+ exception:)]
["." state]]
[data
["." name]
@@ -37,14 +38,16 @@
[archive (#+ Archive)]]]]]])
(exception: .public (invalid_variant_type {type Type} {tag Tag} {code Code})
- (ex.report ["Type" (%.type type)]
- ["Tag" (%.nat tag)]
- ["Expression" (%.code code)]))
+ (exception.report
+ ["Type" (%.type type)]
+ ["Tag" (%.nat tag)]
+ ["Expression" (%.code code)]))
(template [<name>]
[(exception: .public (<name> {type Type} {members (List Code)})
- (ex.report ["Type" (%.type type)]
- ["Expression" (%.code (` [(~+ members)]))]))]
+ (exception.report
+ ["Type" (%.type type)]
+ ["Expression" (%.code (` [(~+ members)]))]))]
[invalid_tuple_type]
[cannot_analyse_tuple]
@@ -55,40 +58,40 @@
(template [<name>]
[(exception: .public (<name> {type Type} {tag Tag} {code Code})
- (ex.report ["Type" (%.type type)]
- ["Tag" (%.nat tag)]
- ["Expression" (%.code code)]))]
+ (exception.report
+ ["Type" (%.type type)]
+ ["Tag" (%.nat tag)]
+ ["Expression" (%.code code)]))]
[cannot_analyse_variant]
[cannot_infer_numeric_tag]
)
-(exception: .public (record_keys_must_be_tags {key Code} {record (List [Code Code])})
- (ex.report ["Key" (%.code key)]
- ["Record" (%.code (code.record record))]))
-
(template [<name>]
[(exception: .public (<name> {key Name} {record (List [Name Code])})
- (ex.report ["Tag" (%.code (code.tag key))]
- ["Record" (%.code (code.record (list\each (function (_ [keyI valC])
- [(code.tag keyI) valC])
- record)))]))]
+ (exception.report
+ ["Tag" (%.code (code.tag key))]
+ ["Record" (%.code (code.record (list\each (function (_ [keyI valC])
+ [(code.tag keyI) valC])
+ record)))]))]
[cannot_repeat_tag]
)
-(exception: .public (tag_does_not_belong_to_record {key Name} {type Type})
- (ex.report ["Tag" (%.code (code.tag key))]
- ["Type" (%.type type)]))
+(exception: .public (slot_does_not_belong_to_record {key Name} {type Type})
+ (exception.report
+ ["Tag" (%.code (code.tag key))]
+ ["Type" (%.type type)]))
(exception: .public (record_size_mismatch {expected Nat} {actual Nat} {type Type} {record (List [Name Code])})
- (ex.report ["Expected" (%.nat expected)]
- ["Actual" (%.nat actual)]
- ["Type" (%.type type)]
- ["Expression" (%.code (|> record
- (list\each (function (_ [keyI valueC])
- [(code.tag keyI) valueC]))
- code.record))]))
+ (exception.report
+ ["Expected" (%.nat expected)]
+ ["Actual" (%.nat actual)]
+ ["Type" (%.type type)]
+ ["Expression" (%.code (|> record
+ (list\each (function (_ [keyI valueC])
+ [(code.tag keyI) valueC]))
+ code.record))]))
(def: .public (sum analyse lefts right? archive)
(-> Phase Nat Bit Phase)
@@ -174,6 +177,12 @@
(loop [membersT+ (type.flat_tuple expectedT)
membersC+ members]
(case [membersT+ membersC+]
+ [(#.Item memberT #.End) (#.Item memberC #.End)]
+ (do !
+ [memberA (//type.with_type memberT
+ (analyse archive memberC))]
+ (in (list memberA)))
+
[(#.Item memberT #.End) _]
(//type.with_type memberT
(\ ! each (|>> list) (analyse archive (code.tuple membersC+))))
@@ -188,7 +197,7 @@
(analyse archive memberC))
memberA+ (recur membersT+' membersC+')]
(in (#.Item memberA memberA+)))
-
+
_
(/.except ..cannot_analyse_tuple [expectedT members]))))]
(in (/.tuple membersA+))))
@@ -284,81 +293,117 @@
... Normalization just means that all the tags get resolved to their
... canonical form (with their corresponding module identified).
(def: .public (normal record)
- (-> (List [Code Code]) (Operation (List [Name Code])))
- (monad.each ///.monad
- (function (_ [key val])
- (case key
- [_ (#.Tag key)]
- (do ///.monad
- [key (///extension.lifted (meta.normal key))]
- (in [key val]))
+ (-> (List Code) (Operation (Maybe (List [Name Code]))))
+ (loop [input record
+ output (: (List [Name Code])
+ #.End)]
+ (case input
+ (^ (list& [_ (#.Tag slotH)] valueH tail))
+ (do ///.monad
+ [slotH (///extension.lifted (meta.normal slotH))]
+ (recur tail (#.Item [slotH valueH] output)))
+
+ #.End
+ (\ ///.monad in (#.Some output))
- _
- (/.except ..record_keys_must_be_tags [key record])))
- record))
+ _
+ (\ ///.monad in #.None))))
... Lux already possesses the means to analyse tuples, so
... re-implementing the same functionality for records makes no sense.
... Records, thus, get transformed into tuples by ordering the elements.
(def: .public (order record)
- (-> (List [Name Code]) (Operation [Nat (List Code) Type]))
+ (-> (List [Name Code]) (Operation (Maybe [Nat (List Code) Type])))
(case record
... empty_record = empty_tuple = unit/any = []
#.End
- (\ ///.monad in [0 (list) Any])
+ (\ ///.monad in (#.Some [0 (list) Any]))
(#.Item [head_k head_v] _)
(do {! ///.monad}
- [head_k (///extension.lifted (meta.normal head_k))
- [_ tag_set recordT] (///extension.lifted (meta.tag head_k))
- .let [size_record (list.size record)
- size_ts (list.size tag_set)]
- _ (if (n.= size_ts size_record)
- (in [])
- (/.except ..record_size_mismatch [size_ts size_record recordT record]))
- .let [tuple_range (list.indices size_ts)
- tag->idx (dictionary.of_list name.hash (list.zipped/2 tag_set tuple_range))]
- idx->val (monad.mix !
- (function (_ [key val] idx->val)
- (do !
- [key (///extension.lifted (meta.normal key))]
- (case (dictionary.value key tag->idx)
- (#.Some idx)
- (if (dictionary.key? idx->val idx)
- (/.except ..cannot_repeat_tag [key record])
- (in (dictionary.has idx val idx->val)))
-
- #.None
- (/.except ..tag_does_not_belong_to_record [key recordT]))))
- (: (Dictionary Nat Code)
- (dictionary.empty n.hash))
- record)
- .let [ordered_tuple (list\each (function (_ idx)
- (maybe.trusted (dictionary.value idx idx->val)))
- tuple_range)]]
- (in [size_ts ordered_tuple recordT]))
+ [slotH' (///extension.lifted
+ (do meta.monad
+ [head_k (meta.normal head_k)]
+ (meta.try (meta.slot head_k))))]
+ (case slotH'
+ (#try.Success [_ slot_set recordT])
+ (do !
+ [.let [size_record (list.size record)
+ size_ts (list.size slot_set)]
+ _ (if (n.= size_ts size_record)
+ (in [])
+ (/.except ..record_size_mismatch [size_ts size_record recordT record]))
+ .let [tuple_range (list.indices size_ts)
+ tag->idx (dictionary.of_list name.hash (list.zipped/2 slot_set tuple_range))]
+ idx->val (monad.mix !
+ (function (_ [key val] idx->val)
+ (do !
+ [key (///extension.lifted (meta.normal key))]
+ (case (dictionary.value key tag->idx)
+ (#.Some idx)
+ (if (dictionary.key? idx->val idx)
+ (/.except ..cannot_repeat_tag [key record])
+ (in (dictionary.has idx val idx->val)))
+
+ #.None
+ (/.except ..slot_does_not_belong_to_record [key recordT]))))
+ (: (Dictionary Nat Code)
+ (dictionary.empty n.hash))
+ record)
+ .let [ordered_tuple (list\each (function (_ idx)
+ (maybe.trusted (dictionary.value idx idx->val)))
+ tuple_range)]]
+ (in (#.Some [size_ts ordered_tuple recordT])))
+
+ (#try.Failure error)
+ (in #.None)))
))
(def: .public (record archive analyse members)
- (-> Archive Phase (List [Code Code]) (Operation Analysis))
+ (-> Archive Phase (List Code) (Operation Analysis))
(case members
(^ (list))
//primitive.unit
- (^ (list [_ singletonC]))
+ (^ (list singletonC))
(analyse archive singletonC)
+ (^ (list [_ (#.Tag pseudo_slot)] singletonC))
+ (do {! ///.monad}
+ [head_k (///extension.lifted (meta.normal pseudo_slot))
+ slot (///extension.lifted (meta.try (meta.slot head_k)))]
+ (case slot
+ (#try.Success [_ slot_set recordT])
+ (case (list.size slot_set)
+ 1 (analyse archive singletonC)
+ _ (..product archive analyse members))
+
+ _
+ (..product archive analyse members)))
+
_
(do {! ///.monad}
- [members (normal members)
- [record_size membersC recordT] (..order members)
- expectedT (///extension.lifted meta.expected_type)]
- (case expectedT
- (#.Var _)
+ [?members (normal members)]
+ (case ?members
+ #.None
+ (..product archive analyse members)
+
+ (#.Some slots)
(do !
- [inferenceT (//inference.record record_size recordT)
- [inferredT membersA] (//inference.general archive analyse inferenceT membersC)]
- (in (/.tuple membersA)))
+ [record_size,membersC,recordT (..order slots)]
+ (case record_size,membersC,recordT
+ #.None
+ (..product archive analyse members)
- _
- (..product archive analyse membersC)))))
+ (#.Some [record_size membersC recordT])
+ (do !
+ [expectedT (///extension.lifted meta.expected_type)]
+ (case expectedT
+ (#.Var _)
+ (do !
+ [inferenceT (//inference.record record_size recordT)
+ [inferredT membersA] (//inference.general archive analyse inferenceT membersC)]
+ (in (/.tuple membersA)))
+
+ _
+ (..product archive analyse membersC)))))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux
index f47780c61..e89d68ac8 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux
@@ -52,8 +52,8 @@
(type: .public (State s i o)
(Record
- {#bundle (Bundle s i o)
- #state s}))
+ [#bundle (Bundle s i o)
+ #state s]))
(type: .public (Operation s i o v)
(//.Operation (State s i o) v))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
index 05a6aa294..7efd44bcd 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
@@ -190,8 +190,8 @@
(type: Member
(Record
- {#class External
- #member Text}))
+ [#class External
+ #member Text]))
(def: member
(Parser Member)
@@ -199,9 +199,9 @@
(type: Method_Signature
(Record
- {#method .Type
+ [#method .Type
#deprecated? Bit
- #exceptions (List .Type)}))
+ #exceptions (List .Type)]))
(template [<name>]
[(exception: .public (<name> {type .Type})
@@ -1959,23 +1959,23 @@
2
(#/////analysis.Case (/////analysis.unit)
- [{#/////analysis.when
+ [[#/////analysis.when
(#/////analysis.Bind 2)
#/////analysis.then
- bodyA}
+ bodyA]
(list)])
_
(#/////analysis.Case (/////analysis.unit)
- [{#/////analysis.when
+ [[#/////analysis.when
(#/////analysis.Complex
(#/////analysis.Tuple (|> arity
list.indices
(list\each (|>> (n.+ 2) #/////analysis.Bind)))))
#/////analysis.then
- bodyA}
+ bodyA]
(list)]))))
(def: .public (analyse_overriden_method analyse archive selfT mapping supers method)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
index 02037b6b0..c7e17a992 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
@@ -171,9 +171,9 @@
(def: (constraint name)
(-> Text Constraint)
- {#type.name name
+ [#type.name name
#type.super_class (type.class "java.lang.Object" (list))
- #type.super_interfaces (list)})
+ #type.super_interfaces (list)])
(def: constant::modifier
(Modifier field.Field)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
index f2ffaccae..46dd5d709 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
@@ -240,8 +240,9 @@
(All (_ anchor expression directive)
(-> (List Text) Type (Operation anchor expression directive (List Any))))
(/////directive.lifted_generation
- (monad.each phase.monad (function (_ tag)
- (/////generation.log! (format "#" tag " : Tag of " (%.type owner))))
+ (monad.each phase.monad
+ (function (_ tag)
+ (/////generation.log! (format "#" tag " : Tag of " (%.type owner))))
tags)))
(def: (def::type_tagged expander host_analysis)
@@ -308,8 +309,8 @@
_ (module.alias alias module))))
imports)]
(module.set_annotations annotationsV)))]
- (in {#/////directive.imports imports
- #/////directive.referrals (list)})))]))
+ (in [#/////directive.imports imports
+ #/////directive.referrals (list)])))]))
(exception: .public (cannot_alias_an_alias {local Alias} {foreign Alias} {target Name})
(exception.report
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux
index f5bde1d64..41d204e66 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux
@@ -317,9 +317,9 @@
(_.set! value (_.apply/1 op [..unit]))
(_.return (..right value)))
(list (with_vars [error]
- {#_.class (_.constant "Exception")
+ [#_.class (_.constant "Exception")
#_.exception error
- #_.handler (_.return (..left (_.do "getMessage" (list) error)))})))))
+ #_.handler (_.return (..left (_.do "getMessage" (list) error)))])))))
(runtime: (lux//program_args inputs)
(with_vars [head tail]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux
index 4cfc0dc5d..4347ace80 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux
@@ -318,13 +318,13 @@
(type: .public Storage
(Record
- {#bindings (Set Register)
- #dependencies (Set Variable)}))
+ [#bindings (Set Register)
+ #dependencies (Set Variable)]))
(def: empty
Storage
- {#bindings (set.empty n.hash)
- #dependencies (set.empty ///reference/variable.hash)})
+ [#bindings (set.empty n.hash)
+ #dependencies (set.empty ///reference/variable.hash)])
... TODO: Use this to declare all local variables at the beginning of
... script functions.
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux
index 84d91d48d..40689678f 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux
@@ -257,21 +257,21 @@
(|> bodyS'
(grow env')
(\ ! each (function (_ body)
- {#/.environment environment
+ [#/.environment environment
#/.arity (++ down_arity')
- #/.body body})))
+ #/.body body])))
_
- (in {#/.environment environment
+ (in [#/.environment environment
#/.arity 1
- #/.body bodyS})))]
+ #/.body bodyS])))]
(in (if currying?
(/.function/abstraction abstraction)
(case (//loop.optimization false 1 (list) abstraction)
(#.Some [startL initsL bodyL])
- (/.function/abstraction {#/.environment environment
+ (/.function/abstraction [#/.environment environment
#/.arity (value@ #/.arity abstraction)
- #/.body (/.loop/scope [startL initsL bodyL])})
+ #/.body (/.loop/scope [startL initsL bodyL])])
#.None
(/.function/abstraction abstraction))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
index 882a8c5d6..b4e79bd6d 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
@@ -144,9 +144,9 @@
(value@ #/.inits)
(monad.each ! (recur false)))
iteration' (recur return? (value@ #/.iteration scope))]
- (in (/.loop/scope {#/.start (|> scope (value@ #/.start) (register_optimization offset))
+ (in (/.loop/scope [#/.start (|> scope (value@ #/.start) (register_optimization offset))
#/.inits inits'
- #/.iteration iteration'})))
+ #/.iteration iteration'])))
(^ (/.loop/recur args))
(|> args
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux
index ec9c6d81e..9b4e1ad57 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux
@@ -39,9 +39,9 @@
(type: .public State
(Record
- {#locals Nat
+ [#locals Nat
... https://en.wikipedia.org/wiki/Currying
- #currying? Bit}))
+ #currying? Bit]))
(def: .public fresh_resolver
Resolver
@@ -49,8 +49,8 @@
(def: .public init
State
- {#locals 0
- #currying? false})
+ [#locals 0
+ #currying? false])
(type: .public Primitive
(Variant
@@ -88,14 +88,14 @@
(type: .public (Abstraction' s)
(Record
- {#environment (Environment s)
+ [#environment (Environment s)
#arity Arity
- #body s}))
+ #body s]))
(type: .public (Apply' s)
(Record
- {#function s
- #arguments (List s)}))
+ [#function s
+ #arguments (List s)]))
(type: .public (Branch s)
(Variant
@@ -106,9 +106,9 @@
(type: .public (Scope s)
(Record
- {#start Register
+ [#start Register
#inits (List s)
- #iteration s}))
+ #iteration s]))
(type: .public (Loop s)
(Variant
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive.lux b/stdlib/source/library/lux/tool/compiler/meta/archive.lux
index d326a2bbb..d54234a8e 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive.lux
@@ -78,8 +78,8 @@
{}
(Record
- {#next ID
- #resolver (Dictionary Module [ID (Maybe [Descriptor (Document Any) Output])])})
+ [#next ID
+ #resolver (Dictionary Module [ID (Maybe [Descriptor (Document Any) Output])])])
(def: next
(-> Archive ID)
@@ -87,8 +87,8 @@
(def: .public empty
Archive
- (:abstraction {#next 0
- #resolver (dictionary.empty text.hash)}))
+ (:abstraction [#next 0
+ #resolver (dictionary.empty text.hash)]))
(def: .public (id module archive)
(-> Module Archive (Try ID))
@@ -279,9 +279,9 @@
_ (exception.assertion ..corrupt_data []
(correct_reservations? reservations))]
(in (:abstraction
- {#next next
+ [#next next
#resolver (list\mix (function (_ [module id] archive)
(dictionary.has module [id #.None] archive))
(value@ #resolver (:representation ..empty))
- reservations)}))))
+ reservations)]))))
)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux
index 7a2d25b1a..23a9eae99 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux
@@ -36,20 +36,20 @@
(type: .public Artifact
(Record
- {#id ID
- #category Category}))
+ [#id ID
+ #category Category]))
(abstract: .public Registry
{}
(Record
- {#artifacts (Row Artifact)
- #resolver (Dictionary Text ID)})
+ [#artifacts (Row Artifact)
+ #resolver (Dictionary Text ID)])
(def: .public empty
Registry
- (:abstraction {#artifacts row.empty
- #resolver (dictionary.empty text.hash)}))
+ (:abstraction [#artifacts row.empty
+ #resolver (dictionary.empty text.hash)]))
(def: .public artifacts
(-> Registry (Row Artifact))
@@ -65,8 +65,8 @@
[id
(|> registry
:representation
- (revised@ #artifacts (row.suffix {#id id
- #category #Anonymous}))
+ (revised@ #artifacts (row.suffix [#id id
+ #category #Anonymous]))
:abstraction)]))
(template [<tag> <create> <fetch>]
@@ -76,8 +76,8 @@
[id
(|> registry
:representation
- (revised@ #artifacts (row.suffix {#id id
- #category (<tag> name)}))
+ (revised@ #artifacts (row.suffix [#id id
+ #category (<tag> name)]))
(revised@ #resolver (dictionary.has name id))
:abstraction)]))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux
index 5a30c2c50..fec78853e 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux
@@ -20,12 +20,12 @@
(type: .public Descriptor
(Record
- {#name Module
+ [#name Module
#file Path
#hash Nat
#state Module_State
#references (Set Module)
- #registry Registry}))
+ #registry Registry]))
(def: .public writer
(Writer Descriptor)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux
index 07c8b0841..6bc6d4e80 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux
@@ -29,8 +29,8 @@
{}
(Record
- {#signature Signature
- #content d})
+ [#signature Signature
+ #content d])
(def: .public (read key document)
(All (_ d) (-> (Key d) (Document Any) (Try d)))
@@ -49,8 +49,8 @@
(def: .public (write key content)
(All (_ d) (-> (Key d) d (Document d)))
- (:abstraction {#signature (key.signature key)
- #content content}))
+ (:abstraction [#signature (key.signature key)
+ #content content]))
(def: .public (check key document)
(All (_ d) (-> (Key d) (Document Any) (Try (Document d))))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux
index ebe18755a..8dae11fe4 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux
@@ -21,8 +21,8 @@
(type: .public Signature
(Record
- {#name Name
- #version Version}))
+ [#name Name
+ #version Version]))
(def: .public equivalence
(Equivalence Signature)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux
index 9796bdcfb..8944ceeb8 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux
@@ -42,8 +42,8 @@
(type: Dependency
(Record
- {#module Module
- #imports Ancestry}))
+ [#module Module
+ #imports Ancestry]))
(def: .public graph
(-> (List Dependency) Graph)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/io/context.lux b/stdlib/source/library/lux/tool/compiler/meta/io/context.lux
index 797d1e2e4..250849940 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/io/context.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/io/context.lux
@@ -129,10 +129,10 @@
[[path binary] (..find_any_source_file fs importer import contexts partial_host_extension module)]
(case (\ utf8.codec decoded binary)
(#try.Success code)
- (in {#////.module module
+ (in [#////.module module
#////.file path
#////.hash (text\hash code)
- #////.code code})
+ #////.code code])
(#try.Failure _)
(async\in (exception.except ..cannot_read_module [module])))))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux
index c1fdd9d5d..2531459ce 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux
@@ -88,12 +88,12 @@
(def: owner
tar.Owner
- {#tar.name tar.anonymous
- #tar.id tar.no_id})
+ [#tar.name tar.anonymous
+ #tar.id tar.no_id])
(def: ownership
- {#tar.user ..owner
- #tar.group ..owner})
+ [#tar.user ..owner
+ #tar.group ..owner])
(def: (write_module now mapping [module [module_id [descriptor document output]]])
(-> Instant (Dictionary Module archive.ID)
diff --git a/stdlib/source/library/lux/tool/interpreter.lux b/stdlib/source/library/lux/tool/interpreter.lux
index dd6713ff4..eb4ac9de7 100644
--- a/stdlib/source/library/lux/tool/interpreter.lux
+++ b/stdlib/source/library/lux/tool/interpreter.lux
@@ -163,9 +163,9 @@
(type: (Context anchor expression directive)
(Record
- {#configuration Configuration
+ [#configuration Configuration
#state (State+ anchor expression directive)
- #source Source}))
+ #source Source]))
(with_expansions [<Context> (as_is (Context anchor expression directive))]
(def: (read_eval_print context)
@@ -201,9 +201,9 @@
(! Any)))
(do {! Monad<!>}
[state (initialize Monad<!> Console<!> platform configuration)]
- (loop [context {#configuration configuration
+ (loop [context [#configuration configuration
#state state
- #source ..fresh_source}
+ #source ..fresh_source]
multi_line? #0]
(do !
[_ (if multi_line?
diff --git a/stdlib/source/library/lux/type.lux b/stdlib/source/library/lux/type.lux
index a9eeac328..0ef1ba1af 100644
--- a/stdlib/source/library/lux/type.lux
+++ b/stdlib/source/library/lux/type.lux
@@ -433,8 +433,8 @@
(type: Typed
(Record
- {#type Code
- #expression Code}))
+ [#type Code
+ #expression Code]))
(def: typed
(Parser Typed)
diff --git a/stdlib/source/library/lux/type/abstract.lux b/stdlib/source/library/lux/type/abstract.lux
index 23e7b4378..bd2fe150f 100644
--- a/stdlib/source/library/lux/type/abstract.lux
+++ b/stdlib/source/library/lux/type/abstract.lux
@@ -36,10 +36,10 @@
(type: .public Frame
(Record
- {#name Text
+ [#name Text
#type_vars (List Code)
#abstraction Code
- #representation Code}))
+ #representation Code]))
(def: frames
(Stack Frame)
diff --git a/stdlib/source/library/lux/type/check.lux b/stdlib/source/library/lux/type/check.lux
index a42a519df..ed8afab5b 100644
--- a/stdlib/source/library/lux/type/check.lux
+++ b/stdlib/source/library/lux/type/check.lux
@@ -323,9 +323,9 @@
(def: .public fresh_context
Type_Context
- {#.var_counter 0
+ [#.var_counter 0
#.ex_counter 0
- #.var_bindings (list)})
+ #.var_bindings (list)])
(def: (attempt op)
(All (_ a) (-> (Check a) (Check (Maybe a))))
diff --git a/stdlib/source/library/lux/type/implicit.lux b/stdlib/source/library/lux/type/implicit.lux
index c092139d2..fe815482d 100644
--- a/stdlib/source/library/lux/type/implicit.lux
+++ b/stdlib/source/library/lux/type/implicit.lux
@@ -88,7 +88,7 @@
["" simple_name]
(meta.either (do meta.monad
[member (meta.normal member)
- _ (meta.tag member)]
+ _ (meta.slot member)]
(in member))
(do {! meta.monad}
[this_module_name meta.current_module_name
@@ -114,7 +114,7 @@
(-> Name (Meta [Nat Type]))
(do meta.monad
[member (member_name member)
- [idx tag_list sig_type] (meta.tag member)]
+ [idx tag_list sig_type] (meta.slot member)]
(in [idx sig_type])))
(def: (available_definitions source_module target_module constants aggregate)
@@ -203,8 +203,8 @@
(type: Instance
(Rec Instance
(Record
- {#constructor Name
- #dependencies (List Instance)})))
+ [#constructor Name
+ #dependencies (List Instance)])))
(def: (candidate_provision provision context dep alts)
(-> (-> Lux Type_Context Type (Check Instance))
diff --git a/stdlib/source/library/lux/type/quotient.lux b/stdlib/source/library/lux/type/quotient.lux
index 1436e4597..163af82d6 100644
--- a/stdlib/source/library/lux/type/quotient.lux
+++ b/stdlib/source/library/lux/type/quotient.lux
@@ -26,15 +26,15 @@
{}
(Record
- {#value t
- #label c})
+ [#value t
+ #label c])
(def: .public (quotient class value)
(All (_ t c %)
(-> (Class t c %) t
(Quotient t c %)))
- (:abstraction {#value value
- #label ((:representation Class class) value)}))
+ (:abstraction [#value value
+ #label ((:representation Class class) value)]))
(template [<name> <output> <slot>]
[(def: .public <name>
diff --git a/stdlib/source/library/lux/type/refinement.lux b/stdlib/source/library/lux/type/refinement.lux
index 7cecd9111..93d962ae3 100644
--- a/stdlib/source/library/lux/type/refinement.lux
+++ b/stdlib/source/library/lux/type/refinement.lux
@@ -15,8 +15,8 @@
{}
(Record
- {#value t
- #predicate (Predicate t)})
+ [#value t
+ #predicate (Predicate t)])
(type: .public (Refiner t %)
(-> t (Maybe (Refined t %))))
@@ -27,8 +27,8 @@
(-> (Predicate t) (Refiner t %))))
(function (_ value)
(if (predicate value)
- (#.Some (:abstraction {#value value
- #predicate predicate}))
+ (#.Some (:abstraction [#value value
+ #predicate predicate]))
#.None)))
(template [<name> <output> <slot>]
@@ -48,8 +48,8 @@
(let [(^slots [#value #predicate]) (:representation refined)
value' (transform value)]
(if (predicate value')
- (#.Some (:abstraction {#value value'
- #predicate predicate}))
+ (#.Some (:abstraction [#value value'
+ #predicate predicate]))
#.None))))
)
diff --git a/stdlib/source/library/lux/world/db/jdbc.lux b/stdlib/source/library/lux/world/db/jdbc.lux
index 67b8d5354..8fb53e9b0 100644
--- a/stdlib/source/library/lux/world/db/jdbc.lux
+++ b/stdlib/source/library/lux/world/db/jdbc.lux
@@ -52,18 +52,18 @@
(type: .public Credentials
(Record
- {#url URL
+ [#url URL
#user Text
- #password Text}))
+ #password Text]))
(type: .public ID
Int)
(type: .public (Statement input)
(Record
- {#sql sql.Statement
+ [#sql sql.Statement
#input (Input input)
- #value input}))
+ #value input]))
(template [<name> <forge> <output>]
[(capability: .public (<name> ! i)
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux
index c66e0d4f9..377f07b4f 100644
--- a/stdlib/source/library/lux/world/file.lux
+++ b/stdlib/source/library/lux/world/file.lux
@@ -995,9 +995,9 @@
(type: Mock_File
(Record
- {#mock_last_modified Instant
+ [#mock_last_modified Instant
#mock_can_execute Bit
- #mock_content Binary}))
+ #mock_content Binary]))
(type: Mock
(Rec Mock
@@ -1042,9 +1042,9 @@
(case tail
#.End
(#try.Success (dictionary.has head
- (#.Left {#mock_last_modified now
+ (#.Left [#mock_last_modified now
#mock_can_execute false
- #mock_content content})
+ #mock_content content])
directory))
(#.Item _)
diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux
index cb316fbd4..b094a1e0d 100644
--- a/stdlib/source/library/lux/world/file/watch.lux
+++ b/stdlib/source/library/lux/world/file/watch.lux
@@ -36,24 +36,24 @@
{}
(Record
- {#creation Bit
+ [#creation Bit
#modification Bit
- #deletion Bit})
+ #deletion Bit])
(def: none
Concern
(:abstraction
- {#creation false
+ [#creation false
#modification false
- #deletion false}))
+ #deletion false]))
(template [<concern> <predicate> <event> <create> <modify> <delete>]
[(def: .public <concern>
Concern
(:abstraction
- {#creation <create>
+ [#creation <create>
#modification <modify>
- #deletion <delete>}))
+ #deletion <delete>]))
(def: .public <predicate>
(Predicate Concern)
@@ -70,9 +70,9 @@
(def: .public (also left right)
(-> Concern Concern Concern)
(:abstraction
- {#creation (or (..creation? left) (..creation? right))
+ [#creation (or (..creation? left) (..creation? right))
#modification (or (..modification? left) (..modification? right))
- #deletion (or (..deletion? left) (..deletion? right))}))
+ #deletion (or (..deletion? left) (..deletion? right))]))
(def: .public all
Concern
diff --git a/stdlib/source/library/lux/world/input/keyboard.lux b/stdlib/source/library/lux/world/input/keyboard.lux
index b22f9b792..b3b64f1d1 100644
--- a/stdlib/source/library/lux/world/input/keyboard.lux
+++ b/stdlib/source/library/lux/world/input/keyboard.lux
@@ -99,14 +99,14 @@
(type: .public Press
(Record
- {#pressed? Bit
- #input Key}))
+ [#pressed? Bit
+ #input Key]))
(template [<bit> <name>]
[(def: .public (<name> key)
(-> Key Press)
- {#pressed? <bit>
- #input key})]
+ [#pressed? <bit>
+ #input key])]
[#0 release]
[#1 press]
diff --git a/stdlib/source/library/lux/world/net.lux b/stdlib/source/library/lux/world/net.lux
index 606202f9b..4f5626900 100644
--- a/stdlib/source/library/lux/world/net.lux
+++ b/stdlib/source/library/lux/world/net.lux
@@ -13,5 +13,5 @@
(type: .public Location
(Record
- {#address Address
- #port Port}))
+ [#address Address
+ #port Port]))
diff --git a/stdlib/source/library/lux/world/net/http.lux b/stdlib/source/library/lux/world/net/http.lux
index 75b3c7b86..b34b904c9 100644
--- a/stdlib/source/library/lux/world/net/http.lux
+++ b/stdlib/source/library/lux/world/net/http.lux
@@ -53,28 +53,28 @@
(type: .public Address
(Record
- {#port Port
- #host Text}))
+ [#port Port
+ #host Text]))
(type: .public Identification
(Record
- {#local Address
- #remote Address}))
+ [#local Address
+ #remote Address]))
(type: .public Protocol
(Record
- {#version Version
- #scheme Scheme}))
+ [#version Version
+ #scheme Scheme]))
(type: .public Resource
(Record
- {#method Method
- #uri URI}))
+ [#method Method
+ #uri URI]))
(type: .public (Message !)
(Record
- {#headers Headers
- #body (Body !)}))
+ [#headers Headers
+ #body (Body !)]))
(type: .public (Request !)
[Identification Protocol Resource (Message !)])
diff --git a/stdlib/source/library/lux/world/net/http/client.lux b/stdlib/source/library/lux/world/net/http/client.lux
index 0292ab79b..c3d70e625 100644
--- a/stdlib/source/library/lux/world/net/http/client.lux
+++ b/stdlib/source/library/lux/world/net/http/client.lux
@@ -211,8 +211,8 @@
java/net/URLConnection::getInputStream
(\ ! each (|>> java/io/BufferedInputStream::new)))]
(in [(.nat status)
- {#//.headers headers
- #//.body (..default_body input)}]))))))]
+ [#//.headers headers
+ #//.body (..default_body input)]]))))))]
(for {@.old (as_is <jvm>)
@.jvm (as_is <jvm>)}
(as_is)))
diff --git a/stdlib/source/library/lux/world/net/http/mime.lux b/stdlib/source/library/lux/world/net/http/mime.lux
index f52b63136..5df977504 100644
--- a/stdlib/source/library/lux/world/net/http/mime.lux
+++ b/stdlib/source/library/lux/world/net/http/mime.lux
@@ -9,10 +9,10 @@
abstract]]])
(abstract: .public MIME
- Text
-
{#doc "Multipurpose Internet Mail Extensions"}
+ Text
+
(def: .public mime
(-> Text MIME)
(|>> :abstraction))
diff --git a/stdlib/source/library/lux/world/net/http/response.lux b/stdlib/source/library/lux/world/net/http/response.lux
index b129584d5..26a1e10fd 100644
--- a/stdlib/source/library/lux/world/net/http/response.lux
+++ b/stdlib/source/library/lux/world/net/http/response.lux
@@ -32,10 +32,10 @@
(let [body (frp\in (\ encoding.utf8 encoded ""))]
(function (_ status)
[status
- {#//.headers (|> context.empty
+ [#//.headers (|> context.empty
(header.content_length 0)
(header.content_type mime.utf_8))
- #//.body body}])))
+ #//.body body]])))
(def: .public (temporary_redirect to)
(-> URL Response)
@@ -49,10 +49,10 @@
(def: .public (content status type data)
(-> Status MIME Binary Response)
[status
- {#//.headers (|> context.empty
+ [#//.headers (|> context.empty
(header.content_length (binary.size data))
(header.content_type type))
- #//.body (frp\in data)}])
+ #//.body (frp\in data)]])
(def: .public bad_request
(-> Text Response)
diff --git a/stdlib/source/library/lux/world/output/video/resolution.lux b/stdlib/source/library/lux/world/output/video/resolution.lux
index 8bf8a1bd7..3f79a0040 100644
--- a/stdlib/source/library/lux/world/output/video/resolution.lux
+++ b/stdlib/source/library/lux/world/output/video/resolution.lux
@@ -12,8 +12,8 @@
(type: .public Resolution
(Record
- {#width Nat
- #height Nat}))
+ [#width Nat
+ #height Nat]))
(def: .public hash
(Hash Resolution)
@@ -27,8 +27,8 @@
(template [<name> <width> <height>]
[(def: .public <name>
Resolution
- {#width <width>
- #height <height>})]
+ [#width <width>
+ #height <height>])]
[svga 800 600]
[wsvga 1024 600]
diff --git a/stdlib/source/library/lux/world/service/authentication.lux b/stdlib/source/library/lux/world/service/authentication.lux
index 092d26454..1916f1238 100644
--- a/stdlib/source/library/lux/world/service/authentication.lux
+++ b/stdlib/source/library/lux/world/service/authentication.lux
@@ -19,7 +19,8 @@
(Capability [account] (! (Try Any))))
(type: .public (Service ! account secret value)
- {#can_register (Can_Register ! account secret value)
- #can_authenticate (Can_Authenticate ! account secret value)
- #can_reset (Can_Reset ! account secret)
- #can_forget (Can_Forget ! account)})
+ (Record
+ [#can_register (Can_Register ! account secret value)
+ #can_authenticate (Can_Authenticate ! account secret value)
+ #can_reset (Can_Reset ! account secret)
+ #can_forget (Can_Forget ! account)]))
diff --git a/stdlib/source/library/lux/world/service/crud.lux b/stdlib/source/library/lux/world/service/crud.lux
index 056628491..5635bc1c3 100644
--- a/stdlib/source/library/lux/world/service/crud.lux
+++ b/stdlib/source/library/lux/world/service/crud.lux
@@ -11,8 +11,9 @@
(type: .public ID Nat)
(type: .public Time
- {#created Instant
- #updated Instant})
+ (Record
+ [#created Instant
+ #updated Instant]))
(capability: .public (Can_Create ! entity)
(can_create [Instant entity] (! (Try ID))))
@@ -27,7 +28,8 @@
(can_delete ID (! (Try Any))))
(type: .public (CRUD ! entity)
- {#can_create (Can_Create ! entity)
- #can_retrieve (Can_Retrieve ! entity)
- #can_update (Can_Update ! entity)
- #can_delete (Can_Delete ! entity)})
+ (Record
+ [#can_create (Can_Create ! entity)
+ #can_retrieve (Can_Retrieve ! entity)
+ #can_update (Can_Update ! entity)
+ #can_delete (Can_Delete ! entity)]))
diff --git a/stdlib/source/library/lux/world/service/inventory.lux b/stdlib/source/library/lux/world/service/inventory.lux
index 6a5fac798..6f1ca494a 100644
--- a/stdlib/source/library/lux/world/service/inventory.lux
+++ b/stdlib/source/library/lux/world/service/inventory.lux
@@ -10,8 +10,9 @@
Nat)
(type: .public Ownership
- {#owner ID
- #property ID})
+ (Record
+ [#owner ID
+ #property ID]))
(capability: .public (Can_Own !)
(can_own Ownership (! (Try Any))))
@@ -26,7 +27,8 @@
(can_list_property ID (! (Try (List ID)))))
(type: .public (Inventory !)
- {#can_own (Can_Own !)
- #can_disown (Can_Disown !)
- #can_check (Can_Check !)
- #can_list_property (Can_List_Property !)})
+ (Record
+ [#can_own (Can_Own !)
+ #can_disown (Can_Disown !)
+ #can_check (Can_Check !)
+ #can_list_property (Can_List_Property !)]))
diff --git a/stdlib/source/library/lux/world/service/journal.lux b/stdlib/source/library/lux/world/service/journal.lux
index 648e084d6..311be09bf 100644
--- a/stdlib/source/library/lux/world/service/journal.lux
+++ b/stdlib/source/library/lux/world/service/journal.lux
@@ -13,12 +13,13 @@
["." instant (#+ Instant) ("#\." equivalence)]]]])
(type: .public (Entry a)
- {#what a
- #why Text
- #how Text
- #who Text
- #where Text
- #when Instant})
+ (Record
+ [#what a
+ #why Text
+ #how Text
+ #who Text
+ #where Text
+ #when Instant]))
(type: .public Range
(Interval Instant))
@@ -47,5 +48,6 @@
(can_read Range (! (Try (List (Entry a))))))
(type: .public (Journal ! a)
- {#can_write (Can_Write ! a)
- #can_read (Can_Read ! a)})
+ (Record
+ [#can_write (Can_Write ! a)
+ #can_read (Can_Read ! a)]))
diff --git a/stdlib/source/library/lux/world/service/mail.lux b/stdlib/source/library/lux/world/service/mail.lux
index 063972b22..9a7384a71 100644
--- a/stdlib/source/library/lux/world/service/mail.lux
+++ b/stdlib/source/library/lux/world/service/mail.lux
@@ -15,5 +15,6 @@
(can_subscribe [address] (! (Try (Channel message)))))
(type: .public (Service ! address message)
- {#can_send (Can_Send ! address message)
- #can_subscribe (Can_Subscribe ! address message)})
+ (Record
+ [#can_send (Can_Send ! address message)
+ #can_subscribe (Can_Subscribe ! address message)]))
diff --git a/stdlib/source/program/aedifex/artifact.lux b/stdlib/source/program/aedifex/artifact.lux
index 9645ba1f8..a6f506032 100644
--- a/stdlib/source/program/aedifex/artifact.lux
+++ b/stdlib/source/program/aedifex/artifact.lux
@@ -27,9 +27,9 @@
(type: .public Artifact
(Record
- {#group Group
+ [#group Group
#name Name
- #version Version}))
+ #version Version]))
(def: .public hash
(Hash Artifact)
diff --git a/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux
index d8d1e6bbc..91fcc3de5 100644
--- a/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux
+++ b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux
@@ -18,8 +18,8 @@
(type: .public Stamp
(Record
- {#time Time
- #build Build}))
+ [#time Time
+ #build Build]))
(def: .public equivalence
(Equivalence Stamp)
diff --git a/stdlib/source/program/aedifex/artifact/snapshot/version.lux b/stdlib/source/program/aedifex/artifact/snapshot/version.lux
index aa2994958..821d3d2c5 100644
--- a/stdlib/source/program/aedifex/artifact/snapshot/version.lux
+++ b/stdlib/source/program/aedifex/artifact/snapshot/version.lux
@@ -19,9 +19,9 @@
(type: .public Version
(Record
- {#extension Type
+ [#extension Type
#value Text
- #updated Time}))
+ #updated Time]))
(def: .public equivalence
(Equivalence Version)
diff --git a/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux
index cfcf3be09..9aacdf6de 100644
--- a/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux
+++ b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux
@@ -13,8 +13,8 @@
(type: .public Value
(Record
- {#version Text
- #snapshot Snapshot}))
+ [#version Text
+ #snapshot Snapshot]))
(def: .public equivalence
(Equivalence Value)
diff --git a/stdlib/source/program/aedifex/artifact/time/time.lux b/stdlib/source/program/aedifex/artifact/time/time.lux
index 0db035d56..6fb329962 100644
--- a/stdlib/source/program/aedifex/artifact/time/time.lux
+++ b/stdlib/source/program/aedifex/artifact/time/time.lux
@@ -33,7 +33,7 @@
minute (<>.codec n.decimal (<text>.exactly 2 <text>.decimal))
second (<>.codec n.decimal (<text>.exactly 2 <text>.decimal))]
(<>.lifted (time.time
- {#time.hour hour
+ [#time.hour hour
#time.minute minute
#time.second second
- #time.milli_second 0}))))
+ #time.milli_second 0]))))
diff --git a/stdlib/source/program/aedifex/artifact/versioning.lux b/stdlib/source/program/aedifex/artifact/versioning.lux
index 38001bfe2..550ae86a3 100644
--- a/stdlib/source/program/aedifex/artifact/versioning.lux
+++ b/stdlib/source/program/aedifex/artifact/versioning.lux
@@ -31,14 +31,14 @@
(type: .public Versioning
(Record
- {#snapshot Snapshot
+ [#snapshot Snapshot
#last_updated //time.Time
- #versions (List Version)}))
+ #versions (List Version)]))
(def: .public init
- {#snapshot #//snapshot.Local
+ [#snapshot #//snapshot.Local
#last_updated //time.epoch
- #versions (list)})
+ #versions (list)])
(def: .public equivalence
(Equivalence Versioning)
diff --git a/stdlib/source/program/aedifex/command/deploy.lux b/stdlib/source/program/aedifex/command/deploy.lux
index fc0562699..01e083faf 100644
--- a/stdlib/source/program/aedifex/command/deploy.lux
+++ b/stdlib/source/program/aedifex/command/deploy.lux
@@ -71,10 +71,10 @@
(let [pom_data (|> pom
(\ xml.codec encoded)
(\ utf8.codec encoded))]
- {#///package.origin (#///repository/origin.Remote "")
+ [#///package.origin (#///repository/origin.Remote "")
#///package.library [library
(///dependency/status.verified library)]
#///package.pom [pom
pom_data
- (///dependency/status.verified pom_data)]}))]
+ (///dependency/status.verified pom_data)]]))]
(console.write_line ..success console)))
diff --git a/stdlib/source/program/aedifex/command/install.lux b/stdlib/source/program/aedifex/command/install.lux
index 37a5c77b1..a496b35bc 100644
--- a/stdlib/source/program/aedifex/command/install.lux
+++ b/stdlib/source/program/aedifex/command/install.lux
@@ -66,12 +66,12 @@
(let [pom_data (|> pom
(\ xml.codec encoded)
(\ utf8.codec encoded))]
- {#///package.origin (#///origin.Local "")
+ [#///package.origin (#///origin.Local "")
#///package.library (let [library (binary.result tar.writer package)]
[library (///dependency/status.verified library)])
#///package.pom [pom
pom_data
- (///dependency/status.verified pom_data)]}))]
+ (///dependency/status.verified pom_data)]]))]
(console.write_line ..success console))
_
diff --git a/stdlib/source/program/aedifex/dependency.lux b/stdlib/source/program/aedifex/dependency.lux
index e1602990d..b1e1ed875 100644
--- a/stdlib/source/program/aedifex/dependency.lux
+++ b/stdlib/source/program/aedifex/dependency.lux
@@ -15,8 +15,8 @@
(type: .public Dependency
(Record
- {#artifact Artifact
- #type Type}))
+ [#artifact Artifact
+ #type Type]))
(def: .public hash
(Hash Dependency)
diff --git a/stdlib/source/program/aedifex/dependency/deployment.lux b/stdlib/source/program/aedifex/dependency/deployment.lux
index 92f0b55bf..d63c5a0a2 100644
--- a/stdlib/source/program/aedifex/dependency/deployment.lux
+++ b/stdlib/source/program/aedifex/dependency/deployment.lux
@@ -105,11 +105,11 @@
versioning_snapshot (value@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] snapshot)]]
(in (|> snapshot
(with@ [#///metadata/snapshot.versioning #///artifact/versioning.versions]
- (list {#///artifact/snapshot/version.extension type
+ (list [#///artifact/snapshot/version.extension type
#///artifact/snapshot/version.value (///artifact/snapshot/version/value.format
- {#///artifact/snapshot/version/value.version version_template
- #///artifact/snapshot/version/value.snapshot versioning_snapshot})
- #///artifact/snapshot/version.updated now}))
+ [#///artifact/snapshot/version/value.version version_template
+ #///artifact/snapshot/version/value.snapshot versioning_snapshot])
+ #///artifact/snapshot/version.updated now]))
... (with@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot]
... (list\composite (..artifacts type (product.right (value@ #///package.library package)))
... (..artifacts ///artifact/type.pom (product.right (value@ #///package.pom package)))))
diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux
index 23a572506..20f4cff71 100644
--- a/stdlib/source/program/aedifex/dependency/resolution.lux
+++ b/stdlib/source/program/aedifex/dependency/resolution.lux
@@ -132,8 +132,8 @@
(do (try.with async.monad)
[snapshot (///metadata/snapshot.read repository artifact)
.let [version_template (value@ [#///metadata/snapshot.artifact #///artifact.version] snapshot)
- artifact_version (value.format {#value.version version_template
- #value.snapshot (value@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] snapshot)})
+ artifact_version (value.format [#value.version version_template
+ #value.snapshot (value@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] snapshot)])
artifact (with@ #///artifact.version artifact_version artifact)]
[pom_data pom_status] (..hashed repository version_template artifact ///artifact/extension.pom)
library_&_status (..hashed repository version_template artifact extension)]
@@ -142,9 +142,9 @@
[pom (\ utf8.codec decoded pom_data)
pom (\ xml.codec decoded pom)
profile (<xml>.result ///pom.parser (list pom))]
- (in {#///package.origin (#///repository/origin.Remote "")
+ (in [#///package.origin (#///repository/origin.Remote "")
#///package.library library_&_status
- #///package.pom [pom pom_data pom_status]}))))))
+ #///package.pom [pom pom_data pom_status]]))))))
(type: .public Resolution
(Dictionary Dependency Package))
diff --git a/stdlib/source/program/aedifex/format.lux b/stdlib/source/program/aedifex/format.lux
index 1933d2be0..93eca461f 100644
--- a/stdlib/source/program/aedifex/format.lux
+++ b/stdlib/source/program/aedifex/format.lux
@@ -5,7 +5,7 @@
["." text ("#\." equivalence)]
[collection
["." dictionary (#+ Dictionary)]
- ["." list ("#\." functor)]
+ ["." list ("#\." monad)]
["." set (#+ Set)]]]
[macro
["." code]
@@ -23,31 +23,31 @@
(def: (license [name url type])
(Format /.License)
- (`' {#name (~ (code.text name))
+ (`' [#name (~ (code.text name))
#url (~ (code.text url))
#type (~ (case type
#/.Repo
(' #repo)
#/.Manual
- (' #manual)))}))
+ (' #manual)))]))
(def: (organization [name url])
(Format /.Organization)
- (`' {#name (~ (code.text name))
- #url (~ (code.text url))}))
+ (`' [#name (~ (code.text name))
+ #url (~ (code.text url))]))
(def: (developer [name url organization])
(Format /.Developer)
(case organization
#.None
- (`' {#name (~ (code.text name))
- #url (~ (code.text url))})
+ (`' [#name (~ (code.text name))
+ #url (~ (code.text url))])
(#.Some value)
- (`' {#name (~ (code.text name))
+ (`' [#name (~ (code.text name))
#url (~ (code.text url))
- #organization (~ (..organization value))})))
+ #organization (~ (..organization value))])))
(def: contributor
(Format /.Contributor)
@@ -60,8 +60,9 @@
(Format Aggregate)
(|>> dictionary.entries
(list\each (function (_ [key value])
- [(code.local_tag key) value]))
- code.record))
+ (list (code.local_tag key) value)))
+ list\conjoint
+ code.tuple))
(def: empty
Aggregate
@@ -101,8 +102,9 @@
(|> value
dictionary.entries
(list\each (function (_ [key value])
- [(key_format key) (value_format value)]))
- code.record)
+ (list (key_format key) (value_format value))))
+ list\conjoint
+ code.tuple)
aggregate)))
(def: (info value)
@@ -167,5 +169,6 @@
(Format Project)
(|>> dictionary.entries
(list\each (function (_ [key value])
- [(code.text key) (..profile value)]))
- code.record))
+ (list (code.text key) (..profile value))))
+ list\conjoint
+ code.tuple))
diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux
index 3a6ffb74f..0d6b924b9 100644
--- a/stdlib/source/program/aedifex/metadata/artifact.lux
+++ b/stdlib/source/program/aedifex/metadata/artifact.lux
@@ -40,10 +40,10 @@
(type: .public Metadata
(Record
- {#group Group
+ [#group Group
#name Name
#versions (List Version)
- #last_updated Instant}))
+ #last_updated Instant]))
(def: (pad value)
(-> Nat Text)
@@ -129,10 +129,10 @@
minute (<>.codec n.decimal (<text>.exactly 2 <text>.decimal))
second (<>.codec n.decimal (<text>.exactly 2 <text>.decimal))]
(<>.lifted (time.time
- {#time.hour hour
+ [#time.hour hour
#time.minute minute
#time.second second
- #time.milli_second 0}))))
+ #time.milli_second 0]))))
(def: last_updated_parser
(Parser Instant)
@@ -188,10 +188,10 @@
(#try.Failure error)
(in (#try.Success
(let [(^slots [#///artifact.group #///artifact.name]) artifact]
- {#group group
+ [#group group
#name name
#versions (list)
- #last_updated ..epoch}))))))
+ #last_updated ..epoch]))))))
(def: .public (write repository artifact metadata)
(-> (Repository Async) Artifact Metadata (Async (Try Any)))
diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux
index d5e9483bf..61183a932 100644
--- a/stdlib/source/program/aedifex/metadata/snapshot.lux
+++ b/stdlib/source/program/aedifex/metadata/snapshot.lux
@@ -47,8 +47,8 @@
(type: .public Metadata
(Record
- {#artifact Artifact
- #versioning Versioning}))
+ [#artifact Artifact
+ #versioning Versioning]))
(template [<definition> <tag>]
[(def: <definition> xml.Tag ["" <tag>])]
@@ -91,9 +91,9 @@
[group (<xml>.somewhere (..text ..<group>))
name (<xml>.somewhere (..text ..<name>))
version (<xml>.somewhere (..text ..<version>))
- versioning (with_expansions [<default_version> {#///artifact/snapshot/version.extension ///artifact/type.jvm_library
+ versioning (with_expansions [<default_version> [#///artifact/snapshot/version.extension ///artifact/type.jvm_library
#///artifact/snapshot/version.value version
- #///artifact/snapshot/version.updated ///artifact/time.epoch}]
+ #///artifact/snapshot/version.updated ///artifact/time.epoch]]
(|> (<xml>.somewhere ///artifact/versioning.parser)
(\ ! each
(revised@ #///artifact/versioning.versions
@@ -104,13 +104,13 @@
versions
versions)))))
- (<>.else {#///artifact/versioning.snapshot #///artifact/snapshot.Local
+ (<>.else [#///artifact/versioning.snapshot #///artifact/snapshot.Local
#///artifact/versioning.last_updated ///artifact/time.epoch
- #///artifact/versioning.versions (list <default_version>)})))]
- (in {#artifact {#///artifact.group group
+ #///artifact/versioning.versions (list <default_version>)])))]
+ (in [#artifact [#///artifact.group group
#///artifact.name name
- #///artifact.version version}
- #versioning versioning}))))
+ #///artifact.version version]
+ #versioning versioning]))))
(def: .public equivalence
(Equivalence Metadata)
@@ -137,8 +137,8 @@
(#try.Failure error)
(in (#try.Success
- {#artifact artifact
- #versioning ///artifact/versioning.init})))))
+ [#artifact artifact
+ #versioning ///artifact/versioning.init])))))
(def: .public (write repository artifact metadata)
(-> (Repository Async) Artifact Metadata (Async (Try Any)))
diff --git a/stdlib/source/program/aedifex/package.lux b/stdlib/source/program/aedifex/package.lux
index 49aa2867e..54994e50b 100644
--- a/stdlib/source/program/aedifex/package.lux
+++ b/stdlib/source/program/aedifex/package.lux
@@ -30,9 +30,9 @@
(type: .public Package
(Record
- {#origin Origin
+ [#origin Origin
#library [Binary Status]
- #pom [XML Binary Status]}))
+ #pom [XML Binary Status]]))
(template [<name> <tag>]
[(def: .public (<name> package)
@@ -50,7 +50,7 @@
(def: .public (local pom library)
(-> XML Binary Package)
- {#origin (#//origin.Local "")
+ [#origin (#//origin.Local "")
#library [library
(#//status.Verified (//hash.sha-1 library)
(//hash.md5 library))]
@@ -58,7 +58,7 @@
[pom
binary_pom
(#//status.Verified (//hash.sha-1 binary_pom)
- (//hash.md5 binary_pom))])})
+ (//hash.md5 binary_pom))])])
(def: .public dependencies
(-> Package (Try (Set Dependency)))
diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux
index 21c8ac270..41ada3cc7 100644
--- a/stdlib/source/program/aedifex/parser.lux
+++ b/stdlib/source/program/aedifex/parser.lux
@@ -84,8 +84,8 @@
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.record (<>.some (<>.and <code>.local_tag
- <code>.any))))]
+ (<code>.tuple (<>.some (<>.and <code>.local_tag
+ <code>.any))))]
($_ <>.and
(..singular input "name" ..name)
(..singular input "url" ..url)
@@ -99,8 +99,8 @@
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.record (<>.some (<>.and <code>.local_tag
- <code>.any))))]
+ (<code>.tuple (<>.some (<>.and <code>.local_tag
+ <code>.any))))]
($_ <>.and
(..singular input "name" ..name)
(..singular input "url" ..url))))
@@ -110,8 +110,8 @@
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.record (<>.some (<>.and <code>.local_tag
- <code>.any))))]
+ (<code>.tuple (<>.some (<>.and <code>.local_tag
+ <code>.any))))]
($_ <>.and
(..singular input "name" ..name)
(..singular input "url" ..url)
@@ -127,8 +127,8 @@
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.record (<>.some (<>.and <code>.local_tag
- <code>.any))))]
+ (<code>.tuple (<>.some (<>.and <code>.local_tag
+ <code>.any))))]
($_ <>.and
(<>.maybe (..singular input "url" ..url))
(<>.maybe (..singular input "scm" ..scm))
@@ -169,9 +169,9 @@
(def: deploy_repository
(Parser (List [Text //repository.Address]))
- (<code>.record (<>.some
- (<>.and <code>.text
- ..repository))))
+ (<code>.tuple (<>.some
+ (<>.and <code>.text
+ ..repository))))
(def: runtime
(Parser Runtime)
@@ -183,8 +183,8 @@
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.record (<>.some (<>.and <code>.local_tag
- <code>.any))))
+ (<code>.tuple (<>.some (<>.and <code>.local_tag
+ <code>.any))))
.let [^parents (: (Parser (List /.Name))
(<>.else (list)
(..plural input "parents" <code>.text)))
@@ -267,7 +267,7 @@
multi_profile (: (Parser Project)
(\ <>.monad each
(dictionary.of_list text.hash)
- (<code>.record (<>.many (<>.and <code>.text
- ..profile)))))]
+ (<code>.tuple (<>.many (<>.and <code>.text
+ ..profile)))))]
(<>.either multi_profile
default_profile)))
diff --git a/stdlib/source/program/aedifex/pom.lux b/stdlib/source/program/aedifex/pom.lux
index a093a4091..99ac54571 100644
--- a/stdlib/source/program/aedifex/pom.lux
+++ b/stdlib/source/program/aedifex/pom.lux
@@ -173,16 +173,16 @@
(do maybe.monad
[group (dictionary.value ["" ..group_tag] properties)
artifact (dictionary.value ["" ..artifact_tag] properties)]
- (in {#//dependency.artifact {#//artifact.group group
+ (in [#//dependency.artifact [#//artifact.group group
#//artifact.name artifact
#//artifact.version (|> properties
(dictionary.value ["" ..version_tag])
(maybe.else "")
(text.replaced "${project.version}" own_version)
- (text.replaced "${project.parent.version}" parent_version))}
+ (text.replaced "${project.parent.version}" parent_version))]
#//dependency.type (|> properties
(dictionary.value ["" "type"])
- (maybe.else //artifact/type.jvm_library))})))))
+ (maybe.else //artifact/type.jvm_library))])))))
(def: (dependencies_parser own_version parent_version)
(-> Text Text (Parser (List Dependency)))
diff --git a/stdlib/source/program/aedifex/profile.lux b/stdlib/source/program/aedifex/profile.lux
index b861e1601..7621f0848 100644
--- a/stdlib/source/program/aedifex/profile.lux
+++ b/stdlib/source/program/aedifex/profile.lux
@@ -34,8 +34,8 @@
(def: .public default_compiler
Dependency
- {#dependency.artifact ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT"]
- #dependency.type type.jvm_library})
+ [#dependency.artifact ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT"]
+ #dependency.type type.jvm_library])
(type: .public Distribution
(Variant
@@ -101,13 +101,13 @@
(type: .public Info
(Record
- {#url (Maybe URL)
+ [#url (Maybe URL)
#scm (Maybe SCM)
#description (Maybe Text)
#licenses (List License)
#organization (Maybe Organization)
#developers (List Developer)
- #contributors (List Contributor)}))
+ #contributors (List Contributor)]))
(def: info_equivalence
(Equivalence Info)
@@ -122,13 +122,13 @@
(def: .public default_info
Info
- {#url #.None
+ [#url #.None
#scm #.None
#description #.None
#licenses (list)
#organization #.None
#developers (list)
- #contributors (list)})
+ #contributors (list)])
(type: .public Source
Path)
@@ -157,7 +157,7 @@
(type: .public Profile
(Record
- {#parents (List Name)
+ [#parents (List Name)
#identity (Maybe Artifact)
#info (Maybe Info)
#repositories (Set Address)
@@ -172,7 +172,7 @@
#js Runtime
#python Runtime
#lua Runtime
- #ruby Runtime}))
+ #ruby Runtime]))
(def: .public equivalence
(Equivalence Profile)
@@ -214,7 +214,7 @@
(Monoid Profile)
(def: identity
- {#parents (list)
+ [#parents (list)
#identity #.None
#info #.None
#repositories (set.empty text.hash)
@@ -229,14 +229,14 @@
#js runtime.default_js
#python runtime.default_python
#lua runtime.default_lua
- #ruby runtime.default_ruby})
+ #ruby runtime.default_ruby])
(def: (composite override baseline)
(template.let [(!runtime <tag> <runtime>)
[(if (runtime\= <runtime> (value@ <tag> override))
(value@ <tag> baseline)
(value@ <tag> override))]]
- {#parents (list\composite (value@ #parents baseline) (value@ #parents override))
+ [#parents (list\composite (value@ #parents baseline) (value@ #parents override))
#identity (maybe\composite (value@ #identity override) (value@ #identity baseline))
#info (maybe\composite (value@ #info override) (value@ #info baseline))
#repositories (set.union (value@ #repositories baseline) (value@ #repositories override))
@@ -255,6 +255,6 @@
#js (!runtime #js runtime.default_js)
#python (!runtime #python runtime.default_python)
#lua (!runtime #lua runtime.default_lua)
- #ruby (!runtime #ruby runtime.default_ruby)})))
+ #ruby (!runtime #ruby runtime.default_ruby)])))
(exception: .public no_identity)
diff --git a/stdlib/source/program/aedifex/repository/identity.lux b/stdlib/source/program/aedifex/repository/identity.lux
index 59d0fdcba..c4b974664 100644
--- a/stdlib/source/program/aedifex/repository/identity.lux
+++ b/stdlib/source/program/aedifex/repository/identity.lux
@@ -19,8 +19,8 @@
(type: .public Identity
(Record
- {#user User
- #password Password}))
+ [#user User
+ #password Password]))
(def: .public equivalence
(Equivalence Identity)
diff --git a/stdlib/source/program/aedifex/runtime.lux b/stdlib/source/program/aedifex/runtime.lux
index bdf81da78..b5a9a78e0 100644
--- a/stdlib/source/program/aedifex/runtime.lux
+++ b/stdlib/source/program/aedifex/runtime.lux
@@ -16,8 +16,8 @@
(type: .public Runtime
(Record
- {#program Text
- #parameters (List Text)}))
+ [#program Text
+ #parameters (List Text)]))
(def: .public equivalence
(Equivalence Runtime)
@@ -28,8 +28,8 @@
(template [<name> <command> <parameters>]
[(def: .public <name>
Runtime
- {#program <command>
- #parameters (`` (list (~~ (template.spliced <parameters>))))})]
+ [#program <command>
+ #parameters (`` (list (~~ (template.spliced <parameters>))))])]
[default_java "java" ["-jar"]]
[default_js "node" ["--stack_size=8192"]]
diff --git a/stdlib/source/program/compositor/export.lux b/stdlib/source/program/compositor/export.lux
index a9c76f039..1da80fc55 100644
--- a/stdlib/source/program/compositor/export.lux
+++ b/stdlib/source/program/compositor/export.lux
@@ -34,10 +34,10 @@
(def: no_ownership
tar.Ownership
(let [commons (: tar.Owner
- {#tar.name tar.anonymous
- #tar.id tar.no_id})]
- {#tar.user commons
- #tar.group commons}))
+ [#tar.name tar.anonymous
+ #tar.id tar.no_id])]
+ [#tar.user commons
+ #tar.group commons]))
(def: .public (library fs sources)
(-> (file.System Async) (List Source) (Async (Try tar.Tar)))
diff --git a/stdlib/source/program/compositor/static.lux b/stdlib/source/program/compositor/static.lux
index 498842248..88f3ce65f 100644
--- a/stdlib/source/program/compositor/static.lux
+++ b/stdlib/source/program/compositor/static.lux
@@ -7,7 +7,7 @@
(type: .public Static
(Record
- {#host Target
+ [#host Target
#host_module_extension Text
#target Path
- #artifact_extension Text}))
+ #artifact_extension Text]))
diff --git a/stdlib/source/program/scriptum.lux b/stdlib/source/program/scriptum.lux
index 2b2d6e01b..4512ab982 100644
--- a/stdlib/source/program/scriptum.lux
+++ b/stdlib/source/program/scriptum.lux
@@ -103,7 +103,7 @@
... (^ (list [_ single_tag]))
... (if interface?
... (format "(: " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) text.new_line " " single_tag ")")
-... (format "{#" single_tag " " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) "}"))
+... (format "(Record [#" single_tag " " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) "])"))
... _
... (case [recursive_type? type]
@@ -158,7 +158,7 @@
... (text.interposed (format text.new_line " ")))]
... (if interface?
... member_docs
-... (format "{" member_docs "}")))))
+... (format "(Record [" member_docs "])")))))
... [_ (#.Function input output)]
... (let [[ins out] (type.flat_function type)]
@@ -269,10 +269,11 @@
... [Text Code Type])
... (type: Organization
-... {#types (List Value)
-... #macros (List [Text Code])
-... #implementations (List Value)
-... #values (List Value)})
+... (Record
+... [#types (List Value)
+... #macros (List [Text Code])
+... #implementations (List Value)
+... #values (List Value)]))
... (def: (lux_module? module_name)
... (-> Text Bit)
@@ -314,10 +315,10 @@
... (def: (organize_definitions defs)
... (-> (List [Text Definition]) Organization)
-... (let [init {#types (list)
+... (let [init [#types (list)
... #macros (list)
... #implementations (list)
-... #values (list)}]
+... #values (list)]]
... (|> (list\mix add_definition init defs)
... (revised@ #types (list.sorted name_sort))
... (revised@ #macros (list.sorted name_sort))
diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux
index 3bfcec4e8..d1d0074fd 100644
--- a/stdlib/source/specification/compositor/generation/case.lux
+++ b/stdlib/source/specification/compositor/generation/case.lux
@@ -85,9 +85,9 @@
[subS subP] case
.let [right? (tail? size idx)
caseS (synthesis.variant
- {#analysis.lefts idx
+ [#analysis.lefts idx
#analysis.right? right?
- #analysis.value subS})
+ #analysis.value subS])
caseP ($_ synthesis.path/seq
(if right?
(synthesis.side/right idx)
diff --git a/stdlib/source/specification/compositor/generation/common.lux b/stdlib/source/specification/compositor/generation/common.lux
index 729ce81f4..e9d8eae55 100644
--- a/stdlib/source/specification/compositor/generation/common.lux
+++ b/stdlib/source/specification/compositor/generation/common.lux
@@ -297,10 +297,10 @@
(_.test "Can throw runtime errors."
(and (|> (#synthesis.Extension "lux try"
(list (synthesis.function/abstraction
- {#synthesis.environment (list)
+ [#synthesis.environment (list)
#synthesis.arity 1
#synthesis.body (#synthesis.Extension "lux io error"
- (list (synthesis.text message)))})))
+ (list (synthesis.text message)))])))
(run (..safe "lux try"))
(case> (^multi (#try.Success valueV)
{(:as (Try Text) valueV) (#try.Failure error)})
@@ -310,9 +310,9 @@
false))
(|> (#synthesis.Extension "lux try"
(list (synthesis.function/abstraction
- {#synthesis.environment (list)
+ [#synthesis.environment (list)
#synthesis.arity 1
- #synthesis.body (synthesis.text message)})))
+ #synthesis.body (synthesis.text message)])))
(run (..safe "lux try"))
(case> (^multi (#try.Success valueV)
{(:as (Try Text) valueV) (#try.Success valueV)})
diff --git a/stdlib/source/specification/compositor/generation/function.lux b/stdlib/source/specification/compositor/generation/function.lux
index 36b45c283..d97b2c02c 100644
--- a/stdlib/source/specification/compositor/generation/function.lux
+++ b/stdlib/source/specification/compositor/generation/function.lux
@@ -43,9 +43,9 @@
local (..local arity)]
(in [arity local
(synthesis.function/abstraction
- {#synthesis.environment (list)
+ [#synthesis.environment (list)
#synthesis.arity arity
- #synthesis.body (synthesis.variable/local local)})])))
+ #synthesis.body (synthesis.variable/local local)])])))
(def: .public (spec run)
(-> Runner Test)
@@ -57,18 +57,18 @@
inputsS (list\each (|>> synthesis.f64) inputs)]]
($_ _.and
(_.test "Can read arguments."
- (|> (synthesis.function/apply {#synthesis.function functionS
- #synthesis.arguments inputsS})
+ (|> (synthesis.function/apply [#synthesis.function functionS
+ #synthesis.arguments inputsS])
(run "with_local")
(//case.verify expectation)))
(_.test "Can partially apply functions."
(or (n.= 1 arity)
(let [preS (list.first partial_arity inputsS)
postS (list.after partial_arity inputsS)
- partialS (synthesis.function/apply {#synthesis.function functionS
- #synthesis.arguments preS})]
- (|> (synthesis.function/apply {#synthesis.function partialS
- #synthesis.arguments postS})
+ partialS (synthesis.function/apply [#synthesis.function functionS
+ #synthesis.arguments preS])]
+ (|> (synthesis.function/apply [#synthesis.function partialS
+ #synthesis.arguments postS])
(run "partial_application")
(//case.verify expectation)))))
(_.test "Can read environment."
@@ -81,15 +81,15 @@
(synthesis.variable/local (|> local (n.- partial_arity))))
inner_arity (n.- partial_arity arity)
innerS (synthesis.function/abstraction
- {#synthesis.environment environment
+ [#synthesis.environment environment
#synthesis.arity inner_arity
- #synthesis.body variableS})
+ #synthesis.body variableS])
outerS (synthesis.function/abstraction
- {#synthesis.environment (list)
+ [#synthesis.environment (list)
#synthesis.arity partial_arity
- #synthesis.body innerS})]
- (|> (synthesis.function/apply {#synthesis.function outerS
- #synthesis.arguments inputsS})
+ #synthesis.body innerS])]
+ (|> (synthesis.function/apply [#synthesis.function outerS
+ #synthesis.arguments inputsS])
(run "with_foreign")
(//case.verify expectation)))))
)))
diff --git a/stdlib/source/specification/compositor/generation/structure.lux b/stdlib/source/specification/compositor/generation/structure.lux
index ec9893e7c..33e38520f 100644
--- a/stdlib/source/specification/compositor/generation/structure.lux
+++ b/stdlib/source/specification/compositor/generation/structure.lux
@@ -36,11 +36,11 @@
.let [last?_in (|> num_tags -- (n.= tag_in))]
value_in r.i64]
(_.test (%.name (name_of synthesis.variant))
- (|> (synthesis.variant {#analysis.lefts (if last?_in
+ (|> (synthesis.variant [#analysis.lefts (if last?_in
(-- tag_in)
tag_in)
#analysis.right? last?_in
- #analysis.value (synthesis.i64 value_in)})
+ #analysis.value (synthesis.i64 value_in)])
(run "variant")
(case> (#try.Success valueT)
(let [valueT (:as (Array Any) valueT)]
diff --git a/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux b/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux
index 915d283da..370ea21ab 100644
--- a/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux
+++ b/stdlib/source/test/aedifex/artifact/snapshot/version/value.lux
@@ -53,8 +53,8 @@
(text\= version
(/.format (with@ #/.snapshot #///.Local sample)))
- remote_format (/.format {#/.version (format version /.snapshot)
- #/.snapshot (#///.Remote stamp)})
+ remote_format (/.format [#/.version (format version /.snapshot)
+ #/.snapshot (#///.Remote stamp)])
remote!
(and (text.starts_with? (format version (///time.format (value@ #///stamp.time stamp)))
remote_format)
diff --git a/stdlib/source/test/aedifex/cache.lux b/stdlib/source/test/aedifex/cache.lux
index 143766eb6..0390e441d 100644
--- a/stdlib/source/test/aedifex/cache.lux
+++ b/stdlib/source/test/aedifex/cache.lux
@@ -73,8 +73,8 @@
[[identity profile pom] ..profile
type ..type
content ..content]
- (in [{#//dependency.artifact identity
- #//dependency.type type}
+ (in [[#//dependency.artifact identity
+ #//dependency.type type]
(with@ #//package.origin (#//repository/origin.Remote "") (//package.local pom content))])))
(def: resolution
diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux
index ff5f7450b..95363b079 100644
--- a/stdlib/source/test/aedifex/command/build.lux
+++ b/stdlib/source/test/aedifex/command/build.lux
@@ -109,17 +109,17 @@
(Random Dependency)
(do random.monad
[lux_version (random.ascii/alpha 5)
- .let [js_compiler {#///dependency.artifact {#///artifact.group /.lux_group
+ .let [js_compiler [#///dependency.artifact [#///artifact.group /.lux_group
#///artifact.name /.js_compiler_name
- #///artifact.version lux_version}
- #///dependency.type ///artifact/type.js_library}]]
+ #///artifact.version lux_version]
+ #///dependency.type ///artifact/type.js_library]]]
(`` ($_ random.either
(in js_compiler)
(~~ (template [<compiler>]
- [(in {#///dependency.artifact {#///artifact.group /.lux_group
+ [(in [#///dependency.artifact [#///artifact.group /.lux_group
#///artifact.name <compiler>
- #///artifact.version lux_version}
- #///dependency.type ///artifact/type.lux_library})]
+ #///artifact.version lux_version]
+ #///dependency.type ///artifact/type.lux_library])]
[/.jvm_compiler_name]
[/.python_compiler_name]
diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux
index 87a3e1731..95f757f7d 100644
--- a/stdlib/source/test/aedifex/command/deps.lux
+++ b/stdlib/source/test/aedifex/command/deps.lux
@@ -67,10 +67,10 @@
[_ dependee_package] $///package.random
[_ depender_package] $///package.random
- .let [dependee {#///dependency.artifact dependee_artifact
- #///dependency.type ///artifact/type.lux_library}
- depender {#///dependency.artifact depender_artifact
- #///dependency.type ///artifact/type.lux_library}
+ .let [dependee [#///dependency.artifact dependee_artifact
+ #///dependency.type ///artifact/type.lux_library]
+ depender [#///dependency.artifact depender_artifact
+ #///dependency.type ///artifact/type.lux_library]
dependee_pom (|> (\ ///.monoid identity)
(with@ #///.identity (#.Some dependee_artifact))
diff --git a/stdlib/source/test/aedifex/dependency/deployment.lux b/stdlib/source/test/aedifex/dependency/deployment.lux
index cd92cec74..f87aca761 100644
--- a/stdlib/source/test/aedifex/dependency/deployment.lux
+++ b/stdlib/source/test/aedifex/dependency/deployment.lux
@@ -52,11 +52,11 @@
(def: good_upload
(@http.Response IO)
[http/status.created
- {#@http.headers (http.headers (list))
+ [#@http.headers (http.headers (list))
#@http.body (function (_ _)
(|> [0 (binary.empty 0)]
#try.Success
- io.io))}])
+ io.io))]])
(type: Cache
(Atom (Dictionary URL Binary)))
diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux
index 355cf9c98..9f1826f9c 100644
--- a/stdlib/source/test/aedifex/dependency/resolution.lux
+++ b/stdlib/source/test/aedifex/dependency/resolution.lux
@@ -53,8 +53,8 @@
(do {! random.monad}
[artifact $///artifact.random
[_ package] $///package.random]
- (in (dictionary.has {#///dependency.artifact artifact
- #///dependency.type ///artifact/type.lux_library}
+ (in (dictionary.has [#///dependency.artifact artifact
+ #///dependency.type ///artifact/type.lux_library]
package
/.empty))))
@@ -260,8 +260,8 @@
(`` ($_ _.and
(in (do async.monad
[actual_package (/.one (///repository.mock good [])
- {#///dependency.artifact expected_artifact
- #///dependency.type ///artifact/type.lux_library})]
+ [#///dependency.artifact expected_artifact
+ #///dependency.type ///artifact/type.lux_library])]
(_.cover' [/.one]
(case actual_package
(#try.Success actual_package)
@@ -274,8 +274,8 @@
(~~ (template [<exception> <bad>]
[(in (do async.monad
[actual_package (/.one (///repository.mock <bad> [])
- {#///dependency.artifact expected_artifact
- #///dependency.type ///artifact/type.lux_library})]
+ [#///dependency.artifact expected_artifact
+ #///dependency.type ///artifact/type.lux_library])]
(_.cover' [<exception>]
(case actual_package
(#try.Failure error)
@@ -309,8 +309,8 @@
(list (///repository.mock bad_sha-1 [])
(///repository.mock bad_md5 [])
(///repository.mock good []))
- {#///dependency.artifact expected_artifact
- #///dependency.type ///artifact/type.lux_library})]
+ [#///dependency.artifact expected_artifact
+ #///dependency.type ///artifact/type.lux_library])]
(_.cover' [/.any]
(case actual_package
(#try.Success actual_package)
@@ -325,8 +325,8 @@
actual_package (/.any console
(list (///repository.mock bad_sha-1 [])
(///repository.mock bad_md5 []))
- {#///dependency.artifact expected_artifact
- #///dependency.type ///artifact/type.lux_library})]
+ [#///dependency.artifact expected_artifact
+ #///dependency.type ///artifact/type.lux_library])]
(_.cover' [/.cannot_resolve]
(case actual_package
(#try.Failure error)
@@ -358,12 +358,12 @@
[_ depender_package] $///package.random
[_ ignored_package] $///package.random
- .let [dependee {#///dependency.artifact dependee_artifact
- #///dependency.type ///artifact/type.lux_library}
- depender {#///dependency.artifact depender_artifact
- #///dependency.type ///artifact/type.lux_library}
- ignored {#///dependency.artifact ignored_artifact
- #///dependency.type ///artifact/type.lux_library}
+ .let [dependee [#///dependency.artifact dependee_artifact
+ #///dependency.type ///artifact/type.lux_library]
+ depender [#///dependency.artifact depender_artifact
+ #///dependency.type ///artifact/type.lux_library]
+ ignored [#///dependency.artifact ignored_artifact
+ #///dependency.type ///artifact/type.lux_library]
dependee_pom (|> (\ ///.monoid identity)
(with@ #///.identity (#.Some dependee_artifact))
diff --git a/stdlib/source/test/aedifex/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux
index eb8b4aec1..e5e903e65 100644
--- a/stdlib/source/test/aedifex/metadata/artifact.lux
+++ b/stdlib/source/test/aedifex/metadata/artifact.lux
@@ -60,10 +60,10 @@
month (month.by_number month)
date (date.date year month day_of_month)
time (time.time
- {#time.hour hour
+ [#time.hour hour
#time.minute minute
#time.second second
- #time.milli_second 0})]
+ #time.milli_second 0])]
(in (instant.of_date_time date time))))))))
(def: .public test
@@ -72,12 +72,12 @@
(_.for [/.Metadata])
(do random.monad
[expected ..random
- .let [artifact {#///artifact.group (value@ #/.group expected)
+ .let [artifact [#///artifact.group (value@ #/.group expected)
#///artifact.name (value@ #/.name expected)
#///artifact.version (|> expected
(value@ #/.versions)
list.head
- (maybe.else ""))}]]
+ (maybe.else ""))]]]
($_ _.and
(_.for [/.equivalence]
($equivalence.spec /.equivalence ..random))
diff --git a/stdlib/source/test/aedifex/metadata/snapshot.lux b/stdlib/source/test/aedifex/metadata/snapshot.lux
index 5010053a5..5308c10ca 100644
--- a/stdlib/source/test/aedifex/metadata/snapshot.lux
+++ b/stdlib/source/test/aedifex/metadata/snapshot.lux
@@ -64,10 +64,10 @@
month (month.by_number month)
date (date.date year month day_of_month)
time (time.time
- {#time.hour hour
+ [#time.hour hour
#time.minute minute
#time.second second
- #time.milli_second 0})]
+ #time.milli_second 0])]
(in (instant.of_date_time date time)))))))
(def: random_versioning
diff --git a/stdlib/source/test/aedifex/repository/remote.lux b/stdlib/source/test/aedifex/repository/remote.lux
index 3013d8889..3218f15cd 100644
--- a/stdlib/source/test/aedifex/repository/remote.lux
+++ b/stdlib/source/test/aedifex/repository/remote.lux
@@ -42,8 +42,8 @@
(implementation
(def: (request method url headers input)
(with_expansions [<failure> [http/status.bad_request
- {#@http.headers (http.headers (list))
- #@http.body (..url_body "")}]]
+ [#@http.headers (http.headers (list))
+ #@http.body (..url_body "")]]]
(<| io.io
#try.Success
(if (|> headers
@@ -53,8 +53,8 @@
(case [method input]
[#@http.Get #.None]
[http/status.ok
- {#@http.headers (http.headers (list))
- #@http.body (..url_body url)}]
+ [#@http.headers (http.headers (list))
+ #@http.body (..url_body url)]]
[#@http.Put (#.Some input)]
(if (|> headers
@@ -62,8 +62,8 @@
(maybe\each (text\= (//identity.basic_auth user password)))
(maybe.else false))
[http/status.created
- {#@http.headers (http.headers (list))
- #@http.body (..url_body url)}]
+ [#@http.headers (http.headers (list))
+ #@http.body (..url_body url)]]
<failure>)
_
@@ -77,8 +77,8 @@
(<| io.io
#try.Success
[http/status.bad_request
- {#@http.headers (http.headers (list))
- #@http.body (..url_body "")}]))))
+ [#@http.headers (http.headers (list))
+ #@http.body (..url_body "")]]))))
(def: .public test
Test
@@ -95,8 +95,8 @@
($_ _.and
(_.cover [/.repository /.user_agent /.Address]
(let [repo (/.repository (..good_http user password)
- (#.Some {#//identity.user user
- #//identity.password password})
+ (#.Some [#//identity.user user
+ #//identity.password password])
address)]
(and (|> (\ repo download uri)
io.run!
diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux
index b7fb2feb5..bdc83f437 100644
--- a/stdlib/source/test/lux.lux
+++ b/stdlib/source/test/lux.lux
@@ -470,8 +470,8 @@
(/.type: for_type/record
(Record
- {#slot/0 Bit
- #slot/1 Rev}))
+ [#slot/0 Bit
+ #slot/1 Rev]))
(/.type: (for_type/all parameter)
[parameter parameter])
@@ -564,8 +564,8 @@
(_.cover [/.Record]
(exec
(: for_type/record
- {#slot/0 (n.= expected_left expected_right)
- #slot/1 (.rev expected_right)})
+ [#slot/0 (n.= expected_left expected_right)
+ #slot/1 (.rev expected_right)])
true))
))))
@@ -666,13 +666,13 @@
(type: Small
(Record
- {#small_left Nat
- #small_right Text}))
+ [#small_left Nat
+ #small_right Text]))
(type: Big
(Record
- {#big_left Nat
- #big_right Small}))
+ [#big_left Nat
+ #big_right Small]))
(def: for_slot
Test
@@ -685,9 +685,9 @@
.let [expected/s (n.+ shift/s start/s)
expected/b (n.+ shift/b start/b)
- sample {#big_left start/b
- #big_right {#small_left start/s
- #small_right text}}]]
+ sample [#big_left start/b
+ #big_right [#small_left start/s
+ #small_right text]]]]
($_ _.and
(_.cover [/.value@]
(and (and (|> sample
@@ -903,12 +903,12 @@
(type: (Pair l r)
(Record
- {#left l
- #right r}))
+ [#left l
+ #right r]))
(template: (!pair <left> <right>)
- [{#left <left>
- #right <right>}])
+ [[#left <left>
+ #right <right>]])
(def: for_case
Test
@@ -944,8 +944,8 @@
(/.case [expected_nat expected_int]
[0 +0] true
_ false)
- (/.case {#left expected_nat #right expected_int}
- {#left 0 #right +0} true
+ (/.case [#left expected_nat #right expected_int]
+ [#left 0 #right +0] true
_ false)
(/.case (: (Either Nat Int) (#.Left expected_nat))
(#.Left 0) true
@@ -965,17 +965,17 @@
(/.^or "+0.5" "+1.25") true
_ false)))
(_.cover [/.^slots]
- (/.case {#left expected_nat #right expected_int}
+ (/.case [#left expected_nat #right expected_int]
(/.^slots [#left #right])
(and (/.same? expected_nat left)
(/.same? expected_int right))))
(_.cover [/.^]
- (/.case {#left expected_nat #right expected_int}
+ (/.case [#left expected_nat #right expected_int]
(/.^ (!pair 0 +0)) true
_ false))
(_.cover [/.^@]
(let [expected_pair (: (Pair Nat Int)
- {#left expected_nat #right expected_int})]
+ [#left expected_nat #right expected_int])]
(/.case expected_pair
(/.^@ actual_pair (/.^ (!pair actual_left actual_right)))
(and (/.same? expected_pair actual_pair)
@@ -983,7 +983,7 @@
(/.same? expected_int actual_right)))))
(_.cover [/.^multi]
(let [expected_pair (: (Pair Nat Int)
- {#left expected_nat #right expected_int})]
+ [#left expected_nat #right expected_int])]
(and (/.case expected_pair
(/.^multi (/.^ (!pair 0 actual_right))
{actual_right +0})
@@ -1011,7 +1011,7 @@
(_.cover [/.let]
(and (/.let [actual_nat expected_nat]
(/.same? expected_nat actual_nat))
- (/.let [[actual_left actual_right] {#left expected_nat #right expected_int}]
+ (/.let [[actual_left actual_right] [#left expected_nat #right expected_int]]
(and (/.same? expected_nat actual_left)
(/.same? expected_int actual_right)))))
)))
diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux
index a5c090476..ecdeb98dc 100644
--- a/stdlib/source/test/lux/control/concurrency/actor.lux
+++ b/stdlib/source/test/lux/control/concurrency/actor.lux
@@ -89,7 +89,7 @@
(in (do async.monad
[_ (async.future (do io.monad
[actor (/.spawn! (: (/.Behavior Any Any)
- {#/.on_init (|>>)
+ [#/.on_init (|>>)
#/.on_mail (function (_ message state self)
(do {! async.monad}
[outcome (message state self)]
@@ -100,7 +100,7 @@
(in outcome))
(#try.Success _)
- (in outcome))))})
+ (in outcome))))])
[])]
(/.poison! actor)))
_ (async.delay 100)
diff --git a/stdlib/source/test/lux/data/collection/tree.lux b/stdlib/source/test/lux/data/collection/tree.lux
index 35b43bb9b..826e2500d 100644
--- a/stdlib/source/test/lux/data/collection/tree.lux
+++ b/stdlib/source/test/lux/data/collection/tree.lux
@@ -28,8 +28,8 @@
(in [(|> children
(list\each product.left)
(list\mix n.+ 1))
- {#/.value value
- #/.children (list\each product.right children)}])))
+ [#/.value value
+ #/.children (list\each product.right children)]])))
(def: .public test
Test
diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux
index 2567d277f..a3fa4fa3f 100644
--- a/stdlib/source/test/lux/data/format/tar.lux
+++ b/stdlib/source/test/lux/data/format/tar.lux
@@ -196,10 +196,10 @@
tar (|> (row.row (<tag> [expected_path
expected_moment
/.none
- {#/.user {#/.name /.anonymous
- #/.id /.no_id}
- #/.group {#/.name /.anonymous
- #/.id /.no_id}}
+ [#/.user [#/.name /.anonymous
+ #/.id /.no_id]
+ #/.group [#/.name /.anonymous
+ #/.id /.no_id]]
expected_content]))
(format.result /.writer)
(<b>.result /.parser))]
@@ -254,10 +254,10 @@
tar (|> (row.row (#/.Normal [path
(instant.of_millis +0)
expected_mode
- {#/.user {#/.name /.anonymous
- #/.id /.no_id}
- #/.group {#/.name /.anonymous
- #/.id /.no_id}}
+ [#/.user [#/.name /.anonymous
+ #/.id /.no_id]
+ #/.group [#/.name /.anonymous
+ #/.id /.no_id]]
content]))
(format.result /.writer)
(<b>.result /.parser))]
@@ -277,10 +277,10 @@
tar (|> (row.row (#/.Normal [path
(instant.of_millis +0)
<expected_mode>
- {#/.user {#/.name /.anonymous
- #/.id /.no_id}
- #/.group {#/.name /.anonymous
- #/.id /.no_id}}
+ [#/.user [#/.name /.anonymous
+ #/.id /.no_id]
+ #/.group [#/.name /.anonymous
+ #/.id /.no_id]]
content]))
(format.result /.writer)
(<b>.result /.parser))]
@@ -344,10 +344,10 @@
tar (|> (row.row (#/.Normal [path
(instant.of_millis +0)
/.none
- {#/.user {#/.name expected
- #/.id /.no_id}
- #/.group {#/.name /.anonymous
- #/.id /.no_id}}
+ [#/.user [#/.name expected
+ #/.id /.no_id]
+ #/.group [#/.name /.anonymous
+ #/.id /.no_id]]
content]))
(format.result /.writer)
(<b>.result /.parser))]
@@ -368,10 +368,10 @@
tar (|> (row.row (#/.Normal [path
(instant.of_millis +0)
/.none
- {#/.user {#/.name /.anonymous
- #/.id /.no_id}
- #/.group {#/.name /.anonymous
- #/.id /.no_id}}
+ [#/.user [#/.name /.anonymous
+ #/.id /.no_id]
+ #/.group [#/.name /.anonymous
+ #/.id /.no_id]]
content]))
(format.result /.writer)
(<b>.result /.parser))]
diff --git a/stdlib/source/test/lux/locale/language.lux b/stdlib/source/test/lux/locale/language.lux
index e11595968..f8969b224 100644
--- a/stdlib/source/test/lux/locale/language.lux
+++ b/stdlib/source/test/lux/locale/language.lux
@@ -25,11 +25,11 @@
(type: Bundle
(Record
- {#amount Nat
+ [#amount Nat
#names (Set Text)
#codes (Set Text)
#languages (Set /.Language)
- #test Test}))
+ #test Test]))
(template [<bundle> <languages>]
[(def: <bundle>
@@ -37,12 +37,12 @@
(let [amount (template.amount <languages>)
languages (: (List /.Language)
(`` (list (~~ (template.spliced <languages>)))))]
- {#amount amount
+ [#amount amount
#names (|> languages (list\each /.name) (set.of_list text.hash))
#codes (|> languages (list\each /.code) (set.of_list text.hash))
#languages (set.of_list /.hash languages)
#test (_.cover <languages>
- true)}))]
+ true)]))]
[languages/a [/.afar /.abkhazian /.achinese /.acoli /.adangme
/.adyghe /.afro_asiatic /.afrihili /.afrikaans /.ainu
diff --git a/stdlib/source/test/lux/locale/territory.lux b/stdlib/source/test/lux/locale/territory.lux
index b129c333c..f71e26c78 100644
--- a/stdlib/source/test/lux/locale/territory.lux
+++ b/stdlib/source/test/lux/locale/territory.lux
@@ -25,27 +25,27 @@
(type: Bundle
(Record
- {#amount Nat
+ [#amount Nat
#names (Set Text)
#shorts (Set Text)
#longs (Set Text)
#numbers (Set Nat)
#territories (Set /.Territory)
- #test Test}))
+ #test Test]))
(template [<bundle> <territories>]
[(def: <bundle>
Bundle
(let [amount (template.amount <territories>)
territories (`` (list (~~ (template.spliced <territories>))))]
- {#amount amount
+ [#amount amount
#names (|> territories (list\each /.name) (set.of_list text.hash))
#shorts (|> territories (list\each /.short_code) (set.of_list text.hash))
#longs (|> territories (list\each /.long_code) (set.of_list text.hash))
#numbers (|> territories (list\each /.numeric_code) (set.of_list n.hash))
#territories (|> territories (set.of_list /.hash))
#test (_.cover <territories>
- true)}))]
+ true)]))]
[territories/a [/.afghanistan /.aland_islands /.albania /.algeria /.american_samoa
/.andorra /.angola /.anguilla /.antarctica /.antigua
diff --git a/stdlib/source/test/lux/macro.lux b/stdlib/source/test/lux/macro.lux
index ec8b70644..83c27d94c 100644
--- a/stdlib/source/test/lux/macro.lux
+++ b/stdlib/source/test/lux/macro.lux
@@ -65,14 +65,14 @@
current_module (name.module (name_of .._))]]
(in [seed
identifier_prefix
- {#.info {#.target ""
+ [#.info [#.target ""
#.version ""
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
#.current_module (#.Some current_module)
#.modules (list [macro_module
- {#.module_hash 0
+ [#.module_hash 0
#.module_aliases (list)
#.definitions (: (List [Text .Global])
(list (!global /.log_single_expansion!)
@@ -80,9 +80,9 @@
(!global /.log_full_expansion!)))
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active}]
+ #.module_state #.Active]]
[current_module
- {#.module_hash 0
+ [#.module_hash 0
#.module_aliases (list)
#.definitions (: (List [Text .Global])
(list (!global ..pow/2)
@@ -90,17 +90,17 @@
(!global ..repeated)))
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active}])
+ #.module_state #.Active]])
#.scopes (list)
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected #.None
#.seed seed
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []}])))
+ #.host []]])))
(def: expander
Test
diff --git a/stdlib/source/test/lux/macro/syntax/check.lux b/stdlib/source/test/lux/macro/syntax/check.lux
index c2bfd9896..7e69b7dec 100644
--- a/stdlib/source/test/lux/macro/syntax/check.lux
+++ b/stdlib/source/test/lux/macro/syntax/check.lux
@@ -38,8 +38,8 @@
[[type value] ..random]
(_.cover [/.format /.parser]
(case (<code>.result /.parser
- (list (/.format {#/.type type
- #/.value value})))
+ (list (/.format [#/.type type
+ #/.value value])))
(#try.Failure _)
false
diff --git a/stdlib/source/test/lux/macro/syntax/definition.lux b/stdlib/source/test/lux/macro/syntax/definition.lux
index e76d65a7b..aaddbdff5 100644
--- a/stdlib/source/test/lux/macro/syntax/definition.lux
+++ b/stdlib/source/test/lux/macro/syntax/definition.lux
@@ -36,23 +36,23 @@
))
(def: compiler
- {#.info {#.target "FAKE"
+ [#.info [#.target "FAKE"
#.version "0.0.0"
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
#.current_module #.None
#.modules (list)
#.scopes (list)
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected #.None
#.seed 0
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []})
+ #.host []])
(def: .public test
Test
diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux
index 9e0175947..132768afa 100644
--- a/stdlib/source/test/lux/meta.lux
+++ b/stdlib/source/test/lux/meta.lux
@@ -50,23 +50,23 @@
expected_seed random.nat
expected random.nat
dummy (random.only (|>> (n.= expected) not) random.nat)
- .let [expected_lux {#.info {#.target target
+ .let [expected_lux [#.info [#.target target
#.version version
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 source_code]
#.location location.dummy
#.current_module (#.Some expected_current_module)
#.modules (list)
#.scopes (list)
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected (#.Some (#.Primitive primitive_type (list)))
#.seed expected_seed
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []}]]
+ #.host []]]]
($_ _.and
(_.cover [/.result]
(|> (\ /.monad in expected)
@@ -98,23 +98,23 @@
expected random.nat
dummy (random.only (|>> (n.= expected) not) random.nat)
expected_error (random.ascii/upper 1)
- .let [expected_lux {#.info {#.target target
+ .let [expected_lux [#.info [#.target target
#.version version
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 source_code]
#.location location.dummy
#.current_module (#.Some expected_current_module)
#.modules (list)
#.scopes (list)
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected (#.Some (#.Primitive primitive_type (list)))
#.seed expected_seed
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []}]]
+ #.host []]]]
($_ _.and
(_.cover [/.failure]
(|> (/.failure expected_error)
@@ -179,39 +179,39 @@
(not (or (text\= expected_current_module module)
(text\= imported_module_name module))))
(random.ascii/upper 1))
- .let [imported_module {#.module_hash 0
+ .let [imported_module [#.module_hash 0
#.module_aliases (list)
#.definitions (list)
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active}
- expected_module {#.module_hash 0
+ #.module_state #.Active]
+ expected_module [#.module_hash 0
#.module_aliases (list)
#.definitions (list)
#.imports (list imported_module_name)
#.module_annotations #.None
- #.module_state #.Active}
+ #.module_state #.Active]
expected_modules (list [expected_current_module
expected_module]
[imported_module_name
imported_module])
- expected_lux {#.info {#.target target
+ expected_lux [#.info [#.target target
#.version version
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 source_code]
#.location location.dummy
#.current_module (#.Some expected_current_module)
#.modules expected_modules
#.scopes (list)
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected (#.Some (#.Primitive primitive_type (list)))
#.seed expected_seed
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []}]]
+ #.host []]]]
(<| (_.for [.Module])
($_ _.and
(_.cover [/.current_module_name]
@@ -293,12 +293,12 @@
expected random.nat
dummy (random.only (|>> (n.= expected) not) random.nat)
expected_location ..random_location
- .let [type_context {#.ex_counter 0
+ .let [type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
- expected_lux {#.info {#.target target
+ #.var_bindings (list)]
+ expected_lux [#.info [#.target target
#.version version
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 source_code]
#.location expected_location
#.current_module (#.Some expected_current_module)
@@ -310,7 +310,7 @@
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []}]]
+ #.host []]]]
($_ _.and
(_.cover [/.seed]
(|> (do /.monad
@@ -369,36 +369,36 @@
(list)))]
[current_globals
macro_globals
- {#.info {#.target ""
+ [#.info [#.target ""
#.version ""
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
#.current_module (#.Some expected_current_module)
#.modules (list [expected_current_module
- {#.module_hash 0
+ [#.module_hash 0
#.module_aliases (list)
#.definitions current_globals
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active}]
+ #.module_state #.Active]]
[expected_macro_module
- {#.module_hash 0
+ [#.module_hash 0
#.module_aliases (list)
#.definitions macro_globals
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active}])
+ #.module_state #.Active]])
#.scopes (list)
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected #.None
#.seed 0
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []}])))]]
+ #.host []]])))]]
($_ _.and
(_.cover [.Global .Alias /.globals]
(let [[current_globals macro_globals expected_lux]
@@ -487,36 +487,36 @@
(list)))]
[current_globals
macro_globals
- {#.info {#.target ""
+ [#.info [#.target ""
#.version ""
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
#.current_module (#.Some expected_current_module)
#.modules (list [expected_current_module
- {#.module_hash 0
+ [#.module_hash 0
#.module_aliases (list)
#.definitions current_globals
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active}]
+ #.module_state #.Active]]
[expected_macro_module
- {#.module_hash 0
+ [#.module_hash 0
#.module_aliases (list)
#.definitions macro_globals
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active}])
+ #.module_state #.Active]])
#.scopes (list)
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected #.None
#.seed 0
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []}])))]]
+ #.host []]])))]]
($_ _.and
(_.cover [/.export]
(and (let [[current_globals macro_globals expected_lux]
@@ -661,21 +661,21 @@
expected_lux
(: Lux
- {#.info {#.target ""
+ [#.info [#.target ""
#.version ""
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
#.current_module (#.Some current_module)
#.modules (list [current_module
- {#.module_hash 0
+ [#.module_hash 0
#.module_aliases (list)
#.definitions (list)
#.imports (list tag_module)
#.module_annotations #.None
- #.module_state #.Active}]
+ #.module_state #.Active]]
[tag_module
- {#.module_hash 0
+ [#.module_hash 0
#.module_aliases (list)
#.definitions (list& [name_0 (#.Type [false type_0 (#.Left tags_0)])]
[name_1 (#.Type [true type_1 (#.Right tags_1)])]
@@ -690,17 +690,17 @@
[(format "#" short) (#.Slot [true type_1 (#.Item tags_1) index])])))))
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active}])
+ #.module_state #.Active]])
#.scopes (list)
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected #.None
#.seed 0
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []})]]
+ #.host []])]]
($_ _.and
(_.cover [/.tag_lists]
(let [equivalence (list.equivalence
@@ -717,12 +717,12 @@
(/.result expected_lux)
(try\each (\ (maybe.equivalence (list.equivalence name.equivalence)) = (#.Some (list\each (|>> [tag_module]) (#.Item tags_1)))))
(try.else false)))
- (_.cover [/.tag]
+ (_.cover [/.slot]
(|> (#.Item tags_1)
list.enumeration
(list.every? (function (_ [expected_index tag])
(|> [tag_module tag]
- /.tag
+ /.slot
(/.result expected_lux)
(!expect (^multi (#try.Success [actual_index actual_tags actual_type])
(let [correct_index!
@@ -767,50 +767,50 @@
(list [name_4
(#.Definition [false type_4 (' {}) []])]))
- scopes (list {#.name (list)
+ scopes (list [#.name (list)
#.inner 0
- #.locals {#.counter 1
- #.mappings (list [name_3 [type_3 3]])}
- #.captured {#.counter 0
- #.mappings (list)}}
- {#.name (list)
+ #.locals [#.counter 1
+ #.mappings (list [name_3 [type_3 3]])]
+ #.captured [#.counter 0
+ #.mappings (list)]]
+ [#.name (list)
#.inner 0
- #.locals {#.counter 2
+ #.locals [#.counter 2
#.mappings (list [name_1 [type_1 1]]
- [name_2 [type_2 2]])}
- #.captured {#.counter 0
- #.mappings (list)}}
- {#.name (list)
+ [name_2 [type_2 2]])]
+ #.captured [#.counter 0
+ #.mappings (list)]]
+ [#.name (list)
#.inner 0
- #.locals {#.counter 1
- #.mappings (list [name_0 [type_0 0]])}
- #.captured {#.counter 0
- #.mappings (list)}})]
+ #.locals [#.counter 1
+ #.mappings (list [name_0 [type_0 0]])]
+ #.captured [#.counter 0
+ #.mappings (list)]])]
.let [expected_lux
(: Lux
- {#.info {#.target ""
+ [#.info [#.target ""
#.version ""
- #.mode #.Build}
+ #.mode #.Build]
#.source [location.dummy 0 ""]
#.location location.dummy
#.current_module (#.Some current_module)
#.modules (list [current_module
- {#.module_hash 0
+ [#.module_hash 0
#.module_aliases (list)
#.definitions globals
#.imports (list)
#.module_annotations #.None
- #.module_state #.Active}])
+ #.module_state #.Active]])
#.scopes scopes
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected #.None
#.seed 0
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []})]]
+ #.host []])]]
($_ _.and
(_.cover [.Scope /.locals]
(let [equivalence (: (Equivalence (List (List [Text Type])))
@@ -901,23 +901,23 @@
expected random.nat
dummy (random.only (|>> (n.= expected) not) random.nat)
expected_location ..random_location
- .let [expected_lux {#.info {#.target target
+ .let [expected_lux [#.info [#.target target
#.version version
- #.mode #.Build}
+ #.mode #.Build]
#.source [expected_location 0 source_code]
#.location expected_location
#.current_module (#.Some expected_current_module)
#.modules (list)
#.scopes (list)
- #.type_context {#.ex_counter 0
+ #.type_context [#.ex_counter 0
#.var_counter 0
- #.var_bindings (list)}
+ #.var_bindings (list)]
#.expected (#.Some expected_type)
#.seed expected_seed
#.scope_type_vars (list)
#.extensions []
#.eval (:as (-> Type Code (Meta Any)) [])
- #.host []}]]
+ #.host []]]]
($_ _.and
(_.for [/.functor]
($functor.spec ..injection (..comparison expected_lux) /.functor))
diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux
index 2a9161c8c..436b78d6d 100644
--- a/stdlib/source/test/lux/target/jvm.lux
+++ b/stdlib/source/test/lux/target/jvm.lux
@@ -135,11 +135,11 @@
(type: (Primitive a)
(Record
- {#unboxed (Type category.Return)
+ [#unboxed (Type category.Return)
#boxed (Type category.Class)
#wrap (Bytecode Any)
#random (Random a)
- #literal (-> a (Bytecode Any))}))
+ #literal (-> a (Bytecode Any))]))
(def: $Boolean
(/type.class "java.lang.Boolean" (list)))
@@ -155,11 +155,11 @@
..!false))
(def: $Boolean::primitive
(Primitive java/lang/Boolean)
- {#unboxed /type.boolean
+ [#unboxed /type.boolean
#boxed ..$Boolean
#wrap ..$Boolean::wrap
#random ..$Boolean::random
- #literal ..$Boolean::literal})
+ #literal ..$Boolean::literal])
(def: $Byte
(/type.class "java.lang.Byte" (list)))
@@ -173,11 +173,11 @@
(|>> ffi.byte_to_long (:as I64) i32.i32 /.int))
(def: $Byte::primitive
(Primitive java/lang/Byte)
- {#unboxed /type.byte
+ [#unboxed /type.byte
#boxed ..$Byte
#wrap ..$Byte::wrap
#random ..$Byte::random
- #literal ..$Byte::literal})
+ #literal ..$Byte::literal])
(def: $Short
(/type.class "java.lang.Short" (list)))
@@ -191,11 +191,11 @@
(|>> ffi.short_to_long (:as I64) i32.i32 /.int))
(def: $Short::primitive
(Primitive java/lang/Short)
- {#unboxed /type.short
+ [#unboxed /type.short
#boxed ..$Short
#wrap ..$Short::wrap
#random ..$Short::random
- #literal ..$Short::literal})
+ #literal ..$Short::literal])
(def: $Integer
(/type.class "java.lang.Integer" (list)))
@@ -209,11 +209,11 @@
(|>> ffi.int_to_long (:as I64) i32.i32 /.int))
(def: $Integer::primitive
(Primitive java/lang/Integer)
- {#unboxed /type.int
+ [#unboxed /type.int
#boxed ..$Integer
#wrap ..$Integer::wrap
#random ..$Integer::random
- #literal ..$Integer::literal})
+ #literal ..$Integer::literal])
(def: $Long (/type.class "java.lang.Long" (list)))
(def: $Long::wrap (/.invokestatic ..$Long "valueOf" (/type.method [(list) (list /type.long) ..$Long (list)])))
@@ -221,11 +221,11 @@
(def: $Long::literal (-> java/lang/Long (Bytecode Any)) (|>> (:as Int) /.long))
(def: $Long::primitive
(Primitive java/lang/Long)
- {#unboxed /type.long
+ [#unboxed /type.long
#boxed ..$Long
#wrap ..$Long::wrap
#random ..$Long::random
- #literal ..$Long::literal})
+ #literal ..$Long::literal])
(def: $Float (/type.class "java.lang.Float" (list)))
(def: $Float::wrap (/.invokestatic ..$Float "valueOf" (/type.method [(list) (list /type.float) ..$Float (list)])))
@@ -241,11 +241,11 @@
..$Float::random))
(def: $Float::primitive
(Primitive java/lang/Float)
- {#unboxed /type.float
+ [#unboxed /type.float
#boxed ..$Float
#wrap ..$Float::wrap
#random ..valid_float
- #literal ..$Float::literal})
+ #literal ..$Float::literal])
(def: $Double (/type.class "java.lang.Double" (list)))
(def: $Double::wrap (/.invokestatic ..$Double "valueOf" (/type.method [(list) (list /type.double) ..$Double (list)])))
@@ -259,11 +259,11 @@
..$Double::random))
(def: $Double::primitive
(Primitive java/lang/Double)
- {#unboxed /type.double
+ [#unboxed /type.double
#boxed ..$Double
#wrap ..$Double::wrap
#random ..valid_double
- #literal ..$Double::literal})
+ #literal ..$Double::literal])
(def: $Character
(/type.class "java.lang.Character" (list)))
@@ -277,11 +277,11 @@
(|>> ffi.char_to_long (:as I64) i32.i32 /.int))
(def: $Character::primitive
(Primitive java/lang/Character)
- {#unboxed /type.char
+ [#unboxed /type.char
#boxed ..$Character
#wrap ..$Character::wrap
#random ..$Character::random
- #literal ..$Character::literal})
+ #literal ..$Character::literal])
(def: $String
(/type.class "java.lang.String" (list)))
@@ -296,11 +296,11 @@
(def: $String::primitive
(Primitive java/lang/String)
- {#unboxed ..$String
+ [#unboxed ..$String
#boxed ..$String
#wrap /.nop
#random ..$String::random
- #literal ..$String::literal})
+ #literal ..$String::literal])
(template [<name> <bits> <type> <push> <wrap> <message> <to_long> <signed>]
[(def: <name>
@@ -1374,11 +1374,11 @@
(_.lifted "DRETURN" (primitive_return ..$Double::primitive /.dreturn #.None (!::= java/lang/Double "jvm deq" "jvm double =")))
(_.lifted "ARETURN" (primitive_return ..$String::primitive /.areturn #.None (function (_ expected actual) (text\= (:as Text expected) (:as Text actual)))))
(_.lifted "RETURN" (primitive_return (: (Primitive java/lang/String)
- {#unboxed /type.void
+ [#unboxed /type.void
#boxed ..$String
#wrap /.nop
#random ..$String::random
- #literal (function.constant /.nop)})
+ #literal (function.constant /.nop)])
/.return
(#.Some ..$String::literal)
(function (_ expected actual) (text\= (:as Text expected) (:as Text actual)))))
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux
index c39978c4f..e716d380a 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux
@@ -175,10 +175,10 @@
(#synthesis.Then (synthesis.i64 (.i64 then))))
(#synthesis.Seq (synthesis.path/bit (not test))
(#synthesis.Then (synthesis.i64 (.i64 else)))))
- [{#analysis.when (analysis.pattern/bit test)
- #analysis.then (analysis.nat then)}
- (list {#analysis.when (analysis.pattern/bit (not test))
- #analysis.then (analysis.nat else)})]])))
+ [[#analysis.when (analysis.pattern/bit test)
+ #analysis.then (analysis.nat then)]
+ (list [#analysis.when (analysis.pattern/bit (not test))
+ #analysis.then (analysis.nat else)])]])))
(def: (random_five hash random_element)
(All (_ a) (-> (Hash a) (Random a) (Random [a a a a a])))
@@ -203,11 +203,11 @@
(#synthesis.Seq (<path> test/2) (#synthesis.Then (<synthesis> body/2)))
(#synthesis.Seq (<path> test/3) (#synthesis.Then (<synthesis> body/3)))
(#synthesis.Seq (<path> test/4) (#synthesis.Then (<synthesis> body/4))))
- [{#analysis.when (<pattern> test/0) #analysis.then (<analysis> body/0)}
- (list {#analysis.when (<pattern> test/1) #analysis.then (<analysis> body/1)}
- {#analysis.when (<pattern> test/2) #analysis.then (<analysis> body/2)}
- {#analysis.when (<pattern> test/3) #analysis.then (<analysis> body/3)}
- {#analysis.when (<pattern> test/4) #analysis.then (<analysis> body/4)})]])))]
+ [[#analysis.when (<pattern> test/0) #analysis.then (<analysis> body/0)]
+ (list [#analysis.when (<pattern> test/1) #analysis.then (<analysis> body/1)]
+ [#analysis.when (<pattern> test/2) #analysis.then (<analysis> body/2)]
+ [#analysis.when (<pattern> test/3) #analysis.then (<analysis> body/3)]
+ [#analysis.when (<pattern> test/4) #analysis.then (<analysis> body/4)])]])))]
[random_nat n.hash random.nat (|>> .i64 synthesis.path/i64) (|>> .i64 synthesis.i64) analysis.pattern/nat analysis.nat]
[random_int int.hash random.int (|>> .i64 synthesis.path/i64) (|>> .i64 synthesis.i64) analysis.pattern/int analysis.int]
@@ -243,10 +243,10 @@
(#synthesis.Then (synthesis.f64 body)))))
branch (: (-> Nat Bit Text Frac Branch)
(function (_ lefts right? value body)
- {#analysis.when (analysis.pattern/variant {#analysis.lefts lefts
+ [#analysis.when (analysis.pattern/variant [#analysis.lefts lefts
#analysis.right? right?
- #analysis.value (analysis.pattern/text value)})
- #analysis.then (analysis.frac body)}))]]
+ #analysis.value (analysis.pattern/text value)])
+ #analysis.then (analysis.frac body)]))]]
(in [($_ #synthesis.Alt
(path lefts/0 false value/0 body/0)
(path lefts/1 false value/1 body/1)
@@ -289,14 +289,14 @@
(#synthesis.Then (synthesis.f64 body))))))
branch (: (-> Nat Bit Text Frac Branch)
(function (_ lefts right? value body)
- {#analysis.when (if right?
+ [#analysis.when (if right?
(analysis.pattern/tuple (list\composite (list.repeated (++ lefts) (analysis.pattern/unit))
(list (analysis.pattern/text value))))
(analysis.pattern/tuple ($_ list\composite
(list.repeated lefts (analysis.pattern/unit))
(list (analysis.pattern/text value)
(analysis.pattern/unit)))))
- #analysis.then (analysis.frac body)}))]]
+ #analysis.then (analysis.frac body)]))]]
(in [(list\mix (function (_ left right)
(#synthesis.Alt left right))
(path (++ mid_size) true value/last body/last)
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux
index f66e00492..099e10d50 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux
@@ -39,14 +39,14 @@
(def: (n_function loop? arity body)
(-> Bit Arity Synthesis Synthesis)
(synthesis.function/abstraction
- {#synthesis.environment (list)
+ [#synthesis.environment (list)
#synthesis.arity arity
#synthesis.body (if loop?
(synthesis.loop/scope
- {#synthesis.start 1
+ [#synthesis.start 1
#synthesis.inits (list)
- #synthesis.iteration body})
- body)}))
+ #synthesis.iteration body])
+ body)]))
(def: (n_abstraction arity body)
(-> Arity Analysis Analysis)
@@ -70,9 +70,10 @@
false))
(type: Circumstance
- {#loop? Bit
- #expectation Synthesis
- #reality Analysis})
+ (Record
+ [#loop? Bit
+ #expectation Synthesis
+ #reality Analysis]))
(type: Scenario
(-> Bit (Random Circumstance)))
@@ -119,13 +120,13 @@
[loop? expected_value actual_value] (random_value false)]
(in [loop?
(synthesis.variant
- {#analysis.lefts lefts
+ [#analysis.lefts lefts
#analysis.right? right?
- #analysis.value expected_value})
+ #analysis.value expected_value])
(analysis.variant
- {#analysis.lefts lefts
+ [#analysis.lefts lefts
#analysis.right? right?
- #analysis.value actual_value})])))
+ #analysis.value actual_value])])))
(def: (random_tuple random_value output?)
(-> Scenario Scenario)
@@ -211,29 +212,29 @@
synthesis.path/pop
(synthesis.path/then expected_output))))])
(#analysis.Case actual_input
- [{#analysis.when (analysis.pattern/unit)
- #analysis.then actual_output}
- (list {#analysis.when (analysis.pattern/bit bit_test)
- #analysis.then actual_output}
- {#analysis.when (analysis.pattern/nat (.nat i64_test))
- #analysis.then actual_output}
- {#analysis.when (analysis.pattern/frac f64_test)
- #analysis.then actual_output}
- {#analysis.when (analysis.pattern/text text_test)
- #analysis.then actual_output}
- {#analysis.when (#analysis.Bind 2)
- #analysis.then actual_output}
- {#analysis.when (analysis.pattern/variant
- {#analysis.lefts lefts
+ [[#analysis.when (analysis.pattern/unit)
+ #analysis.then actual_output]
+ (list [#analysis.when (analysis.pattern/bit bit_test)
+ #analysis.then actual_output]
+ [#analysis.when (analysis.pattern/nat (.nat i64_test))
+ #analysis.then actual_output]
+ [#analysis.when (analysis.pattern/frac f64_test)
+ #analysis.then actual_output]
+ [#analysis.when (analysis.pattern/text text_test)
+ #analysis.then actual_output]
+ [#analysis.when (#analysis.Bind 2)
+ #analysis.then actual_output]
+ [#analysis.when (analysis.pattern/variant
+ [#analysis.lefts lefts
#analysis.right? right?
- #analysis.value (#analysis.Bind 2)})
- #analysis.then actual_output}
- {#analysis.when (analysis.pattern/tuple
+ #analysis.value (#analysis.Bind 2)])
+ #analysis.then actual_output]
+ [#analysis.when (analysis.pattern/tuple
(list\composite (list.repeated lefts (analysis.pattern/unit))
(if right?
(list (analysis.pattern/unit) (#analysis.Bind 2))
(list (#analysis.Bind 2) (analysis.pattern/unit)))))
- #analysis.then actual_output})])])))
+ #analysis.then actual_output])])])))
(def: (random_let arity random_value output?)
(-> Arity Scenario Scenario)
@@ -246,8 +247,8 @@
(++ arity)
expected_output])
(#analysis.Case actual_input
- [{#analysis.when (#analysis.Bind 2)
- #analysis.then actual_output}
+ [[#analysis.when (#analysis.Bind 2)
+ #analysis.then actual_output]
(list)])])))
(def: (random_if random_value output?)
@@ -265,15 +266,15 @@
expected_else])
(if flip?
(#analysis.Case actual_test
- [{#analysis.when (analysis.pattern/bit false)
- #analysis.then actual_else}
- (list {#analysis.when (analysis.pattern/bit true)
- #analysis.then actual_then})])
+ [[#analysis.when (analysis.pattern/bit false)
+ #analysis.then actual_else]
+ (list [#analysis.when (analysis.pattern/bit true)
+ #analysis.then actual_then])])
(#analysis.Case actual_test
- [{#analysis.when (analysis.pattern/bit true)
- #analysis.then actual_then}
- (list {#analysis.when (analysis.pattern/bit false)
- #analysis.then actual_else})]))])))
+ [[#analysis.when (analysis.pattern/bit true)
+ #analysis.then actual_then]
+ (list [#analysis.when (analysis.pattern/bit false)
+ #analysis.then actual_else])]))])))
(def: (random_get random_value output?)
(-> Scenario Scenario)
@@ -287,12 +288,12 @@
(#.Left lefts)))
expected_record])
(#analysis.Case actual_record
- [{#analysis.when (analysis.pattern/tuple
+ [[#analysis.when (analysis.pattern/tuple
(list\composite (list.repeated lefts (analysis.pattern/unit))
(if right?
(list (analysis.pattern/unit) (#analysis.Bind 2))
(list (#analysis.Bind 2) (analysis.pattern/unit)))))
- #analysis.then (#analysis.Reference (reference.local 2))}
+ #analysis.then (#analysis.Reference (reference.local 2))]
(list)])])))
(def: (random_branch arity random_value output?)
@@ -323,9 +324,9 @@
true
(list\each product.left resets))
(synthesis.loop/scope
- {#synthesis.start (++ arity)
+ [#synthesis.start (++ arity)
#synthesis.inits (list\each (|>> product.right product.left) resets)
- #synthesis.iteration expected_output})
+ #synthesis.iteration expected_output])
(analysis.apply [(..n_abstraction arity actual_output)
(list\each (|>> product.right product.right) resets)])])))
@@ -349,12 +350,12 @@
(list (#variable.Local 1)))]]
(in [true
(synthesis.function/abstraction
- {#synthesis.environment environment
+ [#synthesis.environment environment
#synthesis.arity 1
#synthesis.body (synthesis.loop/scope
- {#synthesis.start 1
+ [#synthesis.start 1
#synthesis.inits (list)
- #synthesis.iteration expected_output})})
+ #synthesis.iteration expected_output])])
(#analysis.Function environment
actual_output)])))
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
index 63212fe0a..59e9f03cf 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
@@ -92,13 +92,13 @@
[next [valueE valueA]] (..reference offset arity next)]
(in [next
[(//.variant
- {#analysis.lefts lefts
+ [#analysis.lefts lefts
#analysis.right? right?
- #analysis.value valueE})
+ #analysis.value valueE])
(//.variant
- {#analysis.lefts lefts
+ [#analysis.lefts lefts
#analysis.right? right?
- #analysis.value valueA})]]))
+ #analysis.value valueA])]]))
(do {! random.monad}
[[next [leftE leftA]] (..reference offset arity next)
[next [rightE rightA]] (..reference offset arity next)]
@@ -204,13 +204,13 @@
[next [iterationE iterationA]] (..reference offset arity next)]
(in [next
[(//.loop/scope
- {#//.start (/.register_optimization offset next)
+ [#//.start (/.register_optimization offset next)
#//.inits (list firstE secondE)
- #//.iteration iterationE})
+ #//.iteration iterationE])
(//.loop/scope
- {#//.start next
+ [#//.start next
#//.inits (list firstA secondA)
- #//.iteration iterationA})]]))
+ #//.iteration iterationA])]]))
))
(def: (function offset arity next)
@@ -223,13 +223,13 @@
[next [bodyE bodyA]] (..primitive 0 arity next)]
(in [next
[(//.function/abstraction
- {#//.environment (list firstE secondE)
+ [#//.environment (list firstE secondE)
#//.arity arity
- #//.body bodyE})
+ #//.body bodyE])
(//.function/abstraction
- {#//.environment (list firstA secondA)
+ [#//.environment (list firstA secondA)
#//.arity arity
- #//.body bodyA})]]))
+ #//.body bodyA])]]))
))
(def: (control offset arity next)
@@ -274,11 +274,11 @@
[_ [expected iteration]] (..scenario expected_offset arity 0)]
(_.cover [/.Transform /.optimization /.register_optimization]
(case (/.optimization true expected_offset expected_inits
- {#//.environment (|> expected_offset
+ [#//.environment (|> expected_offset
list.indices
(list\each (|>> #variable.Local)))
#//.arity arity
- #//.body iteration})
+ #//.body iteration])
(^ (#.Some (//.loop/scope [actual_offset actual_inits
actual])))
(and (n.= expected_offset
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
index e817d05c5..fa9a9f646 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
@@ -35,8 +35,8 @@
false))
(type: Context
- {#redundants Nat
- #necessary (Dictionary Nat Nat)})
+ [#redundants Nat
+ #necessary (Dictionary Nat Nat)])
(type: (Scenario a)
(-> Context (Random [a a])))
@@ -319,8 +319,8 @@
(def: default
Context
- {#redundants 0
- #necessary (dictionary.empty n.hash)})
+ [#redundants 0
+ #necessary (dictionary.empty n.hash)])
(def: .public test
Test
diff --git a/stdlib/source/test/lux/type/poly/equivalence.lux b/stdlib/source/test/lux/type/poly/equivalence.lux
index a66c390b3..e30ae9ba4 100644
--- a/stdlib/source/test/lux/type/poly/equivalence.lux
+++ b/stdlib/source/test/lux/type/poly/equivalence.lux
@@ -38,7 +38,7 @@
(type: Record
(.Record
- {#bit Bit
+ [#bit Bit
#int Int
#frac Frac
#text Text
@@ -46,7 +46,7 @@
#list (List Int)
#variant Variant
#tuple [Int Frac Text]
- #recursive Recursive}))
+ #recursive Recursive]))
(def: gen_recursive
(Random Recursive)
diff --git a/stdlib/source/test/lux/type/poly/json.lux b/stdlib/source/test/lux/type/poly/json.lux
index 9b6d5338a..f5bc61ab0 100644
--- a/stdlib/source/test/lux/type/poly/json.lux
+++ b/stdlib/source/test/lux/type/poly/json.lux
@@ -62,7 +62,7 @@
(type: Record
(.Record
- {#bit Bit
+ [#bit Bit
#frac Frac
#text Text
#maybe (Maybe Frac)
@@ -74,7 +74,7 @@
... #instant ti.Instant
... #duration tdu.Duration
#date tda.Date
- #grams (unit.Qty unit.Gram)}))
+ #grams (unit.Qty unit.Gram)]))
(def: gen_recursive
(Random Recursive)
diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux
index cdac7ac43..3f0531040 100644
--- a/stdlib/source/test/lux/world/net/http/client.lux
+++ b/stdlib/source/test/lux/world/net/http/client.lux
@@ -60,10 +60,10 @@
(\ nat.decimal encoded)
(\ utf8.codec encoded))]
(#try.Success [//status.ok
- {#//.headers headers
+ [#//.headers headers
#//.body (function (_ ?wanted_bytes)
(io.io (#try.Success [(binary.size data)
- data])))}]))))))]]
+ data])))]]))))))]]
(`` ($_ _.and
(~~ (template [<definition> <expected>]
[(_.cover [<definition>]