aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source')
-rw-r--r--stdlib/source/lux.lux36
-rw-r--r--stdlib/source/lux/cli.lux9
-rw-r--r--stdlib/source/lux/concurrency/actor.lux20
-rw-r--r--stdlib/source/lux/concurrency/atom.lux2
-rw-r--r--stdlib/source/lux/concurrency/frp.lux15
-rw-r--r--stdlib/source/lux/concurrency/promise.lux15
-rw-r--r--stdlib/source/lux/concurrency/semaphore.lux8
-rw-r--r--stdlib/source/lux/concurrency/stm.lux20
-rw-r--r--stdlib/source/lux/control/apply.lux2
-rw-r--r--stdlib/source/lux/control/comonad.lux2
-rw-r--r--stdlib/source/lux/control/concatenative.lux55
-rw-r--r--stdlib/source/lux/control/contract.lux8
-rw-r--r--stdlib/source/lux/control/exception.lux11
-rw-r--r--stdlib/source/lux/control/monad.lux3
-rw-r--r--stdlib/source/lux/control/monad/indexed.lux2
-rw-r--r--stdlib/source/lux/control/parser.lux9
-rw-r--r--stdlib/source/lux/control/pipe.lux6
-rw-r--r--stdlib/source/lux/control/predicate.lux5
-rw-r--r--stdlib/source/lux/control/reader.lux2
-rw-r--r--stdlib/source/lux/control/region.lux8
-rw-r--r--stdlib/source/lux/control/writer.lux2
-rw-r--r--stdlib/source/lux/data/collection/array.lux6
-rw-r--r--stdlib/source/lux/data/collection/bits.lux7
-rw-r--r--stdlib/source/lux/data/collection/dictionary.lux10
-rw-r--r--stdlib/source/lux/data/collection/dictionary/ordered.lux7
-rw-r--r--stdlib/source/lux/data/collection/list.lux10
-rw-r--r--stdlib/source/lux/data/collection/queue.lux4
-rw-r--r--stdlib/source/lux/data/collection/queue/priority.lux8
-rw-r--r--stdlib/source/lux/data/collection/row.lux13
-rw-r--r--stdlib/source/lux/data/collection/sequence.lux7
-rw-r--r--stdlib/source/lux/data/collection/set.lux7
-rw-r--r--stdlib/source/lux/data/collection/set/multi.lux17
-rw-r--r--stdlib/source/lux/data/collection/set/ordered.lux5
-rw-r--r--stdlib/source/lux/data/collection/stack.lux2
-rw-r--r--stdlib/source/lux/data/collection/tree/finger.lux4
-rw-r--r--stdlib/source/lux/data/collection/tree/rose.lux6
-rw-r--r--stdlib/source/lux/data/collection/tree/rose/parser.lux2
-rw-r--r--stdlib/source/lux/data/collection/tree/rose/zipper.lux54
-rw-r--r--stdlib/source/lux/data/color.lux9
-rw-r--r--stdlib/source/lux/data/format/binary.lux13
-rw-r--r--stdlib/source/lux/data/format/css.lux7
-rw-r--r--stdlib/source/lux/data/format/json.lux24
-rw-r--r--stdlib/source/lux/data/format/xml.lux12
-rw-r--r--stdlib/source/lux/data/ident.lux6
-rw-r--r--stdlib/source/lux/data/lazy.lux8
-rw-r--r--stdlib/source/lux/data/maybe.lux16
-rw-r--r--stdlib/source/lux/data/number.lux10
-rw-r--r--stdlib/source/lux/data/number/complex.lux11
-rw-r--r--stdlib/source/lux/data/number/ratio.lux18
-rw-r--r--stdlib/source/lux/data/store.lux3
-rw-r--r--stdlib/source/lux/data/text.lux12
-rw-r--r--stdlib/source/lux/data/text/buffer.lux10
-rw-r--r--stdlib/source/lux/data/text/encoding.lux9
-rw-r--r--stdlib/source/lux/data/text/format.lux30
-rw-r--r--stdlib/source/lux/data/text/lexer.lux12
-rw-r--r--stdlib/source/lux/data/text/regex.lux15
-rw-r--r--stdlib/source/lux/data/text/unicode.lux12
-rw-r--r--stdlib/source/lux/data/trace.lux2
-rw-r--r--stdlib/source/lux/host.jvm.lux45
-rw-r--r--stdlib/source/lux/language/compiler.lux9
-rw-r--r--stdlib/source/lux/language/compiler/analysis.lux13
-rw-r--r--stdlib/source/lux/language/compiler/analysis/case.lux23
-rw-r--r--stdlib/source/lux/language/compiler/analysis/case/coverage.lux25
-rw-r--r--stdlib/source/lux/language/compiler/analysis/expression.lux23
-rw-r--r--stdlib/source/lux/language/compiler/analysis/function.lux16
-rw-r--r--stdlib/source/lux/language/compiler/analysis/inference.lux13
-rw-r--r--stdlib/source/lux/language/compiler/analysis/module.lux106
-rw-r--r--stdlib/source/lux/language/compiler/analysis/primitive.lux6
-rw-r--r--stdlib/source/lux/language/compiler/analysis/reference.lux13
-rw-r--r--stdlib/source/lux/language/compiler/analysis/scope.lux19
-rw-r--r--stdlib/source/lux/language/compiler/analysis/structure.lux26
-rw-r--r--stdlib/source/lux/language/compiler/analysis/type.lux11
-rw-r--r--stdlib/source/lux/language/compiler/default/cache.lux26
-rw-r--r--stdlib/source/lux/language/compiler/default/repl/type.lux14
-rw-r--r--stdlib/source/lux/language/compiler/extension.lux11
-rw-r--r--stdlib/source/lux/language/compiler/extension/analysis.lux6
-rw-r--r--stdlib/source/lux/language/compiler/extension/analysis/common.lux51
-rw-r--r--stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux24
-rw-r--r--stdlib/source/lux/language/compiler/extension/bundle.lux10
-rw-r--r--stdlib/source/lux/language/compiler/init.lux22
-rw-r--r--stdlib/source/lux/language/compiler/meta/archive.lux22
-rw-r--r--stdlib/source/lux/language/compiler/meta/cache.lux28
-rw-r--r--stdlib/source/lux/language/compiler/meta/cache/dependency.lux2
-rw-r--r--stdlib/source/lux/language/compiler/meta/io/archive.lux8
-rw-r--r--stdlib/source/lux/language/compiler/meta/io/context.lux29
-rw-r--r--stdlib/source/lux/language/compiler/synthesis.lux9
-rw-r--r--stdlib/source/lux/language/compiler/synthesis/case.lux15
-rw-r--r--stdlib/source/lux/language/compiler/synthesis/expression.lux18
-rw-r--r--stdlib/source/lux/language/compiler/synthesis/function.lux20
-rw-r--r--stdlib/source/lux/language/compiler/synthesis/loop.lux19
-rw-r--r--stdlib/source/lux/language/compiler/translation.lux18
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux52
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux19
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/extension.jvm.lux43
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/extension/common.jvm.lux394
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/extension/host.jvm.lux11
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/function.jvm.lux50
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/loop.jvm.lux29
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux5
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/reference.jvm.lux16
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux23
-rw-r--r--stdlib/source/lux/language/compiler/translation/scheme/structure.jvm.lux26
-rw-r--r--stdlib/source/lux/language/host/scheme.lux7
-rw-r--r--stdlib/source/lux/language/name.lux2
-rw-r--r--stdlib/source/lux/language/syntax.lux8
-rw-r--r--stdlib/source/lux/language/type.lux12
-rw-r--r--stdlib/source/lux/language/type/check.lux17
-rw-r--r--stdlib/source/lux/macro.lux16
-rw-r--r--stdlib/source/lux/macro/code.lux8
-rw-r--r--stdlib/source/lux/macro/poly.lux30
-rw-r--r--stdlib/source/lux/macro/poly/equivalence.lux36
-rw-r--r--stdlib/source/lux/macro/poly/functor.lux17
-rw-r--r--stdlib/source/lux/macro/poly/json.lux27
-rw-r--r--stdlib/source/lux/macro/syntax.lux29
-rw-r--r--stdlib/source/lux/macro/syntax/common/reader.lux17
-rw-r--r--stdlib/source/lux/macro/syntax/common/writer.lux10
-rw-r--r--stdlib/source/lux/math.lux9
-rw-r--r--stdlib/source/lux/math/logic/fuzzy.lux7
-rw-r--r--stdlib/source/lux/math/modular.lux10
-rw-r--r--stdlib/source/lux/math/random.lux40
-rw-r--r--stdlib/source/lux/test.lux27
-rw-r--r--stdlib/source/lux/time/date.lux7
-rw-r--r--stdlib/source/lux/time/duration.lux2
-rw-r--r--stdlib/source/lux/time/instant.lux19
-rw-r--r--stdlib/source/lux/type/abstract.lux12
-rw-r--r--stdlib/source/lux/type/implicit.lux99
-rw-r--r--stdlib/source/lux/type/object/interface.lux17
-rw-r--r--stdlib/source/lux/type/object/protocol.lux11
-rw-r--r--stdlib/source/lux/type/quotient.lux11
-rw-r--r--stdlib/source/lux/type/refinement.lux11
-rw-r--r--stdlib/source/lux/type/resource.lux24
-rw-r--r--stdlib/source/lux/type/unit.lux2
-rw-r--r--stdlib/source/lux/world/blob.jvm.lux12
-rw-r--r--stdlib/source/lux/world/console.lux28
-rw-r--r--stdlib/source/lux/world/environment.jvm.lux22
-rw-r--r--stdlib/source/lux/world/file.lux21
-rw-r--r--stdlib/source/lux/world/net/tcp.jvm.lux31
-rw-r--r--stdlib/source/lux/world/net/udp.jvm.lux27
138 files changed, 1407 insertions, 1294 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index 226545576..392d3a504 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -4220,15 +4220,7 @@
#import-refer {#refer-defs #All
#refer-open (list)}})))
- (^ [_ (#Tuple (list [_ (#Symbol ["" m-name])]))])
- (do Monad<Meta>
- [import-name (clean-module nested? relative-root m-name)]
- (wrap (list {#import-name import-name
- #import-alias (#Some m-name)
- #import-refer {#refer-defs #Nothing
- #refer-open (list)}})))
-
- (^ [_ (#Tuple (list& [_ (#Text alias)] [_ (#Symbol ["" m-name])] extra))])
+ (^ [_ (#Tuple (list& [_ (#Symbol ["" m-name])] extra))])
(do Monad<Meta>
[import-name (clean-module nested? relative-root m-name)
referral+extra (parse-referrals extra)
@@ -4236,13 +4228,15 @@
openings+extra (parse-openings extra)
#let [[openings extra] openings+extra]
sub-imports (parse-imports #1 import-name extra)]
- (wrap (list& {#import-name import-name
- #import-alias (#Some (replace-all "." m-name alias))
- #import-refer {#refer-defs referral
- #refer-open openings}}
- sub-imports)))
+ (wrap (case [referral openings]
+ [#Nothing #Nil] sub-imports
+ _ (list& {#import-name import-name
+ #import-alias #None
+ #import-refer {#refer-defs referral
+ #refer-open openings}}
+ sub-imports))))
- (^ [_ (#Tuple (list& [_ (#Symbol ["" m-name])] extra))])
+ (^ [_ (#Tuple (list& [_ (#Text alias)] [_ (#Symbol ["" m-name])] extra))])
(do Monad<Meta>
[import-name (clean-module nested? relative-root m-name)
referral+extra (parse-referrals extra)
@@ -4250,13 +4244,11 @@
openings+extra (parse-openings extra)
#let [[openings extra] openings+extra]
sub-imports (parse-imports #1 import-name extra)]
- (wrap (case [referral openings]
- [#Nothing #Nil] sub-imports
- _ (list& {#import-name import-name
- #import-alias (#Some m-name)
- #import-refer {#refer-defs referral
- #refer-open openings}}
- sub-imports))))
+ (wrap (list& {#import-name import-name
+ #import-alias (#Some (replace-all "." m-name alias))
+ #import-refer {#refer-defs referral
+ #refer-open openings}}
+ sub-imports)))
_
(do Monad<Meta>
diff --git a/stdlib/source/lux/cli.lux b/stdlib/source/lux/cli.lux
index 5b4b9b6bc..10b225077 100644
--- a/stdlib/source/lux/cli.lux
+++ b/stdlib/source/lux/cli.lux
@@ -4,13 +4,14 @@
monad
["p" parser]]
[data
- [collection [list ("list/" Monoid<List> Monad<List>)]]
- [text ("text/" Equivalence<Text>)
+ [collection
+ [list ("list/" Monoid<List> Monad<List>)]]
+ ["." text ("text/" Equivalence<Text>)
format]
["E" error]]
- [io]
+ ["." io]
[macro (#+ with-gensyms)
- [code]
+ ["." code]
["s" syntax (#+ syntax: Syntax)]]])
## [Types]
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux
index cb35b0706..971bbe01e 100644
--- a/stdlib/source/lux/concurrency/actor.lux
+++ b/stdlib/source/lux/concurrency/actor.lux
@@ -3,14 +3,16 @@
[control monad
["p" parser]
["ex" exception (#+ exception:)]]
- [io (#- run) ("io/" Monad<IO>)]
+ ["." io (#- run) ("io/" Monad<IO>)]
[data
- [product]
+ ["." product]
["e" error]
- text/format
- [collection [list ("list/" Monoid<List> Monad<List> Fold<List>)]]]
- [macro (#+ with-gensyms Monad<Meta>)
- [code]
+ [text
+ format]
+ [collection
+ ["." list ("list/" Monoid<List> Monad<List> Fold<List>)]]]
+ ["." macro (#+ with-gensyms Monad<Meta>)
+ ["." code]
["s" syntax (#+ syntax: Syntax)]
[syntax
["cs" common]
@@ -20,9 +22,9 @@
[type
abstract]]
[//
- [atom (#+ Atom atom)]
- [promise (#+ Promise promise) ("promise/" Monad<Promise>)]
- [task (#+ Task)]])
+ ["." atom (#+ Atom atom)]
+ ["." promise (#+ Promise promise) ("promise/" Monad<Promise>)]
+ ["." task (#+ Task)]])
(exception: #export poisoned)
diff --git a/stdlib/source/lux/concurrency/atom.lux b/stdlib/source/lux/concurrency/atom.lux
index a06a93b4e..f81eafc22 100644
--- a/stdlib/source/lux/concurrency/atom.lux
+++ b/stdlib/source/lux/concurrency/atom.lux
@@ -1,6 +1,6 @@
(.module:
[lux #*
- [function]
+ ["." function]
[io (#- run)]])
(type: #export (Atom a)
diff --git a/stdlib/source/lux/concurrency/frp.lux b/stdlib/source/lux/concurrency/frp.lux
index 2e1e10d87..0e777ce7a 100644
--- a/stdlib/source/lux/concurrency/frp.lux
+++ b/stdlib/source/lux/concurrency/frp.lux
@@ -3,13 +3,16 @@
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
- [monad (#+ do Monad)]]
- [io (#+ IO io)]
- [data [collection [list ("list/" Monoid<List>)]]]
- [type abstract]]
+ ["." monad (#+ do Monad)]]
+ ["." io (#+ IO io)]
+ [data
+ [collection
+ [list ("list/" Monoid<List>)]]]
+ [type
+ abstract]]
[//
- [atom (#+ Atom atom)]
- [promise (#+ Promise)]])
+ ["." atom (#+ Atom atom)]
+ ["." promise (#+ Promise)]])
## [Types]
(abstract: #export (Channel a)
diff --git a/stdlib/source/lux/concurrency/promise.lux b/stdlib/source/lux/concurrency/promise.lux
index eaf913ac1..c68b1fc17 100644
--- a/stdlib/source/lux/concurrency/promise.lux
+++ b/stdlib/source/lux/concurrency/promise.lux
@@ -1,14 +1,17 @@
(.module:
[lux #*
- [io (#+ IO io)]
- [function]
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
- [monad (#+ do Monad)]]
- [data [product]]
- [concurrency [atom (#+ Atom atom)]]
- [type abstract]])
+ ["." monad (#+ do Monad)]]
+ [data
+ ["." product]]
+ ["." function]
+ [type
+ abstract]
+ ["." io (#+ IO io)]
+ [concurrency
+ ["." atom (#+ Atom atom)]]])
(def: #export parallelism
Nat
diff --git a/stdlib/source/lux/concurrency/semaphore.lux b/stdlib/source/lux/concurrency/semaphore.lux
index b6c0ce69b..3be7fb431 100644
--- a/stdlib/source/lux/concurrency/semaphore.lux
+++ b/stdlib/source/lux/concurrency/semaphore.lux
@@ -2,12 +2,12 @@
[lux #*
[control [monad (#+ do)]]
[concurrency
- [atom (#+ Atom)]
- [promise (#+ Promise)]]
- [io (#+ IO)]
+ ["." atom (#+ Atom)]
+ ["." promise (#+ Promise)]]
+ ["." io (#+ IO)]
[type
abstract
- [refinement]]])
+ ["." refinement]]])
(type: State
{#open-positions Nat
diff --git a/stdlib/source/lux/concurrency/stm.lux b/stdlib/source/lux/concurrency/stm.lux
index 88d0ed6ed..b19188a86 100644
--- a/stdlib/source/lux/concurrency/stm.lux
+++ b/stdlib/source/lux/concurrency/stm.lux
@@ -3,17 +3,19 @@
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
- [monad (#+ do Monad)]]
- [io (#+ IO io)]
+ ["." monad (#+ do Monad)]]
+ ["." io (#+ IO io)]
[data
- [product]
- [maybe]
- [collection [list ("list/" Functor<List> Fold<List>)]]]
+ ["." product]
+ ["." maybe]
+ [collection
+ ["." list ("list/" Functor<List> Fold<List>)]]]
[concurrency
- [atom (#+ Atom atom)]
- [promise (#+ Promise promise)]
- [frp ("frp/" Functor<Channel>)]]
- [type abstract]])
+ ["." atom (#+ Atom atom)]
+ ["." promise (#+ Promise promise)]
+ ["." frp ("frp/" Functor<Channel>)]]
+ [type
+ abstract]])
(abstract: #export (Var a)
{#.doc "A mutable cell containing a value, and observers that will be alerted of any change to it."}
diff --git a/stdlib/source/lux/control/apply.lux b/stdlib/source/lux/control/apply.lux
index 9e5f1b6ae..39ea39991 100644
--- a/stdlib/source/lux/control/apply.lux
+++ b/stdlib/source/lux/control/apply.lux
@@ -1,7 +1,7 @@
(.module:
lux
[//
- [functor (#+ Functor)]
+ ["." functor (#+ Functor)]
[monad (#+ Monad)]])
(signature: #export (Apply f)
diff --git a/stdlib/source/lux/control/comonad.lux b/stdlib/source/lux/control/comonad.lux
index 937a121b1..4e294d00e 100644
--- a/stdlib/source/lux/control/comonad.lux
+++ b/stdlib/source/lux/control/comonad.lux
@@ -2,7 +2,7 @@
[lux #*
[data
[collection
- [list ("list/" Fold<List>)]]]]
+ ["." list ("list/" Fold<List>)]]]]
[//
["F" functor]])
diff --git a/stdlib/source/lux/control/concatenative.lux b/stdlib/source/lux/control/concatenative.lux
index bed6e9dd5..7eb662a2e 100644
--- a/stdlib/source/lux/control/concatenative.lux
+++ b/stdlib/source/lux/control/concatenative.lux
@@ -6,14 +6,15 @@
f/+ f/- f/* f// f/% f/= f/< f/<= f/> f/>=)
[control
["p" parser ("parser/" Monad<Parser>)]
- [monad]]
+ ["." monad]]
[data
- [text]
- text/format
- [maybe ("maybe/" Monad<Maybe>)]
- [collection [list ("list/" Fold<List> Functor<List>)]]]
- [macro (#+ with-gensyms Monad<Meta>)
- [code]
+ ["." text
+ format]
+ ["." maybe ("maybe/" Monad<Maybe>)]
+ [collection
+ ["." list ("list/" Fold<List> Functor<List>)]]]
+ ["." macro (#+ with-gensyms Monad<Meta>)
+ ["." code]
["s" syntax (#+ syntax:)]
[syntax
["cs" common]
@@ -210,44 +211,44 @@
[Nat Nat n/* .n/*]
[Nat Nat n// .n//]
[Nat Nat n/% .n/%]
- [Nat Bit n/= .n/=]
- [Nat Bit n/< .n/<]
- [Nat Bit n/<= .n/<=]
- [Nat Bit n/> .n/>]
- [Nat Bit n/>= .n/>=]
+ [Nat Bit n/= .n/=]
+ [Nat Bit n/< .n/<]
+ [Nat Bit n/<= .n/<=]
+ [Nat Bit n/> .n/>]
+ [Nat Bit n/>= .n/>=]
[Int Int i/+ .i/+]
[Int Int i/- .i/-]
[Int Int i/* .i/*]
[Int Int i// .i//]
[Int Int i/% .i/%]
- [Int Bit i/= .i/=]
- [Int Bit i/< .i/<]
- [Int Bit i/<= .i/<=]
- [Int Bit i/> .i/>]
- [Int Bit i/>= .i/>=]
+ [Int Bit i/= .i/=]
+ [Int Bit i/< .i/<]
+ [Int Bit i/<= .i/<=]
+ [Int Bit i/> .i/>]
+ [Int Bit i/>= .i/>=]
[Rev Rev r/+ .r/+]
[Rev Rev r/- .r/-]
[Rev Rev r/* .r/*]
[Rev Rev r// .r//]
[Rev Rev r/% .r/%]
- [Rev Bit r/= .r/=]
- [Rev Bit r/< .r/<]
- [Rev Bit r/<= .r/<=]
- [Rev Bit r/> .r/>]
- [Rev Bit r/>= .r/>=]
+ [Rev Bit r/= .r/=]
+ [Rev Bit r/< .r/<]
+ [Rev Bit r/<= .r/<=]
+ [Rev Bit r/> .r/>]
+ [Rev Bit r/>= .r/>=]
[Frac Frac f/+ .f/+]
[Frac Frac f/- .f/-]
[Frac Frac f/* .f/*]
[Frac Frac f// .f//]
[Frac Frac f/% .f/%]
- [Frac Bit f/= .f/=]
- [Frac Bit f/< .f/<]
- [Frac Bit f/<= .f/<=]
- [Frac Bit f/> .f/>]
- [Frac Bit f/>= .f/>=]
+ [Frac Bit f/= .f/=]
+ [Frac Bit f/< .f/<]
+ [Frac Bit f/<= .f/<=]
+ [Frac Bit f/> .f/>]
+ [Frac Bit f/>= .f/>=]
)
(def: #export if
diff --git a/stdlib/source/lux/control/contract.lux b/stdlib/source/lux/control/contract.lux
index d7e054a9b..72aefd174 100644
--- a/stdlib/source/lux/control/contract.lux
+++ b/stdlib/source/lux/control/contract.lux
@@ -3,8 +3,10 @@
[control
monad]
[data
- text/format]
- [macro (#+) [code]
+ [text
+ format]]
+ [macro (#+ with-gensyms)
+ ["." code]
["s" syntax (#+ syntax:)]]])
(def: #export (assert! message test)
@@ -30,7 +32,7 @@
"Otherwise, an error is raised."
(post i/even?
(i/+ 2 2)))}
- (macro.with-gensyms [g!output]
+ (with-gensyms [g!output]
(wrap (list (` (let [(~ g!output) (~ expr)]
(exec (assert! (~ (code.text (format "Post-condition failed: " (%code test))))
((~ test) (~ g!output)))
diff --git a/stdlib/source/lux/control/exception.lux b/stdlib/source/lux/control/exception.lux
index 296513718..9983a7ce4 100644
--- a/stdlib/source/lux/control/exception.lux
+++ b/stdlib/source/lux/control/exception.lux
@@ -5,12 +5,13 @@
["p" parser]]
[data
["/" error (#+ Error)]
- [maybe]
- [product]
- [text ("text/" Monoid<Text>)]
- [collection [list ("list/" Functor<List> Fold<List>)]]]
+ ["." maybe]
+ ["." product]
+ ["." text ("text/" Monoid<Text>)]
+ [collection
+ ["." list ("list/" Functor<List> Fold<List>)]]]
["." macro
- [code]
+ ["." code]
["s" syntax (#+ syntax: Syntax)]
[syntax
["cs" common]
diff --git a/stdlib/source/lux/control/monad.lux b/stdlib/source/lux/control/monad.lux
index 997bb2117..c98851c95 100644
--- a/stdlib/source/lux/control/monad.lux
+++ b/stdlib/source/lux/control/monad.lux
@@ -1,6 +1,7 @@
(.module:
lux
- [// [functor (#+ Functor)]])
+ [//
+ ["." functor (#+ Functor)]])
## [Utils]
(def: (list/fold f init xs)
diff --git a/stdlib/source/lux/control/monad/indexed.lux b/stdlib/source/lux/control/monad/indexed.lux
index 9e0cd9fd4..576428512 100644
--- a/stdlib/source/lux/control/monad/indexed.lux
+++ b/stdlib/source/lux/control/monad/indexed.lux
@@ -5,7 +5,7 @@
["p" parser]]
[data
[collection
- [list ("list/" Functor<List> Fold<List>)]]]
+ ["." list ("list/" Functor<List> Fold<List>)]]]
["." macro
["s" syntax (#+ Syntax syntax:)]]])
diff --git a/stdlib/source/lux/control/parser.lux b/stdlib/source/lux/control/parser.lux
index fc42d5976..369e4a193 100644
--- a/stdlib/source/lux/control/parser.lux
+++ b/stdlib/source/lux/control/parser.lux
@@ -4,10 +4,11 @@
[functor (#+ Functor)]
[apply (#+ Apply)]
[monad (#+ do Monad)]
- [codec]]
+ [codec (#+ Codec)]]
[data
- [collection [list ("list/" Functor<List> Monoid<List>)]]
- [product]
+ [collection
+ ["." list ("list/" Functor<List> Monoid<List>)]]
+ ["." product]
["e" error (#+ Error)]]])
(type: #export (Parser s a)
@@ -261,7 +262,7 @@
(wrap output)))
(def: #export (codec Codec<a,z> parser)
- (All [s a z] (-> (codec.Codec a z) (Parser s a) (Parser s z)))
+ (All [s a z] (-> (Codec a z) (Parser s a) (Parser s z)))
(function (_ input)
(case (parser input)
(#e.Error error)
diff --git a/stdlib/source/lux/control/pipe.lux b/stdlib/source/lux/control/pipe.lux
index 97e38b365..2a6f4804c 100644
--- a/stdlib/source/lux/control/pipe.lux
+++ b/stdlib/source/lux/control/pipe.lux
@@ -5,11 +5,11 @@
["p" parser]]
[data
["e" error]
- [collection [list ("list/" Fold<List> Monad<List>)]]]
+ [collection
+ ["." list ("list/" Fold<List> Monad<List>)]]]
[macro (#+ with-gensyms)
["s" syntax (#+ syntax: Syntax)]
- [code]]
- ])
+ ["." code]]])
## [Syntax]
(def: body^
diff --git a/stdlib/source/lux/control/predicate.lux b/stdlib/source/lux/control/predicate.lux
index 1d683bf5a..500395cbf 100644
--- a/stdlib/source/lux/control/predicate.lux
+++ b/stdlib/source/lux/control/predicate.lux
@@ -1,7 +1,8 @@
(.module:
[lux #*
- [control [monoid (#+ Monoid)]]
- [function]])
+ [control
+ [monoid (#+ Monoid)]]
+ ["." function]])
(type: #export (Predicate a)
(-> a Bit))
diff --git a/stdlib/source/lux/control/reader.lux b/stdlib/source/lux/control/reader.lux
index dfe8724e0..1d19b5594 100644
--- a/stdlib/source/lux/control/reader.lux
+++ b/stdlib/source/lux/control/reader.lux
@@ -3,7 +3,7 @@
[control
["F" functor]
["A" apply]
- [monad (#+ do Monad)]]])
+ ["." monad (#+ do Monad)]]])
## [Types]
(type: #export (Reader r a)
diff --git a/stdlib/source/lux/control/region.lux b/stdlib/source/lux/control/region.lux
index d83f82279..8b0b15a69 100644
--- a/stdlib/source/lux/control/region.lux
+++ b/stdlib/source/lux/control/region.lux
@@ -3,12 +3,14 @@
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
- [monad (#+ Monad do)]
+ ["." monad (#+ Monad do)]
["ex" exception (#+ Exception exception:)]]
[data
["e" error (#+ Error)]
- text/format
- [collection [list ("list/" Fold<List>)]]]])
+ [text
+ format]
+ [collection
+ [list ("list/" Fold<List>)]]]])
(type: (Cleaner r m)
(-> r (m (Error Any))))
diff --git a/stdlib/source/lux/control/writer.lux b/stdlib/source/lux/control/writer.lux
index 25e665b73..a93242297 100644
--- a/stdlib/source/lux/control/writer.lux
+++ b/stdlib/source/lux/control/writer.lux
@@ -4,7 +4,7 @@
monoid
["F" functor]
["A" apply]
- [monad (#+ do Monad)]]])
+ ["." monad (#+ do Monad)]]])
(type: #export (Writer l a)
{#.doc "Represents a value with an associated 'log' value to record arbitrary information."}
diff --git a/stdlib/source/lux/data/collection/array.lux b/stdlib/source/lux/data/collection/array.lux
index 7093de9a1..451e4c5f2 100644
--- a/stdlib/source/lux/data/collection/array.lux
+++ b/stdlib/source/lux/data/collection/array.lux
@@ -7,9 +7,9 @@
fold
[predicate (#+ Predicate)]]
[data
- [collection [list ("list/" Fold<List>)]]
- [product]]
- ])
+ [collection
+ ["." list ("list/" Fold<List>)]]
+ ["." product]]])
(def: #export (new size)
(All [a] (-> Nat (Array a)))
diff --git a/stdlib/source/lux/data/collection/bits.lux b/stdlib/source/lux/data/collection/bits.lux
index 05de58e37..803654c6c 100644
--- a/stdlib/source/lux/data/collection/bits.lux
+++ b/stdlib/source/lux/data/collection/bits.lux
@@ -4,12 +4,13 @@
[equivalence (#+ Equivalence)]
pipe]
[data
- [maybe]
+ ["." maybe]
[number
- [i64]]
+ ["." i64]]
[text
format]
- [collection [array ("array/" Fold<Array>)]]]])
+ [collection
+ ["." array ("array/" Fold<Array>)]]]])
(type: #export Chunk I64)
diff --git a/stdlib/source/lux/data/collection/dictionary.lux b/stdlib/source/lux/data/collection/dictionary.lux
index 27ee863cc..adea785cf 100644
--- a/stdlib/source/lux/data/collection/dictionary.lux
+++ b/stdlib/source/lux/data/collection/dictionary.lux
@@ -4,13 +4,13 @@
hash
[equivalence (#+ Equivalence)]]
[data
- [maybe]
- [product]
+ ["." maybe]
+ ["." product]
["." number
- [i64]]
+ ["." i64]]
[collection
- [list ("list/" Fold<List> Functor<List> Monoid<List>)]
- [array ("array/" Functor<Array> Fold<Array>)]]]
+ ["." list ("list/" Fold<List> Functor<List> Monoid<List>)]
+ ["." array ("array/" Functor<Array> Fold<Array>)]]]
])
## This implementation of Hash Array Mapped Trie (HAMT) is based on
diff --git a/stdlib/source/lux/data/collection/dictionary/ordered.lux b/stdlib/source/lux/data/collection/dictionary/ordered.lux
index 0af6bd341..96e989300 100644
--- a/stdlib/source/lux/data/collection/dictionary/ordered.lux
+++ b/stdlib/source/lux/data/collection/dictionary/ordered.lux
@@ -6,10 +6,11 @@
[order (#+ Order)]]
[data
["p" product]
- [maybe]
- [collection [list ("list/" Monoid<List> Fold<List>)]]]
+ ["." maybe]
+ [collection
+ [list ("list/" Monoid<List> Fold<List>)]]]
["." macro
- [code]
+ ["." code]
["s" syntax (#+ syntax: Syntax)]]])
(def: error-message Text "Invariant violation")
diff --git a/stdlib/source/lux/data/collection/list.lux b/stdlib/source/lux/data/collection/list.lux
index 111c9b00e..9746fdfae 100644
--- a/stdlib/source/lux/data/collection/list.lux
+++ b/stdlib/source/lux/data/collection/list.lux
@@ -2,14 +2,14 @@
[lux #*
[control
[monoid (#+ Monoid)]
- [functor (#+ Functor)]
+ ["." functor (#+ Functor)]
[apply (#+ Apply)]
- [monad (#+ do Monad)]
+ ["." monad (#+ do Monad)]
[equivalence (#+ Equivalence)]
- [fold]]
+ [fold (#+ Fold)]]
[data
bit
- [product]]])
+ ["." product]]])
## [Types]
## (type: (List a)
@@ -17,7 +17,7 @@
## (#Cons a (List a)))
## [Functions]
-(structure: #export _ (fold.Fold List)
+(structure: #export _ (Fold List)
(def: (fold f init xs)
(case xs
#.Nil
diff --git a/stdlib/source/lux/data/collection/queue.lux b/stdlib/source/lux/data/collection/queue.lux
index 864dfb67d..76aed3a63 100644
--- a/stdlib/source/lux/data/collection/queue.lux
+++ b/stdlib/source/lux/data/collection/queue.lux
@@ -3,7 +3,9 @@
[control
[equivalence (#+ Equivalence)]
["F" functor]]
- [data [collection [list ("list/" Monoid<List> Functor<List>)]]]])
+ [data
+ [collection
+ ["." list ("list/" Monoid<List> Functor<List>)]]]])
(type: #export (Queue a)
{#front (List a)
diff --git a/stdlib/source/lux/data/collection/queue/priority.lux b/stdlib/source/lux/data/collection/queue/priority.lux
index 11162ae8c..0e86ae070 100644
--- a/stdlib/source/lux/data/collection/queue/priority.lux
+++ b/stdlib/source/lux/data/collection/queue/priority.lux
@@ -4,9 +4,11 @@
[equivalence (#+ Equivalence)]
[monad (#+ do Monad)]]
[data
- [number ("nat/" Interval<Nat>)]
- [maybe]
- [collection [tree [finger (#+ Tree)]]]]])
+ ["." maybe]
+ ["." number ("nat/" Interval<Nat>)]
+ [collection
+ [tree
+ ["." finger (#+ Tree)]]]]])
(type: #export Priority Nat)
diff --git a/stdlib/source/lux/data/collection/row.lux b/stdlib/source/lux/data/collection/row.lux
index 23e5ded20..7974c4a90 100644
--- a/stdlib/source/lux/data/collection/row.lux
+++ b/stdlib/source/lux/data/collection/row.lux
@@ -10,17 +10,16 @@
["p" parser]
[predicate (#+ Predicate)]]
[data
- [maybe]
- [product]
+ ["." maybe]
+ ["." product]
[number
- [i64]]
+ ["." i64]]
[collection
- [list ("list/" Fold<List> Functor<List> Monoid<List>)]
+ ["." list ("list/" Fold<List> Functor<List> Monoid<List>)]
["." array ("array/" Functor<Array> Fold<Array>)]]]
[macro (#+ with-gensyms)
- [code]
- ["s" syntax (#+ syntax: Syntax)]]
- ])
+ ["." code]
+ ["s" syntax (#+ syntax: Syntax)]]])
## [Utils]
(type: (Node a)
diff --git a/stdlib/source/lux/data/collection/sequence.lux b/stdlib/source/lux/data/collection/sequence.lux
index 9a8258de2..d68116ae4 100644
--- a/stdlib/source/lux/data/collection/sequence.lux
+++ b/stdlib/source/lux/data/collection/sequence.lux
@@ -4,14 +4,15 @@
functor
monad
comonad
- [continuation (#+ pending Cont)]
+ ["." continuation (#+ pending Cont)]
["p" parser]]
[macro (#+ with-gensyms)
- [code]
+ ["." code]
["s" syntax (#+ syntax: Syntax)]]
[data
bit
- [collection [list ("list/" Monad<List>)]]]])
+ [collection
+ [list ("list/" Monad<List>)]]]])
## [Types]
(type: #export (Sequence a)
diff --git a/stdlib/source/lux/data/collection/set.lux b/stdlib/source/lux/data/collection/set.lux
index d78ae6d19..00c02fabe 100644
--- a/stdlib/source/lux/data/collection/set.lux
+++ b/stdlib/source/lux/data/collection/set.lux
@@ -2,13 +2,14 @@
[lux #*
[control
[equivalence (#+ Equivalence)]
- [hash (#+ Hash)]
+ ["." hash (#+ Hash)]
[predicate (#+ Predicate)]]
[data
[collection
["dict" dictionary (#+ Dictionary)]
- [list ("list/" Fold<List>)]]]
- [type abstract]])
+ ["." list ("list/" Fold<List>)]]]
+ [type
+ abstract]])
(abstract: #export (Set a)
{}
diff --git a/stdlib/source/lux/data/collection/set/multi.lux b/stdlib/source/lux/data/collection/set/multi.lux
index 314c0423c..e29cb126b 100644
--- a/stdlib/source/lux/data/collection/set/multi.lux
+++ b/stdlib/source/lux/data/collection/set/multi.lux
@@ -4,14 +4,17 @@
[control
[equivalence (#+ Equivalence)]
[hash (#+ Hash)]]
- [function]
- [language [type (#+ :share)]]
- [type abstract]]
- [//// [maybe]]
+ ["." function]
+ [language
+ [type (#+ :share)]]
+ [type
+ abstract]]
+ [////
+ ["." maybe]]
[///
- [list ("list/" Fold<List>)]
- [dictionary (#+ Dictionary)]]
- [//])
+ ["." list ("list/" Fold<List>)]
+ ["." dictionary (#+ Dictionary)]]
+ ["." //])
(abstract: #export (Set a)
{}
diff --git a/stdlib/source/lux/data/collection/set/ordered.lux b/stdlib/source/lux/data/collection/set/ordered.lux
index b9fff0680..cccfb2768 100644
--- a/stdlib/source/lux/data/collection/set/ordered.lux
+++ b/stdlib/source/lux/data/collection/set/ordered.lux
@@ -5,9 +5,10 @@
[order (#+ Order)]]
[data
[collection
- [list ("list/" Fold<List>)]
+ ["." list ("list/" Fold<List>)]
[dictionary ["//" ordered]]]]
- [type abstract]])
+ [type
+ abstract]])
(abstract: #export (Set a)
{}
diff --git a/stdlib/source/lux/data/collection/stack.lux b/stdlib/source/lux/data/collection/stack.lux
index 8a24010e7..eec2aae23 100644
--- a/stdlib/source/lux/data/collection/stack.lux
+++ b/stdlib/source/lux/data/collection/stack.lux
@@ -2,7 +2,7 @@
[lux #*
[data
[collection
- [list]]]])
+ ["." list]]]])
## [Types]
(type: #export (Stack a)
diff --git a/stdlib/source/lux/data/collection/tree/finger.lux b/stdlib/source/lux/data/collection/tree/finger.lux
index 3c449f57a..84859dca5 100644
--- a/stdlib/source/lux/data/collection/tree/finger.lux
+++ b/stdlib/source/lux/data/collection/tree/finger.lux
@@ -3,7 +3,9 @@
[control
["m" monoid]
[predicate (#+ Predicate)]]
- [data [text format]]])
+ [data
+ [text
+ format]]])
(type: #export (Node m a)
(#Leaf m a)
diff --git a/stdlib/source/lux/data/collection/tree/rose.lux b/stdlib/source/lux/data/collection/tree/rose.lux
index 86f1fc49f..6732c0da4 100644
--- a/stdlib/source/lux/data/collection/tree/rose.lux
+++ b/stdlib/source/lux/data/collection/tree/rose.lux
@@ -6,9 +6,11 @@
equivalence
["p" parser]
fold]
- [data [collection [list ("list/" Monad<List> Fold<List>)]]]
+ [data
+ [collection
+ ["." list ("list/" Monad<List> Fold<List>)]]]
["." macro
- [code]
+ ["." code]
["s" syntax (#+ syntax: Syntax)]]])
## [Types]
diff --git a/stdlib/source/lux/data/collection/tree/rose/parser.lux b/stdlib/source/lux/data/collection/tree/rose/parser.lux
index a2dd954b9..5364be8c5 100644
--- a/stdlib/source/lux/data/collection/tree/rose/parser.lux
+++ b/stdlib/source/lux/data/collection/tree/rose/parser.lux
@@ -6,7 +6,7 @@
[data
["E" error]]]
[// (#+ Tree)
- [zipper (#+ Zipper)]])
+ ["." zipper (#+ Zipper)]])
(type: #export (Parser t a)
(p.Parser (Zipper t) a))
diff --git a/stdlib/source/lux/data/collection/tree/rose/zipper.lux b/stdlib/source/lux/data/collection/tree/rose/zipper.lux
index 030ddb36e..7d8412985 100644
--- a/stdlib/source/lux/data/collection/tree/rose/zipper.lux
+++ b/stdlib/source/lux/data/collection/tree/rose/zipper.lux
@@ -4,14 +4,14 @@
functor
comonad]
[data
+ ["." maybe ("maybe/" Monad<Maybe>)]
[collection
- [list ("list/" Functor<List> Fold<List> Monoid<List>)]
- [tree [rose (#+ Tree) ("tree/" Functor<Tree>)]]
- [stack (#+ Stack)]]
- [maybe ("maybe/" Monad<Maybe>)]]
+ ["." list ("list/" Functor<List> Fold<List> Monoid<List>)]
+ ["." stack (#+ Stack)]]]
["." macro
- [code]
- ["s" syntax (#+ syntax: Syntax)]]])
+ ["." code]
+ ["s" syntax (#+ syntax: Syntax)]]]
+ ["." // (#+ Tree) ("tree/" Functor<Tree>)])
## Adapted from the clojure.zip namespace in the Clojure standard library.
@@ -37,11 +37,11 @@
(def: #export (value zipper)
(All [a] (-> (Zipper a) a))
- (|> zipper (get@ [#node #rose.value])))
+ (|> zipper (get@ [#node #//.value])))
(def: #export (children zipper)
(All [a] (-> (Zipper a) (List (Tree a))))
- (|> zipper (get@ [#node #rose.children])))
+ (|> zipper (get@ [#node #//.children])))
(def: #export (branch? zipper)
(All [a] (-> (Zipper a) Bit))
@@ -88,12 +88,12 @@
## TODO: Remove once new-luxc becomes the standard compiler.
(update@ #node (: (-> (Tree ($ +0)) (Tree ($ +0)))
(function (_ node)
- (set@ #rose.children (list/compose (list.reverse (get@ #lefts zipper))
- (#.Cons (get@ #node zipper)
- (get@ #rights zipper)))
+ (set@ #//.children (list/compose (list.reverse (get@ #lefts zipper))
+ (#.Cons (get@ #node zipper)
+ (get@ #rights zipper)))
node))))
## (update@ #node (function (_ node)
- ## (set@ #rose.children (list/compose (list.reverse (get@ #lefts zipper))
+ ## (set@ #//.children (list/compose (list.reverse (get@ #lefts zipper))
## (#.Cons (get@ #node zipper)
## (get@ #rights zipper)))
## node)))
@@ -144,34 +144,34 @@
(def: #export (set value zipper)
(All [a] (-> a (Zipper a) (Zipper a)))
- (set@ [#node #rose.value] value zipper))
+ (set@ [#node #//.value] value zipper))
(def: #export (update f zipper)
(All [a] (-> (-> a a) (Zipper a) (Zipper a)))
- (update@ [#node #rose.value] f zipper))
+ (update@ [#node #//.value] f zipper))
(def: #export (prepend-child value zipper)
(All [a] (-> a (Zipper a) (Zipper a)))
- (update@ [#node #rose.children]
+ (update@ [#node #//.children]
(function (_ children)
## TODO: Remove once new-luxc becomes the standard compiler.
(list& (: (Tree ($ +0))
- (rose.tree [value {}]))
+ (//.tree [value {}]))
children)
- ## (list& (rose.tree [value {}])
+ ## (list& (//.tree [value {}])
## children)
)
zipper))
(def: #export (append-child value zipper)
(All [a] (-> a (Zipper a) (Zipper a)))
- (update@ [#node #rose.children]
+ (update@ [#node #//.children]
(function (_ children)
(list/compose children
## TODO: Remove once new-luxc becomes the standard compiler.
(list (: (Tree ($ +0))
- (rose.tree [value {}])))
- ## (list (rose.tree [value {}]))
+ (//.tree [value {}])))
+ ## (list (//.tree [value {}]))
))
zipper))
@@ -185,7 +185,7 @@
(#.Some next)
(#.Some (|> next
- (update@ [#node #rose.children] (|>> list.tail (maybe.default (list)))))))
+ (update@ [#node #//.children] (|>> list.tail (maybe.default (list)))))))
(#.Cons next side)
(#.Some (|> zipper
@@ -204,9 +204,9 @@
(update@ <side> (function (_ side)
## TODO: Remove once new-luxc becomes the standard compiler.
(#.Cons (: (Tree ($ +0))
- (rose.tree [value {}]))
+ (//.tree [value {}]))
side)
- ## (#.Cons (rose.tree [value {}])
+ ## (#.Cons (//.tree [value {}])
## side)
))))))]
@@ -225,13 +225,13 @@
## (structure: #export _ (CoMonad Zipper)
## (def: functor Functor<Zipper>)
-## (def: unwrap (get@ [#node #rose.value]))
+## (def: unwrap (get@ [#node #//.value]))
## (def: (split wa)
## (let [tree-splitter (function (tree-splitter tree)
-## {#rose.value (zip tree)
-## #rose.children (list/map tree-splitter
-## (get@ #rose.children tree))})]
+## {#//.value (zip tree)
+## #//.children (list/map tree-splitter
+## (get@ #//.children tree))})]
## {#parent (|> wa (get@ #parent) (maybe/map split))
## #lefts (|> wa (get@ #lefts) (list/map tree-splitter))
## #rights (|> wa (get@ #rights) (list/map tree-splitter))
diff --git a/stdlib/source/lux/data/color.lux b/stdlib/source/lux/data/color.lux
index a7b9fa0c3..50beed6d9 100644
--- a/stdlib/source/lux/data/color.lux
+++ b/stdlib/source/lux/data/color.lux
@@ -1,9 +1,12 @@
(.module:
[lux #*
[control ["eq" equivalence]]
- [data [collection [list ("list/" Functor<List>)]]]
- [math]
- [type abstract]])
+ [data
+ [collection
+ ["." list ("list/" Functor<List>)]]]
+ ["." math]
+ [type
+ abstract]])
(def: rgb Nat +256)
(def: top Nat (dec rgb))
diff --git a/stdlib/source/lux/data/format/binary.lux b/stdlib/source/lux/data/format/binary.lux
index b0c2a8b65..c3724c703 100644
--- a/stdlib/source/lux/data/format/binary.lux
+++ b/stdlib/source/lux/data/format/binary.lux
@@ -6,12 +6,13 @@
["ex" exception (#+ exception:)]
[equivalence (#+ Equivalence)]]
[data
- [error]
+ ["." error]
+ ["." number]
[text
- [encoding]
- [format (#+ %n)]]
- [number]]
- [world [blob (#+ Blob)]]])
+ ["." encoding]
+ [format (#+ %n)]]]
+ [world
+ ["." blob (#+ Blob)]]])
## Exceptions
(exception: #export (blob-was-not-fully-read {length Nat} {read Nat})
@@ -78,7 +79,7 @@
(<write> offset value)
error.assume))])})]
- [bits/8 size/8 blob.read/8 blob.write/8]
+ [bits/8 size/8 blob.read/8 blob.write/8]
[bits/16 size/16 blob.read/16 blob.write/16]
[bits/32 size/32 blob.read/32 blob.write/32]
[bits/64 size/64 blob.read/64 blob.write/64]
diff --git a/stdlib/source/lux/data/format/css.lux b/stdlib/source/lux/data/format/css.lux
index 6afbe164e..e2b2737d2 100644
--- a/stdlib/source/lux/data/format/css.lux
+++ b/stdlib/source/lux/data/format/css.lux
@@ -1,11 +1,12 @@
(.module:
[lux #*
[data
- [color (#+ Color)]
- [number]
+ ["." color (#+ Color)]
+ ["." number]
["." text
format]
- [collection [list ("list/" Functor<List> Monoid<List>)]]]])
+ [collection
+ ["." list ("list/" Functor<List> Monoid<List>)]]]])
(type: #export Selector
Text)
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux
index 261ff1330..764beab83 100644
--- a/stdlib/source/lux/data/format/json.lux
+++ b/stdlib/source/lux/data/format/json.lux
@@ -3,26 +3,26 @@
For more information, please see: http://www.json.org/"}
[lux (#- Array)
[control
- [monad (#+ do Monad)]
+ ["." monad (#+ do Monad)]
[equivalence (#+ Equivalence)]
codec
["p" parser ("parser/" Monad<Parser>)]]
[data
- [bit]
- [text ("text/" Equivalence<Text> Monoid<Text>)
- ["l" lexer]]
- [number ("frac/" Codec<Text,Frac>) ("nat/" Codec<Text,Nat>)]
- [maybe]
+ ["." bit]
+ ["." maybe]
["e" error]
- [sum]
- [product]
+ ["." sum]
+ ["." product]
+ ["." number ("frac/" Codec<Text,Frac>) ("nat/" Codec<Text,Nat>)]
+ ["." text ("text/" Equivalence<Text> Monoid<Text>)
+ ["l" lexer]]
[collection
- [list ("list/" Fold<List> Monad<List>)]
- [row (#+ Row row) ("row/" Monad<Row>)]
+ ["." list ("list/" Fold<List> Monad<List>)]
+ ["." row (#+ Row row) ("row/" Monad<Row>)]
["dict" dictionary (#+ Dictionary)]]]
- [macro (#+ Monad<Meta> with-gensyms)
+ ["." macro (#+ Monad<Meta> with-gensyms)
["s" syntax (#+ syntax:)]
- [code]]])
+ ["." code]]])
(do-template [<name> <type>]
[(type: #export <name> <type>)]
diff --git a/stdlib/source/lux/data/format/xml.lux b/stdlib/source/lux/data/format/xml.lux
index 6d6e93799..e58a29c96 100644
--- a/stdlib/source/lux/data/format/xml.lux
+++ b/stdlib/source/lux/data/format/xml.lux
@@ -7,14 +7,14 @@
["p" parser ("parser/" Monad<Parser>)]
["ex" exception (#+ exception:)]]
[data
- [text ("text/" Equivalence<Text> Monoid<Text>)
- ["l" lexer]]
- [number]
+ ["." number]
["E" error]
- [product]
- [ident ("ident/" Equivalence<Ident> Codec<Text,Ident>)]
+ ["." product]
+ ["." ident ("ident/" Equivalence<Ident> Codec<Text,Ident>)]
+ ["." text ("text/" Equivalence<Text> Monoid<Text>)
+ ["l" lexer]]
[collection
- [list ("list/" Monad<List>)]
+ ["." list ("list/" Monad<List>)]
["d" dictionary]]]])
(type: #export Tag Ident)
diff --git a/stdlib/source/lux/data/ident.lux b/stdlib/source/lux/data/ident.lux
index 545b22a65..ab8f30ab6 100644
--- a/stdlib/source/lux/data/ident.lux
+++ b/stdlib/source/lux/data/ident.lux
@@ -4,7 +4,8 @@
[equivalence (#+ Equivalence)]
[codec (#+ Codec)]
hash]
- [data [text ("text/" Monoid<Text> Equivalence<Text>)]]])
+ [data
+ ["." text ("text/" Monoid<Text> Hash<Text>)]]])
## [Types]
## (type: Ident
@@ -49,5 +50,4 @@
(def: eq Equivalence<Ident>)
(def: (hash [module name])
- (let [(^open) text.Hash<Text>]
- (n/+ (hash module) (hash name)))))
+ (n/+ (text/hash module) (text/hash name))))
diff --git a/stdlib/source/lux/data/lazy.lux b/stdlib/source/lux/data/lazy.lux
index df48114d8..66fac2989 100644
--- a/stdlib/source/lux/data/lazy.lux
+++ b/stdlib/source/lux/data/lazy.lux
@@ -1,14 +1,16 @@
(.module:
[lux #*
- [io]
+ ["." io]
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
[monad (#+ Monad do)]]
- [concurrency [atom]]
+ [concurrency
+ ["." atom]]
[macro (#+ with-gensyms)
["s" syntax (#+ syntax:)]]
- [type abstract]])
+ [type
+ abstract]])
(abstract: #export (Lazy a)
(-> [] a)
diff --git a/stdlib/source/lux/data/maybe.lux b/stdlib/source/lux/data/maybe.lux
index bc9d0af95..42e95d5f6 100644
--- a/stdlib/source/lux/data/maybe.lux
+++ b/stdlib/source/lux/data/maybe.lux
@@ -1,10 +1,10 @@
(.module:
[lux #*
[control
- ["m" monoid]
- ["F" functor]
- ["A" apply]
- [monad (#+ do Monad)]
+ [monoid (#+ Monoid)]
+ ["." functor (#+ Functor)]
+ [apply (#+ Apply)]
+ ["." monad (#+ do Monad)]
[equivalence (#+ Equivalence)]]])
## [Types]
@@ -13,20 +13,20 @@
## (#.Some a))
## [Structures]
-(structure: #export Monoid<Maybe> (All [a] (m.Monoid (Maybe a)))
+(structure: #export Monoid<Maybe> (All [a] (Monoid (Maybe a)))
(def: identity #.None)
(def: (compose xs ys)
(case xs
#.None ys
(#.Some x) (#.Some x))))
-(structure: #export _ (F.Functor Maybe)
+(structure: #export _ (Functor Maybe)
(def: (map f ma)
(case ma
#.None #.None
(#.Some a) (#.Some (f a)))))
-(structure: #export _ (A.Apply Maybe)
+(structure: #export _ (Apply Maybe)
(def: functor Functor<Maybe>)
(def: (apply ff fa)
@@ -63,7 +63,7 @@
(structure: #export (MaybeT Monad<M>)
(All [M] (-> (Monad M) (Monad (All [a] (M (Maybe a))))))
- (def: functor (F.compose (get@ #monad.functor Monad<M>) Functor<Maybe>))
+ (def: functor (functor.compose (get@ #monad.functor Monad<M>) Functor<Maybe>))
(def: wrap (|>> (:: Monad<Maybe> wrap) (:: Monad<M> wrap)))
diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux
index 7f591c85c..cb71b5b07 100644
--- a/stdlib/source/lux/data/number.lux
+++ b/stdlib/source/lux/data/number.lux
@@ -5,16 +5,16 @@
[monoid (#+ Monoid)]
[equivalence (#+ Equivalence)]
hash
- [order]
+ ["." order (#+ Order)]
enum
interval
[codec (#+ Codec)]]
[data
["e" error]
- [maybe]
- [text]]]
+ ["." maybe]
+ ["." text]]]
[/
- [i64]])
+ ["." i64]])
## [Structures]
(do-template [<type> <test>]
@@ -28,7 +28,7 @@
)
(do-template [<type> <eq> <lt> <lte> <gt> <gte>]
- [(structure: #export _ (order.Order <type>)
+ [(structure: #export _ (Order <type>)
(def: eq <eq>)
(def: < <lt>)
(def: <= <lte>)
diff --git a/stdlib/source/lux/data/number/complex.lux b/stdlib/source/lux/data/number/complex.lux
index 5c9c97d46..496116755 100644
--- a/stdlib/source/lux/data/number/complex.lux
+++ b/stdlib/source/lux/data/number/complex.lux
@@ -1,6 +1,6 @@
(.module: {#.doc "Complex arithmetic."}
[lux #*
- [math]
+ ["." math]
[control
[equivalence (#+ Equivalence)]
number
@@ -8,12 +8,13 @@
["M" monad (#+ do Monad)]
["p" parser]]
[data
- [number ("frac/" Number<Frac>)]
+ ["." maybe]
+ ["." number ("frac/" Number<Frac>)]
[text ("text/" Monoid<Text>)]
- [maybe]
- [collection [list ("list/" Functor<List>)]]]
+ [collection
+ ["." list ("list/" Functor<List>)]]]
["." macro
- [code]
+ ["." code]
["s" syntax (#+ syntax: Syntax)]]])
(type: #export Complex
diff --git a/stdlib/source/lux/data/number/ratio.lux b/stdlib/source/lux/data/number/ratio.lux
index 2aa332dc6..ffa4432a5 100644
--- a/stdlib/source/lux/data/number/ratio.lux
+++ b/stdlib/source/lux/data/number/ratio.lux
@@ -1,22 +1,22 @@
(.module: {#.doc "Rational arithmetic."}
[lux #*
- [math]
[control
[equivalence (#+ Equivalence)]
- [order]
+ [order (#+ Order)]
number
codec
monad
["p" parser]]
[data
- [number ("nat/" Codec<Text,Nat>)]
- [text ("text/" Monoid<Text>)
- format]
["E" error]
- [product]
- [maybe]]
+ ["." product]
+ ["." maybe]
+ [number ("nat/" Codec<Text,Nat>)]
+ ["." text ("text/" Monoid<Text>)
+ format]]
+ ["." math]
["." macro
- [code]
+ ["." code]
["s" syntax (#+ syntax: Syntax)]]])
(type: #export Ratio
@@ -105,7 +105,7 @@
(structure: #export _ (Equivalence Ratio)
(def: = ..=))
-(structure: #export _ (order.Order Ratio)
+(structure: #export _ (Order Ratio)
(def: eq Equivalence<Ratio>)
(def: < ..<)
(def: <= ..<=)
diff --git a/stdlib/source/lux/data/store.lux b/stdlib/source/lux/data/store.lux
index c1b974840..4cacb8329 100644
--- a/stdlib/source/lux/data/store.lux
+++ b/stdlib/source/lux/data/store.lux
@@ -3,7 +3,8 @@
[control
["F" functor]
comonad]
- [type implicit]])
+ [type
+ implicit]])
(type: #export (Store s a)
{#cursor s
diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux
index a5223c3e3..940349f05 100644
--- a/stdlib/source/lux/data/text.lux
+++ b/stdlib/source/lux/data/text.lux
@@ -3,18 +3,18 @@
[control
[monoid (#+ Monoid)]
[equivalence (#+ Equivalence)]
- [order]
+ [order (#+ Order)]
[monad (#+ do Monad)]
[codec (#+ Codec)]
hash]
[data
- [maybe]
+ ["." maybe]
[number
- [i64]]
+ ["." i64]]
[collection
- [list ("list/" Fold<List>)]]]
+ ["." list ("list/" Fold<List>)]]]
[language
- [host]]])
+ ["." host]]])
(def: #export (size x)
(-> Text Nat)
@@ -144,7 +144,7 @@
(def: (= test subject)
("lux text =" subject test)))
-(structure: #export _ (order.Order Text)
+(structure: #export _ (Order Text)
(def: eq Equivalence<Text>)
(def: (< test subject)
diff --git a/stdlib/source/lux/data/text/buffer.lux b/stdlib/source/lux/data/text/buffer.lux
index 33708932e..a27015f7e 100644
--- a/stdlib/source/lux/data/text/buffer.lux
+++ b/stdlib/source/lux/data/text/buffer.lux
@@ -1,15 +1,17 @@
(.module:
[lux #*
[data
- [product]
- [text format]
- [collection [row (#+ Row) ("row/" Fold<Row>)]]]
+ ["." product]
+ [text
+ format]
+ [collection
+ ["." row (#+ Row) ("row/" Fold<Row>)]]]
[language
["_" host]]
[type
abstract]
[host (#+ import:)]]
- [//])
+ ["." //])
(`` (for {(~~ (static _.jvm))
(as-is (import: java/lang/CharSequence)
diff --git a/stdlib/source/lux/data/text/encoding.lux b/stdlib/source/lux/data/text/encoding.lux
index 2ea8e4a76..d5246e382 100644
--- a/stdlib/source/lux/data/text/encoding.lux
+++ b/stdlib/source/lux/data/text/encoding.lux
@@ -1,8 +1,11 @@
(.module:
[lux #*
- [data [error (#+ Error)]]
- [world [blob (#+ Blob)]]
- [language ["_" host]]
+ [data
+ ["." error (#+ Error)]]
+ [world
+ [blob (#+ Blob)]]
+ [language
+ ["_" host]]
[host (#+ import:)]])
(`` (for {(~~ (static _.jvm))
diff --git a/stdlib/source/lux/data/text/format.lux b/stdlib/source/lux/data/text/format.lux
index 4b9717fab..af2b8beab 100644
--- a/stdlib/source/lux/data/text/format.lux
+++ b/stdlib/source/lux/data/text/format.lux
@@ -4,24 +4,26 @@
[monad (#+ do Monad)]
["p" parser]]
[data
- [bit]
- [number]
- [text]
- [ident]
- [collection [list ("list/" Monad<List>)]]
+ ["." bit]
+ ["." ident]
+ ["." number]
+ ["." text]
[format
- [xml]
- [json]]]
+ ["." xml]
+ ["." json]]
+ [collection
+ [list ("list/" Monad<List>)]]]
[time
- [instant]
- [duration]
- [date]]
- [math [modular]]
+ ["." instant]
+ ["." duration]
+ ["." date]]
+ [math
+ ["." modular]]
["." macro
- [code]
+ ["." code]
["s" syntax (#+ syntax: Syntax)]]
- [language [type]]
- ])
+ [language
+ ["." type]]])
## [Syntax]
(syntax: #export (format {fragments (p.many s.any)})
diff --git a/stdlib/source/lux/data/text/lexer.lux b/stdlib/source/lux/data/text/lexer.lux
index 3ece75c23..83e732471 100644
--- a/stdlib/source/lux/data/text/lexer.lux
+++ b/stdlib/source/lux/data/text/lexer.lux
@@ -4,12 +4,14 @@
[monad (#+ do Monad)]
["p" parser]]
[data
- [text ("text/" Monoid<Text>)]
- [product]
- [maybe]
+ ["." text ("text/" Monoid<Text>)]
+ ["." product]
+ ["." maybe]
["e" error]
- [collection [list]]]
- [macro [code]]])
+ [collection
+ ["." list]]]
+ [macro
+ ["." code]]])
(type: Offset Nat)
diff --git a/stdlib/source/lux/data/text/regex.lux b/stdlib/source/lux/data/text/regex.lux
index 94012c086..c7cba31c8 100644
--- a/stdlib/source/lux/data/text/regex.lux
+++ b/stdlib/source/lux/data/text/regex.lux
@@ -4,16 +4,17 @@
monad
["p" parser ("parser/" Monad<Parser>)]]
[data
- [number ("int/" Codec<Text,Int>)]
- [product]
+ ["." product]
["e" error]
- [maybe]
+ ["." maybe]
+ ["." number ("int/" Codec<Text,Int>)]
["." text
["l" lexer]
format]
- [collection [list ("list/" Fold<List> Monad<List>)]]]
- [macro (#+ with-gensyms)
- [code]
+ [collection
+ ["." list ("list/" Fold<List> Monad<List>)]]]
+ ["." macro (#+ with-gensyms)
+ ["." code]
["s" syntax (#+ syntax:)]]])
## [Utils]
@@ -289,7 +290,7 @@
#.None
[(inc idx) (code.symbol ["" (int/encode idx)])])
access (if (n/> +0 num-captures)
- (` (product.left (~ name!)))
+ (` ((~! product.left) (~ name!)))
name!)]
[idx!
(list& name! names)
diff --git a/stdlib/source/lux/data/text/unicode.lux b/stdlib/source/lux/data/text/unicode.lux
index 11c69be84..a865fea1d 100644
--- a/stdlib/source/lux/data/text/unicode.lux
+++ b/stdlib/source/lux/data/text/unicode.lux
@@ -1,14 +1,16 @@
(.module:
[lux #*
[control
- [interval (#+ Interval)]
+ ["." interval (#+ Interval)]
[monoid (#+ Monoid)]]
[data
- [number (#+ hex) ("nat/" Interval<Nat>)]
+ ["." number (#+ hex) ("nat/" Interval<Nat>)]
[collection
- [list]
- [tree [finger (#+ Tree)]]]]
- [type abstract]])
+ ["." list]
+ [tree
+ ["." finger (#+ Tree)]]]]
+ [type
+ abstract]])
(type: #export Char Nat)
diff --git a/stdlib/source/lux/data/trace.lux b/stdlib/source/lux/data/trace.lux
index a0c366199..36d5acdf0 100644
--- a/stdlib/source/lux/data/trace.lux
+++ b/stdlib/source/lux/data/trace.lux
@@ -1,7 +1,7 @@
(.module:
[lux #*
[control
- [monoid (#+ Monoid)]
+ ["." monoid (#+ Monoid)]
[functor (#+ Functor)]
comonad]
function])
diff --git a/stdlib/source/lux/host.jvm.lux b/stdlib/source/lux/host.jvm.lux
index 118ae5a1f..acccabc77 100644
--- a/stdlib/source/lux/host.jvm.lux
+++ b/stdlib/source/lux/host.jvm.lux
@@ -1,23 +1,26 @@
(.module:
[lux (#- type)
[control
- [monad (#+ do Monad)]
- [enum]
+ ["." monad (#+ do Monad)]
+ ["." enum]
["p" parser]]
- [io (#+ IO Monad<IO> io)]
+ ["." io]
function
[data
- [collection [list ("list/" Monad<List> Fold<List> Monoid<List>)]]
+ ["." maybe]
+ ["." product]
+ ["." error (#+ Error)]
+ [bit ("bit/" Codec<Text,Bit>)]
number
- [maybe]
- [product]
- [text ("text/" Equivalence<Text> Monoid<Text>)
+ ["." text ("text/" Equivalence<Text> Monoid<Text>)
format]
- [bit ("bit/" Codec<Text,Bit>)]]
- [macro (#+ with-gensyms Functor<Meta> Monad<Meta>)
- [code]
+ [collection
+ ["." list ("list/" Monad<List> Fold<List> Monoid<List>)]]]
+ ["." macro (#+ with-gensyms Functor<Meta> Monad<Meta>)
+ ["." code]
["s" syntax (#+ syntax: Syntax)]]
- [language [type ("type/" Equivalence<Type>)]]
+ [language
+ ["." type ("type/" Equivalence<Type>)]]
])
(do-template [<name> <op> <from> <to>]
@@ -1583,8 +1586,8 @@
_
[return-type return-term]))]
- [decorate-return-try #import-member-try? (` (Either Text (~ return-type))) (` (try (~ return-term)))]
- [decorate-return-io #import-member-io? (` (IO (~ return-type))) (` (io (~ return-term)))]
+ [decorate-return-try #import-member-try? (` ((~! error.Error) (~ return-type))) (` (try (~ return-term)))]
+ [decorate-return-io #import-member-io? (` ((~! io.IO) (~ return-type))) (` ((~! io.io) (~ return-term)))]
)
(def: (free-type-param? [name bounds])
@@ -1785,7 +1788,7 @@
getter-name
(` ((~ getter-name) (~ g!obj))))
getter-type (if import-field-setter?
- (` (IO (~ typeC)))
+ (` ((~! io.IO) (~ typeC)))
typeC)
getter-type (if import-field-static?
getter-type
@@ -1800,7 +1803,7 @@
(` (??? (~ getter-body)))
getter-body)
getter-body (if import-field-setter?
- (` (io (~ getter-body)))
+ (` ((~! io.io) (~ getter-body)))
getter-body)]
(wrap (` (def: (~ getter-call)
(~ getter-type)
@@ -1811,8 +1814,8 @@
(` ((~ setter-name) (~ g!value)))
(` ((~ setter-name) (~ g!value) (~ g!obj))))
setter-type (if import-field-static?
- (` (All [(~+ tvar-asts)] (-> (~ typeC) (IO Any))))
- (` (All [(~+ tvar-asts)] (-> (~ typeC) (~ classC) (IO Any)))))
+ (` (All [(~+ tvar-asts)] (-> (~ typeC) ((~! io.IO) Any))))
+ (` (All [(~+ tvar-asts)] (-> (~ typeC) (~ classC) ((~! io.IO) Any)))))
setter-value (with-mode-field-set import-field-mode import-field-type g!value)
setter-value (if import-field-maybe?
(` (!!! (~ setter-value)))
@@ -1822,7 +1825,7 @@
(wrap (: (List Code)
(list (` (def: (~ setter-call)
(~ setter-type)
- (io ((~ (code.text setter-command)) (~ setter-value))))))))))
+ ((~! io.io) ((~ (code.text setter-command)) (~ setter-value))))))))))
(wrap (list)))]
(wrap (list& getter-interop setter-interop)))
)))
@@ -1842,7 +1845,7 @@
("jvm invokevirtual:java.lang.Class:isInterface:" class))
(def: (load-class class-name)
- (-> Text (Either Text (primitive "java.lang.Class" [Any])))
+ (-> Text (Error (primitive "java.lang.Class" [Any])))
(try ("jvm invokestatic:java.lang.Class:forName:java.lang.String" class-name)))
(def: (class-kind [class-name _])
@@ -2033,7 +2036,7 @@
"Afterwards, closes all resources (assumed to be subclasses of java.io.Closeable), and returns the value resulting from running the body."
(with-open [my-res1 (res1-constructor ___)
my-res2 (res1-constructor ___)]
- (do Monad<IO>
+ (do io.Monad<IO>
[foo (do-something my-res1)
bar (do-something-else my-res2)]
(do-one-last-thing foo bar))))}
@@ -2044,7 +2047,7 @@
closes (list/map (function (_ res)
(` (try ("jvm invokevirtual:java.io.Closeable:close:" (~ (code.symbol ["" (product.left res)]))))))
bindings)]
- (wrap (list (` (do Monad<IO>
+ (wrap (list (` (do (~! io.Monad<IO>)
[(~+ inits)
(~ g!output) (~ body)
(~' #let) [(~ g!_) (exec (~+ (list.reverse closes)) [])]]
diff --git a/stdlib/source/lux/language/compiler.lux b/stdlib/source/lux/language/compiler.lux
index e714773b7..03dd30e2a 100644
--- a/stdlib/source/lux/language/compiler.lux
+++ b/stdlib/source/lux/language/compiler.lux
@@ -1,15 +1,16 @@
(.module:
[lux #*
[control
- [state]
+ ["." state]
["ex" exception (#+ Exception exception:)]
[monad (#+ do)]]
[data
- [product]
- [error (#+ Error)]
+ ["." product]
+ ["." error (#+ Error)]
["." text
format]]
- [macro ["s" syntax (#+ syntax:)]]])
+ [macro
+ ["s" syntax (#+ syntax:)]]])
(type: #export (Operation s o)
(state.State' Error s o))
diff --git a/stdlib/source/lux/language/compiler/analysis.lux b/stdlib/source/lux/language/compiler/analysis.lux
index a2686d6bf..3c4a646fe 100644
--- a/stdlib/source/lux/language/compiler/analysis.lux
+++ b/stdlib/source/lux/language/compiler/analysis.lux
@@ -1,15 +1,16 @@
(.module:
[lux (#- nat int rev)
[data
- [product]
- [error]
+ ["." product]
+ ["." error]
[text ("text/" Equivalence<Text>)]
- [collection [list ("list/" Fold<List>)]]]
- [function]]
+ [collection
+ ["." list ("list/" Fold<List>)]]]
+ ["." function]]
[//
- [extension (#+ Extension)]
+ ["." extension (#+ Extension)]
[//
- [reference (#+ Register Variable Reference)]]])
+ ["." reference (#+ Register Variable Reference)]]])
(type: #export #rec Primitive
#Unit
diff --git a/stdlib/source/lux/language/compiler/analysis/case.lux b/stdlib/source/lux/language/compiler/analysis/case.lux
index 2f5162fbd..34a2b38d6 100644
--- a/stdlib/source/lux/language/compiler/analysis/case.lux
+++ b/stdlib/source/lux/language/compiler/analysis/case.lux
@@ -1,28 +1,29 @@
(.module:
[lux (#- case)
[control
- [monad (#+ do)]
+ ["." monad (#+ do)]
["ex" exception (#+ exception:)]]
[data
- [product]
- [error]
- [maybe]
+ ["." product]
+ ["." error]
+ ["." maybe]
[text
format]
- [collection [list ("list/" Fold<List> Monoid<List> Functor<List>)]]]
+ [collection
+ ["." list ("list/" Fold<List> Monoid<List> Functor<List>)]]]
["." macro
- [code]]]
- [// (#+ Pattern Analysis Operation Compiler)
- [scope]
+ ["." code]]]
+ ["." // (#+ Pattern Analysis Operation Compiler)
+ ["." scope]
["//." type]
- [structure]
+ ["." structure]
["/." //
- [extension]
+ ["." extension]
[//
["." type
["tc" check]]]]]
[/
- [coverage]])
+ ["." coverage]])
(exception: #export (cannot-match-type-with-pattern {type Type} {pattern Code})
(ex.report ["Type" (%type type)]
diff --git a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux b/stdlib/source/lux/language/compiler/analysis/case/coverage.lux
index c19003df6..5c3ff1d72 100644
--- a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux
+++ b/stdlib/source/lux/language/compiler/analysis/case/coverage.lux
@@ -1,20 +1,21 @@
(.module:
[lux #*
[control
- [monad (#+ do)]
+ ["." monad (#+ do)]
["ex" exception (#+ exception:)]
equivalence]
[data
[bit ("bit/" Equivalence<Bit>)]
- [number]
+ ["." number]
["e" error ("error/" Monad<Error>)]
- [maybe]
- [text format]
+ ["." maybe]
+ [text
+ format]
[collection
- [list ("list/" Fold<List>)]
+ ["." list ("list/" Fold<List>)]
["dict" dictionary (#+ Dictionary)]]]]
- [//// ("operation/" Monad<Operation>)]
- [/// (#+ Pattern Variant Operation)])
+ ["." //// ("operation/" Monad<Operation>)]
+ ["." /// (#+ Pattern Variant Operation)])
(def: cases
(-> (Maybe Nat) Nat)
@@ -174,7 +175,7 @@
_
#0)))
-(open: "C/" Equivalence<Coverage>)
+(open: "coverage/" Equivalence<Coverage>)
## After determining the coverage of each individual pattern, it is
## necessary to merge them all to figure out if the entire
@@ -226,7 +227,7 @@
(#Variant allSF casesM)))))
[(#Seq leftA rightA) (#Seq leftSF rightSF)]
- (case [(C/= leftSF leftA) (C/= rightSF rightA)]
+ (case [(coverage/= leftSF leftA) (coverage/= rightSF rightA)]
## There is nothing the addition adds to the coverage.
[#1 #1]
redundant-pattern
@@ -254,12 +255,12 @@
## The left part will always match, so the addition is redundant.
(^multi [(#Seq left right) single]
- (C/= left single))
+ (coverage/= left single))
redundant-pattern
## The right part is not necessary, since it can always match the left.
(^multi [single (#Seq left right)]
- (C/= left single))
+ (coverage/= left single))
(error/wrap single)
## When merging a new coverage against one based on Alt, it may be
@@ -317,7 +318,7 @@
(undefined)))))
_
- (if (C/= so-far addition)
+ (if (coverage/= so-far addition)
## The addition cannot possibly improve the coverage.
redundant-pattern
## There are now 2 alternative paths.
diff --git a/stdlib/source/lux/language/compiler/analysis/expression.lux b/stdlib/source/lux/language/compiler/analysis/expression.lux
index f413b8077..1c74499ad 100644
--- a/stdlib/source/lux/language/compiler/analysis/expression.lux
+++ b/stdlib/source/lux/language/compiler/analysis/expression.lux
@@ -5,20 +5,19 @@
["ex" exception (#+ exception:)]]
[data
["e" error]
- [product]
[text
format]]
- [macro]]
- ["." ///
- [extension]]
- [// (#+ Analysis Operation Compiler)
- [type]
- [primitive]
- [structure]
- [reference]
- ["/." /// (#+ Eval)
- ## [".L" macro]
- ]])
+ ["." macro]]
+ ["." // (#+ Analysis Operation Compiler)
+ ["." type]
+ ["." primitive]
+ ["." structure]
+ ["." reference]
+ ["/." //
+ ["." extension]
+ ["//." // (#+ Eval)
+ ## [".L" macro]
+ ]]])
(exception: #export (macro-expansion-failed {message Text})
message)
diff --git a/stdlib/source/lux/language/compiler/analysis/function.lux b/stdlib/source/lux/language/compiler/analysis/function.lux
index 51f1892de..440c49237 100644
--- a/stdlib/source/lux/language/compiler/analysis/function.lux
+++ b/stdlib/source/lux/language/compiler/analysis/function.lux
@@ -4,21 +4,21 @@
monad
["ex" exception (#+ exception:)]]
[data
- [maybe]
+ ["." maybe]
["." text
format]
- [collection [list ("list/" Fold<List> Monoid<List> Monad<List>)]]]
- ["." macro
- [code]]
+ [collection
+ ["." list ("list/" Fold<List> Monoid<List> Monad<List>)]]]
+ ["." macro]
[language
["." type
["tc" check]]]]
- [// (#+ Analysis Operation Compiler)
- [scope]
+ ["." // (#+ Analysis Operation Compiler)
+ ["." scope]
["//." type]
- [inference]
+ ["." inference]
["/." //
- [extension]]])
+ ["." extension]]])
(exception: #export (cannot-analyse {expected Type} {function Text} {argument Text} {body Code})
(ex.report ["Type" (%type expected)]
diff --git a/stdlib/source/lux/language/compiler/analysis/inference.lux b/stdlib/source/lux/language/compiler/analysis/inference.lux
index 403ad0092..29084ce40 100644
--- a/stdlib/source/lux/language/compiler/analysis/inference.lux
+++ b/stdlib/source/lux/language/compiler/analysis/inference.lux
@@ -4,18 +4,19 @@
[monad (#+ do)]
["ex" exception (#+ exception:)]]
[data
- [maybe]
+ ["." maybe]
["." text
format]
- [collection [list ("list/" Functor<List>)]]]
- [macro]]
+ [collection
+ ["." list ("list/" Functor<List>)]]]
+ ["." macro]]
[////
["." type
["tc" check]]]
- [/// ("operation/" Monad<Operation>)
- [extension]]
+ ["." /// ("operation/" Monad<Operation>)
+ ["." extension]]
[// (#+ Tag Analysis Operation Compiler)]
- [//type])
+ ["." //type])
(exception: #export (variant-tag-out-of-bounds {size Nat} {tag Tag} {type Type})
(ex.report ["Tag" (%n tag)]
diff --git a/stdlib/source/lux/language/compiler/analysis/module.lux b/stdlib/source/lux/language/compiler/analysis/module.lux
index 1ac2b4ac4..7c21724bb 100644
--- a/stdlib/source/lux/language/compiler/analysis/module.lux
+++ b/stdlib/source/lux/language/compiler/analysis/module.lux
@@ -1,21 +1,21 @@
(.module:
[lux #*
[control
- [monad (#+ do)]
+ ["." monad (#+ do)]
["ex" exception (#+ exception:)]
pipe]
[data
- [text ("text/" Equivalence<Text>)
+ ["." text ("text/" Equivalence<Text>)
format]
- ["e" error]
+ ["." error]
[collection
- [list ("list/" Fold<List> Functor<List>)]
+ ["." list ("list/" Fold<List> Functor<List>)]
[dictionary
- [plist]]]]
- [macro]]
- [// (#+ Operation)
+ ["." plist]]]]
+ ["." macro]]
+ ["." // (#+ Operation)
["/." //
- [extension]]])
+ ["." extension]]])
(type: #export Tag Text)
@@ -70,10 +70,10 @@
#.None
(extension.lift
(function (_ state)
- (#e.Success [(update@ #.modules
- (plist.put self-name (set@ #.module-annotations (#.Some annotations) self))
- state)
- []])))
+ (#error.Success [(update@ #.modules
+ (plist.put self-name (set@ #.module-annotations (#.Some annotations) self))
+ state)
+ []])))
(#.Some old)
(///.throw cannot-set-module-annotations-more-than-once [self-name old annotations]))))
@@ -84,10 +84,10 @@
[self-name (extension.lift macro.current-module-name)]
(extension.lift
(function (_ state)
- (#e.Success [(update@ #.modules
- (plist.update self-name (update@ #.imports (|>> (#.Cons module))))
- state)
- []])))))
+ (#error.Success [(update@ #.modules
+ (plist.update self-name (update@ #.imports (|>> (#.Cons module))))
+ state)
+ []])))))
(def: #export (alias alias module)
(-> Text Text (Operation Any))
@@ -95,11 +95,11 @@
[self-name (extension.lift macro.current-module-name)]
(extension.lift
(function (_ state)
- (#e.Success [(update@ #.modules
- (plist.update self-name (update@ #.module-aliases (: (-> (List [Text Text]) (List [Text Text]))
- (|>> (#.Cons [alias module])))))
- state)
- []])))))
+ (#error.Success [(update@ #.modules
+ (plist.update self-name (update@ #.module-aliases (: (-> (List [Text Text]) (List [Text Text]))
+ (|>> (#.Cons [alias module])))))
+ state)
+ []])))))
(def: #export (exists? module)
(-> Text (Operation Bit))
@@ -109,7 +109,7 @@
(get@ #.modules)
(plist.get module)
(case> (#.Some _) #1 #.None #0)
- [state] #e.Success))))
+ [state] #error.Success))))
(def: #export (define name definition)
(-> Text Definition (Operation []))
@@ -120,14 +120,14 @@
(function (_ state)
(case (plist.get name (get@ #.definitions self))
#.None
- (#e.Success [(update@ #.modules
- (plist.put self-name
- (update@ #.definitions
- (: (-> (List [Text Definition]) (List [Text Definition]))
- (|>> (#.Cons [name definition])))
- self))
- state)
- []])
+ (#error.Success [(update@ #.modules
+ (plist.put self-name
+ (update@ #.definitions
+ (: (-> (List [Text Definition]) (List [Text Definition]))
+ (|>> (#.Cons [name definition])))
+ self))
+ state)
+ []])
(#.Some already-existing)
((///.throw cannot-define-more-than-once [self-name name]) state))))))
@@ -137,10 +137,10 @@
(extension.lift
(function (_ state)
(let [module (new hash)]
- (#e.Success [(update@ #.modules
- (plist.put name module)
- state)
- []])))))
+ (#error.Success [(update@ #.modules
+ (plist.put name module)
+ state)
+ []])))))
(def: #export (with-module hash name action)
(All [a] (-> Nat Text (Operation a) (Operation [Module a])))
@@ -162,10 +162,10 @@
#.Active #1
_ #0)]
(if active?
- (#e.Success [(update@ #.modules
- (plist.put module-name (set@ #.module-state <tag> module))
- state)
- []])
+ (#error.Success [(update@ #.modules
+ (plist.put module-name (set@ #.module-state <tag> module))
+ state)
+ []])
((///.throw can-only-change-state-of-active-module [module-name <tag>])
state)))
@@ -178,10 +178,10 @@
(function (_ state)
(case (|> state (get@ #.modules) (plist.get module-name))
(#.Some module)
- (#e.Success [state
- (case (get@ #.module-state module)
- <tag> #1
- _ #0)])
+ (#error.Success [state
+ (case (get@ #.module-state module)
+ <tag> #1
+ _ #0)])
#.None
((///.throw unknown-module module-name) state)))))]
@@ -198,7 +198,7 @@
(function (_ state)
(case (|> state (get@ #.modules) (plist.get module-name))
(#.Some module)
- (#e.Success [state (get@ <tag> module)])
+ (#error.Success [state (get@ <tag> module)])
#.None
((///.throw unknown-module module-name) state)))))]
@@ -241,15 +241,15 @@
(case (|> state (get@ #.modules) (plist.get self-name))
(#.Some module)
(let [namespaced-tags (list/map (|>> [self-name]) tags)]
- (#e.Success [(update@ #.modules
- (plist.update self-name
- (|>> (update@ #.tags (function (_ tag-bindings)
- (list/fold (function (_ [idx tag] table)
- (plist.put tag [idx namespaced-tags exported? type] table))
- tag-bindings
- (list.enumerate tags))))
- (update@ #.types (plist.put type-name [namespaced-tags exported? type]))))
- state)
- []]))
+ (#error.Success [(update@ #.modules
+ (plist.update self-name
+ (|>> (update@ #.tags (function (_ tag-bindings)
+ (list/fold (function (_ [idx tag] table)
+ (plist.put tag [idx namespaced-tags exported? type] table))
+ tag-bindings
+ (list.enumerate tags))))
+ (update@ #.types (plist.put type-name [namespaced-tags exported? type]))))
+ state)
+ []]))
#.None
((///.throw unknown-module self-name) state))))))
diff --git a/stdlib/source/lux/language/compiler/analysis/primitive.lux b/stdlib/source/lux/language/compiler/analysis/primitive.lux
index 346906909..bd42825d3 100644
--- a/stdlib/source/lux/language/compiler/analysis/primitive.lux
+++ b/stdlib/source/lux/language/compiler/analysis/primitive.lux
@@ -1,8 +1,8 @@
(.module:
[lux (#- nat int rev)
- [control monad]
- [macro]]
- [// (#+ Analysis Operation)
+ [control
+ monad]]
+ ["." // (#+ Analysis Operation)
[".A" type]
["/." //]])
diff --git a/stdlib/source/lux/language/compiler/analysis/reference.lux b/stdlib/source/lux/language/compiler/analysis/reference.lux
index af134ebe3..5949c0036 100644
--- a/stdlib/source/lux/language/compiler/analysis/reference.lux
+++ b/stdlib/source/lux/language/compiler/analysis/reference.lux
@@ -3,21 +3,20 @@
[control
monad
["ex" exception (#+ exception:)]]
- ["." macro
- [code]]
+ ["." macro]
[language
[type
["tc" check]]]
[data
[text ("text/" Equivalence<Text>)
format]]]
- [// (#+ Analysis Operation)
- [scope]
- [type]
+ ["." // (#+ Analysis Operation)
+ ["." scope]
+ ["." type]
["/." //
- [extension]
+ ["." extension]
[//
- [reference]]]])
+ ["." reference]]]])
(exception: #export (foreign-module-has-not-been-imported {current Text} {foreign Text})
(ex.report ["Current" current]
diff --git a/stdlib/source/lux/language/compiler/analysis/scope.lux b/stdlib/source/lux/language/compiler/analysis/scope.lux
index 3ee0499e8..a10ed6e58 100644
--- a/stdlib/source/lux/language/compiler/analysis/scope.lux
+++ b/stdlib/source/lux/language/compiler/analysis/scope.lux
@@ -5,17 +5,18 @@
[data
[text ("text/" Equivalence<Text>)
format]
- [maybe ("maybe/" Monad<Maybe>)]
- [product]
+ ["." maybe ("maybe/" Monad<Maybe>)]
+ ["." product]
["e" error]
[collection
- [list ("list/" Functor<List> Fold<List> Monoid<List>)]
- [dictionary [plist]]]]]
+ ["." list ("list/" Functor<List> Fold<List> Monoid<List>)]
+ [dictionary
+ ["." plist]]]]]
[// (#+ Operation Compiler)
- ["compiler" //
- [extension]
+ ["/." //
+ ["." extension]
[//
- [reference (#+ Register Variable)]]]])
+ ["." reference (#+ Register Variable)]]]])
(type: Local (Bindings Text [Type Register]))
(type: Foreign (Bindings Text [Type Variable]))
@@ -109,8 +110,8 @@
(|>> (update@ #.counter inc)
(update@ #.mappings (plist.put name [type new-var-id]))))
head)]
- (case (compiler.run' [bundle (set@ #.scopes (#.Cons new-head tail) state)]
- action)
+ (case (///.run' [bundle (set@ #.scopes (#.Cons new-head tail) state)]
+ action)
(#e.Success [[bundle' state'] output])
(case (get@ #.scopes state')
(#.Cons head' tail')
diff --git a/stdlib/source/lux/language/compiler/analysis/structure.lux b/stdlib/source/lux/language/compiler/analysis/structure.lux
index 382eab486..d3ce95cdd 100644
--- a/stdlib/source/lux/language/compiler/analysis/structure.lux
+++ b/stdlib/source/lux/language/compiler/analysis/structure.lux
@@ -1,24 +1,26 @@
(.module:
[lux #*
[control
- [monad (#+ do)]
+ ["." monad (#+ do)]
["ex" exception (#+ exception:)]]
[data
- [ident]
- [number]
- [product]
- [maybe]
- [text format]
- [collection [list ("list/" Functor<List>)]
+ ["." ident]
+ ["." number]
+ ["." product]
+ ["." maybe]
+ [text
+ format]
+ [collection
+ ["." list ("list/" Functor<List>)]
["dict" dictionary (#+ Dictionary)]]]
["." macro
- [code]]]
- [// (#+ Tag Analysis Operation Compiler)
+ ["." code]]]
+ ["." // (#+ Tag Analysis Operation Compiler)
["//." type]
- [primitive]
- [inference]
+ ["." primitive]
+ ["." inference]
["/." //
- [extension]
+ ["." extension]
["//." //
["." type
["tc" check]]]]])
diff --git a/stdlib/source/lux/language/compiler/analysis/type.lux b/stdlib/source/lux/language/compiler/analysis/type.lux
index f87a96758..8bc0bd53b 100644
--- a/stdlib/source/lux/language/compiler/analysis/type.lux
+++ b/stdlib/source/lux/language/compiler/analysis/type.lux
@@ -3,14 +3,15 @@
[control
[monad (#+ do)]]
[data
- [error]]
- [function]
- [macro]
+ ["." error]]
+ ["." function]
+ ["." macro]
[language
- [type ["tc" check]]]]
+ [type
+ ["tc" check]]]]
[// (#+ Operation)
["/." //
- [extension]]])
+ ["." extension]]])
(def: #export (with-type expected)
(All [a] (-> Type (Operation a) (Operation a)))
diff --git a/stdlib/source/lux/language/compiler/default/cache.lux b/stdlib/source/lux/language/compiler/default/cache.lux
index f41cd0792..f82469cd7 100644
--- a/stdlib/source/lux/language/compiler/default/cache.lux
+++ b/stdlib/source/lux/language/compiler/default/cache.lux
@@ -1,33 +1,35 @@
(.module:
[lux #*
- [data [format [binary (#+ Binary)]]]])
+ [data
+ [format
+ ["_" binary (#+ Binary)]]]])
(def: definition
(Binary Definition)
- ($_ binary.seq binary.type binary.code binary.any))
+ ($_ _.seq _.type _.code _.any))
(def: alias
(Binary [Text Text])
- (binary.seq binary.text binary.text))
+ (_.seq _.text _.text))
## TODO: Remove #module-hash, #imports & #module-state ASAP.
## TODO: Not just from this parser, but from the lux.Module type.
(def: #export module
(Binary Module)
- ($_ binary.seq
+ ($_ _.seq
## #module-hash
- (binary.ignore +0)
+ (_.ignore +0)
## #module-aliases
- (binary.list ..alias)
+ (_.list ..alias)
## #definitions
- (binary.list (binary.seq binary.text ..definition))
+ (_.list (_.seq _.text ..definition))
## #imports
- (binary.list binary.text)
+ (_.list _.text)
## #tags
- (binary.ignore (list))
+ (_.ignore (list))
## #types
- (binary.ignore (list))
+ (_.ignore (list))
## #module-annotations
- (binary.maybe binary.code)
+ (_.maybe _.code)
## #module-state
- (binary.ignore #.Cached)))
+ (_.ignore #.Cached)))
diff --git a/stdlib/source/lux/language/compiler/default/repl/type.lux b/stdlib/source/lux/language/compiler/default/repl/type.lux
index c9b68c06e..4b2b8dc02 100644
--- a/stdlib/source/lux/language/compiler/default/repl/type.lux
+++ b/stdlib/source/lux/language/compiler/default/repl/type.lux
@@ -6,22 +6,24 @@
["p" parser]
pipe]
[data
- [error (#+ Error)]
+ ["." error (#+ Error)]
[text
format]
[format
[xml (#+ XML)]
[json (#+ JSON)]]
- [collection [list]]]
+ [collection
+ ["." list]]]
[time
[instant (#+ Instant)]
[duration (#+ Duration)]
[date (#+ Date)]]
- [function]
+ ["." function]
["." macro
- [code]
- [poly (#+ Poly)]]
- [language [type]]])
+ ["." code]
+ ["." poly (#+ Poly)]]
+ [language
+ ["." type]]])
(exception: #export (cannot-represent-value {type Type})
(ex.report ["Type" (%type type)]))
diff --git a/stdlib/source/lux/language/compiler/extension.lux b/stdlib/source/lux/language/compiler/extension.lux
index fc41aa30d..10d2d62ca 100644
--- a/stdlib/source/lux/language/compiler/extension.lux
+++ b/stdlib/source/lux/language/compiler/extension.lux
@@ -4,11 +4,12 @@
[monad (#+ do)]
["ex" exception (#+ exception:)]]
[data
- [error (#+ Error)]
- [text]
- [collection ["dict" dictionary (#+ Dictionary)]]]
- [function]]
- [//])
+ ["." error (#+ Error)]
+ ["." text]
+ [collection
+ ["dict" dictionary (#+ Dictionary)]]]
+ ["." function]]
+ ["." //])
(type: #export (Extension i)
[Text (List i)])
diff --git a/stdlib/source/lux/language/compiler/extension/analysis.lux b/stdlib/source/lux/language/compiler/extension/analysis.lux
index 0f57de1ff..4d78ceb43 100644
--- a/stdlib/source/lux/language/compiler/extension/analysis.lux
+++ b/stdlib/source/lux/language/compiler/extension/analysis.lux
@@ -2,12 +2,12 @@
[lux #*
[data
[collection
- [dictionary]]]]
+ ["." dictionary]]]]
[///
[analysis (#+ Bundle)]]
[/
- [common]
- [host]])
+ ["." common]
+ ["." host]])
(def: #export bundle
Bundle
diff --git a/stdlib/source/lux/language/compiler/extension/analysis/common.lux b/stdlib/source/lux/language/compiler/extension/analysis/common.lux
index 9616f2533..0dc405438 100644
--- a/stdlib/source/lux/language/compiler/extension/analysis/common.lux
+++ b/stdlib/source/lux/language/compiler/extension/analysis/common.lux
@@ -1,31 +1,32 @@
(.module:
[lux #*
[control
- [monad (#+ do)]
+ ["." monad (#+ do)]
["ex" exception (#+ exception:)]
[thread (#+ Box)]]
- [concurrency [atom (#+ Atom)]]
+ [concurrency
+ [atom (#+ Atom)]]
[data
["." text
format]
[collection
- [list ("list/" Functor<List>)]
- [array]
+ ["." list ("list/" Functor<List>)]
+ ["." array]
["dict" dictionary (#+ Dictionary)]]]
["." language
[type ["tc" check]]]
[io (#+ IO)]]
["." ////
- [analysis (#+ Analysis Bundle)
+ ["." analysis (#+ Analysis Handler Bundle)
[".A" type]
[".A" case]
[".A" function]]]
["." ///
- [bundle]])
+ ["." bundle]])
## [Utils]
(def: (simple inputsT+ outputT)
- (-> (List Type) Type analysis.Handler)
+ (-> (List Type) Type Handler)
(let [num-expected (list.size inputsT+)]
(function (_ extension-name analyse args)
(let [num-actual (list.size args)]
@@ -41,25 +42,25 @@
(////.throw bundle.incorrect-arity [extension-name num-expected num-actual]))))))
(def: #export (nullary valueT)
- (-> Type analysis.Handler)
+ (-> Type Handler)
(simple (list) valueT))
(def: #export (unary inputT outputT)
- (-> Type Type analysis.Handler)
+ (-> Type Type Handler)
(simple (list inputT) outputT))
(def: #export (binary subjectT paramT outputT)
- (-> Type Type Type analysis.Handler)
+ (-> Type Type Type Handler)
(simple (list subjectT paramT) outputT))
(def: #export (trinary subjectT param0T param1T outputT)
- (-> Type Type Type Type analysis.Handler)
+ (-> Type Type Type Type Handler)
(simple (list subjectT param0T param1T) outputT))
## [Analysers]
## "lux is" represents reference/pointer equality.
(def: lux::is
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(do ////.Monad<Operation>
[[var-id varT] (typeA.with-env tc.var)]
@@ -69,7 +70,7 @@
## "lux try" provides a simple way to interact with the host platform's
## error-handling facilities.
(def: lux::try
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(case args
(^ (list opC))
@@ -84,7 +85,7 @@
(////.throw bundle.incorrect-arity [extension-name +1 (list.size args)]))))
(def: lux::in-module
- analysis.Handler
+ Handler
(function (_ extension-name analyse argsC+)
(case argsC+
(^ (list [_ (#.Text module-name)] exprC))
@@ -96,7 +97,7 @@
## (do-template [<name> <type>]
## [(def: <name>
-## analysis.Handler
+## Handler
## (function (_ extension-name analyse args)
## (case args
## (^ (list typeC valueC))
@@ -114,7 +115,7 @@
## )
(def: lux::check::type
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(case args
(^ (list valueC))
@@ -205,7 +206,7 @@
)))
(def: array::get
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(do ////.Monad<Operation>
[[var-id varT] (typeA.with-env tc.var)]
@@ -213,7 +214,7 @@
analyse args))))
(def: array::put
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(do ////.Monad<Operation>
[[var-id varT] (typeA.with-env tc.var)]
@@ -221,7 +222,7 @@
analyse args))))
(def: array::remove
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(do ////.Monad<Operation>
[[var-id varT] (typeA.with-env tc.var)]
@@ -262,7 +263,7 @@
)))
(def: atom::new
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(case args
(^ (list initC))
@@ -277,7 +278,7 @@
(////.throw bundle.incorrect-arity [extension-name +1 (list.size args)]))))
(def: atom::read
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(do ////.Monad<Operation>
[[var-id varT] (typeA.with-env tc.var)]
@@ -285,7 +286,7 @@
analyse args))))
(def: atom::compare-and-swap
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(do ////.Monad<Operation>
[[var-id varT] (typeA.with-env tc.var)]
@@ -302,7 +303,7 @@
)))
(def: box::new
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(case args
(^ (list initC))
@@ -317,7 +318,7 @@
(////.throw bundle.incorrect-arity [extension-name +1 (list.size args)]))))
(def: box::read
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(do ////.Monad<Operation>
[[thread-id threadT] (typeA.with-env tc.var)
@@ -326,7 +327,7 @@
analyse args))))
(def: box::write
- analysis.Handler
+ Handler
(function (_ extension-name analyse args)
(do ////.Monad<Operation>
[[thread-id threadT] (typeA.with-env tc.var)
diff --git a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux b/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux
index da4d4461b..ef5e9317f 100644
--- a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux
+++ b/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux
@@ -1,32 +1,32 @@
(.module:
[lux (#- char int)
[control
- [monad (#+ do)]
+ ["." monad (#+ do)]
["p" parser]
["ex" exception (#+ exception:)]
pipe]
[data
["e" error]
- [maybe]
- [product]
- [text ("text/" Equivalence<Text>)
+ ["." maybe]
+ ["." product]
+ ["." text ("text/" Equivalence<Text>)
format]
[collection
- [list ("list/" Fold<List> Functor<List> Monoid<List>)]
- [array]
- [dictionary (#+ Dictionary)]]]
+ ["." list ("list/" Fold<List> Functor<List> Monoid<List>)]
+ ["." array]
+ ["." dictionary (#+ Dictionary)]]]
["." macro
["s" syntax]]
[language
["." type
- [check]]]
- [host]]
+ ["." check]]]
+ ["." host]]
[//
- [common]
+ ["." common]
["/." //
- [bundle]
+ ["." bundle]
["//." // ("operation/" Monad<Operation>)
- [analysis (#+ Analysis Operation Handler Bundle)
+ ["." analysis (#+ Analysis Operation Handler Bundle)
[".A" type]
[".A" inference]]]]]
)
diff --git a/stdlib/source/lux/language/compiler/extension/bundle.lux b/stdlib/source/lux/language/compiler/extension/bundle.lux
index 222ad7f5e..dce95cfb1 100644
--- a/stdlib/source/lux/language/compiler/extension/bundle.lux
+++ b/stdlib/source/lux/language/compiler/extension/bundle.lux
@@ -9,7 +9,7 @@
[collection
[list ("list/" Functor<List>)]
["dict" dictionary (#+ Dictionary)]]]]
- [//])
+ [// (#+ Handler Bundle)])
(exception: #export (incorrect-arity {name Text} {arity Nat} {args Nat})
(ex.report ["Extension" (%t name)]
@@ -21,18 +21,18 @@
## [Utils]
(def: #export empty
- //.Bundle
+ Bundle
(dict.new text.Hash<Text>))
(def: #export (install name anonymous)
(All [s i o]
- (-> Text (//.Handler s i o)
- (-> (//.Bundle s i o) (//.Bundle s i o))))
+ (-> Text (Handler s i o)
+ (-> (Bundle s i o) (Bundle s i o))))
(dict.put name anonymous))
(def: #export (prefix prefix)
(All [s i o]
- (-> Text (-> (//.Bundle s i o) (//.Bundle s i o))))
+ (-> Text (-> (Bundle s i o) (Bundle s i o))))
(|>> dict.entries
(list/map (function (_ [key val]) [(format prefix " " key) val]))
(dict.from-list text.Hash<Text>)))
diff --git a/stdlib/source/lux/language/compiler/init.lux b/stdlib/source/lux/language/compiler/init.lux
index 92a066b7e..648211ca7 100644
--- a/stdlib/source/lux/language/compiler/init.lux
+++ b/stdlib/source/lux/language/compiler/init.lux
@@ -1,7 +1,7 @@
(.module:
lux
- [///]
- [///host])
+ ["." ///
+ ["." host]])
(def: #export (cursor file)
(-> Text Cursor)
@@ -23,15 +23,15 @@
(`` (def: #export info
Info
- {#.target (for {(~~ (static ///host.common-lisp)) ///host.common-lisp
- (~~ (static ///host.js)) ///host.js
- (~~ (static ///host.jvm)) ///host.jvm
- (~~ (static ///host.lua)) ///host.lua
- (~~ (static ///host.php)) ///host.php
- (~~ (static ///host.python)) ///host.python
- (~~ (static ///host.r)) ///host.r
- (~~ (static ///host.ruby)) ///host.ruby
- (~~ (static ///host.scheme)) ///host.scheme})
+ {#.target (for {(~~ (static host.common-lisp)) host.common-lisp
+ (~~ (static host.js)) host.js
+ (~~ (static host.jvm)) host.jvm
+ (~~ (static host.lua)) host.lua
+ (~~ (static host.php)) host.php
+ (~~ (static host.python)) host.python
+ (~~ (static host.r)) host.r
+ (~~ (static host.ruby)) host.ruby
+ (~~ (static host.scheme)) host.scheme})
#.version ///.version
#.mode #.Build}))
diff --git a/stdlib/source/lux/language/compiler/meta/archive.lux b/stdlib/source/lux/language/compiler/meta/archive.lux
index 4a981007a..570221385 100644
--- a/stdlib/source/lux/language/compiler/meta/archive.lux
+++ b/stdlib/source/lux/language/compiler/meta/archive.lux
@@ -2,18 +2,22 @@
[lux #*
[control
["ex" exception (#+ exception:)]
- [equivalence (#+ Equivalence)]
- [monad (#+ do)]]
+ ["." equivalence (#+ Equivalence)]
+ ["." monad (#+ do)]]
[data
- [error (#+ Error)]
- [ident]
+ ["." error (#+ Error)]
+ ["." ident]
["." text
format]
- [collection ["dict" dictionary (#+ Dictionary)]]]
- [language [type (#+ :share)]]
- [type abstract]
- [world [file (#+ File)]]]
- [//// (#+ Version)])
+ [collection
+ ["dict" dictionary (#+ Dictionary)]]]
+ [language
+ [type (#+ :share)]]
+ [type
+ abstract]
+ [world
+ [file (#+ File)]]]
+ ["." //// (#+ Version)])
## Key
(type: #export Signature
diff --git a/stdlib/source/lux/language/compiler/meta/cache.lux b/stdlib/source/lux/language/compiler/meta/cache.lux
index d382c5860..59d2f3c3b 100644
--- a/stdlib/source/lux/language/compiler/meta/cache.lux
+++ b/stdlib/source/lux/language/compiler/meta/cache.lux
@@ -1,27 +1,29 @@
(.module:
[lux (#- Module)
[control
- [monad (#+ Monad do)]
+ ["." monad (#+ Monad do)]
["ex" exception (#+ exception:)]
pipe]
[data
- [bit ("bit/" Equivalence<Bit>)]
- [maybe]
- [error]
- [product]
- [format [binary (#+ Binary)]]
+ ["." bit ("bit/" Equivalence<Bit>)]
+ ["." maybe]
+ ["." error]
+ ["." product]
+ [format
+ ["." binary (#+ Binary)]]
["." text
format]
[collection
- [list ("list/" Functor<List> Fold<List>)]
+ ["." list ("list/" Functor<List> Fold<List>)]
["dict" dictionary (#+ Dictionary)]
- [set (#+ Set)]]]
- [world [file (#+ File System)]]]
+ ["." set (#+ Set)]]]
+ [world
+ [file (#+ File System)]]]
[//io (#+ Context Module)]
- [//io/context]
- [//io/archive]
- [//archive (#+ Signature Key Descriptor Document Archive)]
- [/dependency (#+ Dependency Graph)])
+ ["." //io/context]
+ ["." //io/archive]
+ ["." //archive (#+ Signature Key Descriptor Document Archive)]
+ ["." /dependency (#+ Dependency Graph)])
(exception: #export (cannot-delete-cached-file {file File})
(ex.report ["File" file]))
diff --git a/stdlib/source/lux/language/compiler/meta/cache/dependency.lux b/stdlib/source/lux/language/compiler/meta/cache/dependency.lux
index b12a7e9fb..6f7994c92 100644
--- a/stdlib/source/lux/language/compiler/meta/cache/dependency.lux
+++ b/stdlib/source/lux/language/compiler/meta/cache/dependency.lux
@@ -1,7 +1,7 @@
(.module:
[lux (#- Module)
[data
- [text]
+ ["." text]
[collection
[list ("list/" Functor<List> Fold<List>)]
["dict" dictionary (#+ Dictionary)]]]]
diff --git a/stdlib/source/lux/language/compiler/meta/io/archive.lux b/stdlib/source/lux/language/compiler/meta/io/archive.lux
index e69f6eaf4..4a6e3fb39 100644
--- a/stdlib/source/lux/language/compiler/meta/io/archive.lux
+++ b/stdlib/source/lux/language/compiler/meta/io/archive.lux
@@ -4,14 +4,14 @@
monad
["ex" exception (#+ exception:)]]
[data
- [error]
+ ["." error]
["." text
format]]
[world
- [file (#+ File System)]
+ ["." file (#+ File System)]
[blob (#+ Blob)]]]
- [/////host]
- [// (#+ Module)])
+ ["." /////host]
+ ["." // (#+ Module)])
(type: #export Document File)
diff --git a/stdlib/source/lux/language/compiler/meta/io/context.lux b/stdlib/source/lux/language/compiler/meta/io/context.lux
index 4658858ff..eab4b284a 100644
--- a/stdlib/source/lux/language/compiler/meta/io/context.lux
+++ b/stdlib/source/lux/language/compiler/meta/io/context.lux
@@ -4,15 +4,16 @@
monad
["ex" exception (#+ Exception exception:)]]
[data
- [error]
+ ["." error]
[text
format
- [encoding]]]
+ ["." encoding]]]
[world
- [file (#+ File System)]
+ ["." file (#+ File System)]
[blob (#+ Blob)]]]
- [/////host]
- [// (#+ Context Module)])
+ ["." // (#+ Context Module)
+ [////
+ ["." host]]])
(type: #export Extension Text)
@@ -24,15 +25,15 @@
(def: host-extension
Extension
- (`` (for {(~~ (static /////host.common-lisp)) ".cl"
- (~~ (static /////host.js)) ".js"
- (~~ (static /////host.jvm)) ".jvm"
- (~~ (static /////host.lua)) ".lua"
- (~~ (static /////host.php)) ".php"
- (~~ (static /////host.python)) ".py"
- (~~ (static /////host.r)) ".r"
- (~~ (static /////host.ruby)) ".rb"
- (~~ (static /////host.scheme)) ".scm"})))
+ (`` (for {(~~ (static host.common-lisp)) ".cl"
+ (~~ (static host.js)) ".js"
+ (~~ (static host.jvm)) ".jvm"
+ (~~ (static host.lua)) ".lua"
+ (~~ (static host.php)) ".php"
+ (~~ (static host.python)) ".py"
+ (~~ (static host.r)) ".r"
+ (~~ (static host.ruby)) ".rb"
+ (~~ (static host.scheme)) ".scm"})))
(def: lux-extension Extension ".lux")
diff --git a/stdlib/source/lux/language/compiler/synthesis.lux b/stdlib/source/lux/language/compiler/synthesis.lux
index f4d7a6407..8dd99986b 100644
--- a/stdlib/source/lux/language/compiler/synthesis.lux
+++ b/stdlib/source/lux/language/compiler/synthesis.lux
@@ -3,12 +3,13 @@
[control [monad (#+ do)]]
[data
[error (#+ Error)]
- [collection ["dict" dictionary (#+ Dictionary)]]]]
+ [collection
+ ["dict" dictionary (#+ Dictionary)]]]]
["." //
- [analysis (#+ Environment Arity Analysis)]
- [extension (#+ Extension)]
+ ["." analysis (#+ Environment Arity Analysis)]
+ ["." extension (#+ Extension)]
[//
- [reference (#+ Register Variable Reference)]]])
+ ["." reference (#+ Register Variable Reference)]]])
(type: #export Resolver (Dictionary Variable Variable))
diff --git a/stdlib/source/lux/language/compiler/synthesis/case.lux b/stdlib/source/lux/language/compiler/synthesis/case.lux
index 92a17fa71..8301e11aa 100644
--- a/stdlib/source/lux/language/compiler/synthesis/case.lux
+++ b/stdlib/source/lux/language/compiler/synthesis/case.lux
@@ -3,20 +3,21 @@
[control
[equivalence (#+ Equivalence)]
pipe
- [monad (#+ do)]]
+ ["." monad (#+ do)]]
[data
- [product]
+ ["." product]
[bit ("bit/" Equivalence<Bit>)]
[text ("text/" Equivalence<Text>)
format]
[number ("frac/" Equivalence<Frac>)]
- [collection [list ("list/" Fold<List> Monoid<List>)]]]]
- [// (#+ Path Synthesis Operation Compiler)
- [function]
+ [collection
+ ["." list ("list/" Fold<List> Monoid<List>)]]]]
+ ["." // (#+ Path Synthesis Operation Compiler)
+ ["." function]
["/." // ("operation/" Monad<Operation>)
- [analysis (#+ Pattern Match Analysis)]
+ ["." analysis (#+ Pattern Match Analysis)]
[//
- [reference]]]])
+ ["." reference]]]])
(def: (path' pattern bodyC)
(-> Pattern (Operation Path) (Operation Path))
diff --git a/stdlib/source/lux/language/compiler/synthesis/expression.lux b/stdlib/source/lux/language/compiler/synthesis/expression.lux
index 999d49b15..e122afc32 100644
--- a/stdlib/source/lux/language/compiler/synthesis/expression.lux
+++ b/stdlib/source/lux/language/compiler/synthesis/expression.lux
@@ -1,20 +1,20 @@
(.module:
[lux (#- primitive)
[control
- [monad (#+ do)]]
+ ["." monad (#+ do)]]
[data
- [maybe]
+ ["." maybe]
[collection
- [list ("list/" Functor<List>)]
+ ["." list ("list/" Functor<List>)]
["dict" dictionary (#+ Dictionary)]]]]
- [// (#+ Synthesis Compiler)
- [function]
- [case]
+ ["." // (#+ Synthesis Compiler)
+ ["." function]
+ ["." case]
["/." // ("operation/" Monad<Operation>)
- [analysis (#+ Analysis)]
- [extension]
+ ["." analysis (#+ Analysis)]
+ ["." extension]
[//
- [reference]]]])
+ ["." reference]]]])
(def: (primitive analysis)
(-> analysis.Primitive //.Primitive)
diff --git a/stdlib/source/lux/language/compiler/synthesis/function.lux b/stdlib/source/lux/language/compiler/synthesis/function.lux
index 0fadbc6d1..05f1c2e96 100644
--- a/stdlib/source/lux/language/compiler/synthesis/function.lux
+++ b/stdlib/source/lux/language/compiler/synthesis/function.lux
@@ -1,22 +1,22 @@
(.module:
[lux (#- function)
[control
- [monad (#+ do)]
- [state]
+ ["." monad (#+ do)]
+ ["." state]
pipe
["ex" exception (#+ exception:)]]
[data
- [maybe ("maybe/" Monad<Maybe>)]
- [error]
+ ["." maybe ("maybe/" Monad<Maybe>)]
+ ["." error]
[collection
- [list ("list/" Functor<List> Monoid<List> Fold<List>)]
+ ["." list ("list/" Functor<List> Monoid<List> Fold<List>)]
["dict" dictionary (#+ Dictionary)]]]]
- [// (#+ Synthesis Operation Compiler)
- [loop]
+ ["." // (#+ Synthesis Operation Compiler)
+ ["." loop (#+ Transform)]
[///
- [reference (#+ Variable)]
+ ["." reference (#+ Variable)]
["." compiler
- [analysis (#+ Environment Arity Analysis)]]]])
+ ["." analysis (#+ Environment Arity Analysis)]]]])
(def: #export nested?
(-> Arity Bit)
@@ -65,7 +65,7 @@
(wrap (//.function/apply [funcS argsS])))))))
(def: (prepare up down)
- (-> Arity Arity (loop.Transform Synthesis))
+ (-> Arity Arity (Transform Synthesis))
(.function (_ body)
(if (nested? up)
(#.Some body)
diff --git a/stdlib/source/lux/language/compiler/synthesis/loop.lux b/stdlib/source/lux/language/compiler/synthesis/loop.lux
index ea6589f21..033d5e70e 100644
--- a/stdlib/source/lux/language/compiler/synthesis/loop.lux
+++ b/stdlib/source/lux/language/compiler/synthesis/loop.lux
@@ -1,20 +1,21 @@
(.module:
[lux (#- loop)
[control
- [monad (#+ do)]
+ ["." monad (#+ do)]
["p" parser]]
[data
- [maybe ("maybe/" Monad<Maybe>)]
- [collection [list ("list/" Functor<List>)]]]
+ ["." maybe ("maybe/" Monad<Maybe>)]
+ [collection
+ ["." list ("list/" Functor<List>)]]]
[macro
- [code]
- [syntax]]]
- [// (#+ Path Abstraction Synthesis)
+ ["." code]
+ ["." syntax]]]
+ ["." // (#+ Path Abstraction Synthesis)
[///
- [reference (#+ Register Variable)]
+ ["." reference (#+ Register Variable)]
[compiler
- [analysis (#+ Environment)]
- [extension]]]])
+ ["." analysis (#+ Environment)]
+ ["." extension]]]])
(type: #export (Transform a)
(-> a (Maybe a)))
diff --git a/stdlib/source/lux/language/compiler/translation.lux b/stdlib/source/lux/language/compiler/translation.lux
index b822d3cf8..462c61ec5 100644
--- a/stdlib/source/lux/language/compiler/translation.lux
+++ b/stdlib/source/lux/language/compiler/translation.lux
@@ -4,18 +4,18 @@
["ex" exception (#+ exception:)]
[monad (#+ do)]]
[data
- [product]
- [error (#+ Error)]
+ ["." product]
+ ["." error (#+ Error)]
[ident ("ident/" Equivalence<Ident> Codec<Text,Ident>)]
["." text
format]
[collection
- [row (#+ Row)]
+ ["." row (#+ Row)]
["dict" dictionary (#+ Dictionary)]]]
- [function]
- [world [file (#+ File)]]]
+ [world
+ [file (#+ File)]]]
["." //
- [extension]]
+ ["." extension]]
[//synthesis (#+ Synthesis)])
(do-template [<name>]
@@ -65,6 +65,12 @@
(type: #export (Compiler anchor expression statement)
(extension.Compiler (State anchor expression statement) Synthesis expression))
+(type: #export (Handler anchor expression statement)
+ (extension.Handler (State anchor expression statement) Synthesis expression))
+
+(type: #export (Bundle anchor expression statement)
+ (extension.Bundle (State anchor expression statement) Synthesis expression))
+
(def: #export (init host)
(All [anchor expression statement]
(-> (Host expression statement)
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux
index f7b1adb7a..d2e9d8d98 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux
@@ -4,38 +4,40 @@
[monad (#+ do)]
["ex" exception (#+ exception:)]]
[data
- [number]
+ ["." number]
["." text
format]
[collection
[list ("list/" Functor<List> Fold<List>)]
[set (#+ Set)]]]]
- [/////
- [reference (#+ Register)]
- [host ["_" scheme (#+ Expression Computation Var)]]
- [compiler ("operation/" Monad<Operation>)
- [synthesis (#+ Synthesis Path)]]]
- [//runtime (#+ Operation Compiler)]
- [//reference])
+ [//
+ ["." runtime (#+ Operation Compiler)]
+ ["." reference]
+ ["/." /// ("operation/" Monad<Operation>)
+ ["." synthesis (#+ Synthesis Path)]
+ [//
+ [reference (#+ Register)]
+ [host
+ ["_" scheme (#+ Expression Computation Var)]]]]])
(def: #export (let translate [valueS register bodyS])
(-> Compiler [Synthesis Register Synthesis]
(Operation Computation))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[valueO (translate valueS)
bodyO (translate bodyS)]
- (wrap (_.let (list [(//reference.local' register) valueO])
+ (wrap (_.let (list [(reference.local' register) valueO])
bodyO))))
(def: #export (record-get translate valueS pathP)
(-> Compiler Synthesis (List [Nat Bit])
(Operation Expression))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[valueO (translate valueS)]
(wrap (list/fold (function (_ [idx tail?] source)
(.let [method (.if tail?
- //runtime.product//right
- //runtime.product//left)]
+ runtime.product//right
+ runtime.product//left)]
(method source (_.int (:coerce Int idx)))))
valueO
pathP))))
@@ -43,7 +45,7 @@
(def: #export (if translate [testS thenS elseS])
(-> Compiler [Synthesis Synthesis Synthesis]
(Operation Computation))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[testO (translate testS)
thenO (translate thenS)
elseO (translate elseS)]
@@ -97,9 +99,9 @@
(def: (pm-catch handler)
(-> Expression Computation)
(_.lambda [(list $alt_error) #.None]
- (_.if (|> $alt_error (_.eqv?/2 pm-error))
- handler
- (_.raise/1 $alt_error))))
+ (_.if (|> $alt_error (_.eqv?/2 pm-error))
+ handler
+ (_.raise/1 $alt_error))))
(def: (pattern-matching' translate pathP)
(-> Compiler Path (Operation Expression))
@@ -111,7 +113,7 @@
(operation/wrap pop-cursor!)
(#synthesis.Bind register)
- (operation/wrap (_.define (//reference.local' register) [(list) #.None]
+ (operation/wrap (_.define (reference.local' register) [(list) #.None]
cursor-top))
(^template [<tag> <format> <=>]
@@ -125,7 +127,7 @@
(^template [<pm> <flag> <prep>]
(^ (<pm> idx))
- (operation/wrap (_.let (list [@temp (|> idx <prep> .int _.int (//runtime.sum//get cursor-top <flag>))])
+ (operation/wrap (_.let (list [@temp (|> idx <prep> .int _.int (runtime.sum//get cursor-top <flag>))])
(_.if (_.null?/1 @temp)
fail-pm!
(push-cursor! @temp)))))
@@ -135,12 +137,12 @@
(^template [<pm> <getter> <prep>]
(^ (<pm> idx))
(operation/wrap (|> idx <prep> .int _.int (<getter> cursor-top) push-cursor!)))
- ([synthesis.member/left //runtime.product//left (<|)]
- [synthesis.member/right //runtime.product//right inc])
+ ([synthesis.member/left runtime.product//left (<|)]
+ [synthesis.member/right runtime.product//right inc])
(^template [<tag> <computation>]
(^ (<tag> [leftP rightP]))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[leftO (pattern-matching' translate leftP)
rightO (pattern-matching' translate rightP)]
(wrap <computation>)))
@@ -154,11 +156,11 @@
leftO))))])
_
- (compiler.throw unrecognized-path [])))
+ (////.throw unrecognized-path [])))
(def: (pattern-matching translate pathP)
(-> Compiler Path (Operation Computation))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[pattern-matching! (pattern-matching' translate pathP)]
(wrap (_.with-exception-handler
(pm-catch (_.raise/1 (_.string "Invalid expression for pattern-matching.")))
@@ -167,7 +169,7 @@
(def: #export (case translate [valueS pathP])
(-> Compiler [Synthesis Path] (Operation Computation))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[valueO (translate valueS)]
(<| (:: @ map (_.let (list [@cursor (_.list/* (list valueO))]
[@savepoint (_.list/* (list))])))
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux
index 3cbefbf69..7ff3770ae 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux
@@ -1,17 +1,18 @@
(.module:
[lux #*
- [control [monad (#+ do)]]]
+ [control
+ [monad (#+ do)]]]
[//
[runtime (#+ Compiler)]
- [primitive]
- [structure]
- [reference]
- [function]
- [case]
- [loop]
+ ["." primitive]
+ ["." structure]
+ ["." reference]
+ ["." function]
+ ["." case]
+ ["." loop]
["." ///
- [synthesis]
- [extension]]])
+ ["." synthesis]
+ ["." extension]]])
(def: #export (translate synthesis)
Compiler
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/extension.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/extension.jvm.lux
index c7d161f14..a40b4953f 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/extension.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/extension.jvm.lux
@@ -1,36 +1,15 @@
(.module:
[lux #*
- [control
- [monad (#+ do)]
- ["ex" exception (#+ exception:)]]
[data
- [maybe]
- [text
- format]
- [collection ["dict" dictionary (#+ Dictionary)]]]]
- [/////
- [reference (#+ Register Variable)]
- [host ["_" scheme (#+ Computation)]]
- [compiler ("operation/" Monad<Operation>)
- [synthesis (#+ Synthesis)]]]
- [//runtime (#+ Operation Compiler)]
- [/common]
- ## [/host]
- )
+ [collection
+ ["." dictionary]]]]
+ [//
+ [runtime (#+ Bundle)]]
+ [/
+ ["." common]
+ ["." host]])
-(exception: #export (unknown-extension {message Text})
- message)
-
-(def: extensions
- /common.Bundle
- (|> /common.extensions
- ## (dict.merge /host.extensions)
- ))
-
-(def: #export (extension translate name args)
- (-> Compiler Text (List Synthesis)
- (Operation Computation))
- (<| (maybe.default (compiler.throw unknown-extension (%t name)))
- (do maybe.Monad<Maybe>
- [ext (dict.get name extensions)]
- (wrap (ext translate args)))))
+(def: #export bundle
+ Bundle
+ (|> common.bundle
+ (dictionary.merge host.bundle)))
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/extension/common.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/extension/common.jvm.lux
index 40f817aea..289634a4b 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/extension/common.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/extension/common.jvm.lux
@@ -1,34 +1,32 @@
(.module:
[lux #*
[control
- [monad (#+ do)]
+ ["." monad (#+ do)]
["ex" exception (#+ exception:)]]
[data
["e" error]
- [product]
+ ["." product]
["." text
format]
[number (#+ hex)]
[collection
- [list ("list/" Functor<List>)]
+ ["." list ("list/" Functor<List>)]
["dict" dictionary (#+ Dictionary)]]]
- [macro (#+ with-gensyms)
- [code]
+ ["." macro (#+ with-gensyms)
+ ["." code]
["s" syntax (#+ syntax:)]]
- [host]]
- [//////
- [host ["_" scheme (#+ Expression Computation)]]
- ["." compiler
- [synthesis (#+ Synthesis)]]]
- [///runtime (#+ Operation Compiler)])
+ [host (#+ import:)]]
+ [///
+ ["." runtime (#+ Operation Compiler Handler Bundle)]
+ ["//." ///
+ ["." synthesis (#+ Synthesis)]
+ [extension
+ ["." bundle]]
+ [//
+ [host
+ ["_" scheme (#+ Expression Computation)]]]]])
## [Types]
-(type: #export Extension
- (-> Compiler (List Synthesis) (Operation Computation)))
-
-(type: #export Bundle
- (Dictionary Text Extension))
-
(syntax: (Vector {size s.nat} elemT)
(wrap (list (` [(~+ (list.repeat size elemT))]))))
@@ -39,43 +37,25 @@
(type: #export Variadic (-> (List Expression) Computation))
## [Utils]
-(def: #export (install name unnamed)
- (-> Text (-> Text Extension)
- (-> Bundle Bundle))
- (dict.put name (unnamed name)))
-
-(def: #export (prefix prefix bundle)
- (-> Text Bundle Bundle)
- (|> bundle
- dict.entries
- (list/map (function (_ [key val]) [(format prefix " " key) val]))
- (dict.from-list text.Hash<Text>)))
-
-(exception: #export (wrong-arity {extension Text} {expected Nat} {actual Nat})
- (ex.report ["Extension" (%t extension)]
- ["Expected" (|> expected .int %i)]
- ["Actual" (|> actual .int %i)]))
-
(syntax: (arity: {name s.local-symbol} {arity s.nat})
(with-gensyms [g!_ g!extension g!name g!translate g!inputs]
(do @
[g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))]
(wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!extension))
(-> (-> (..Vector (~ (code.nat arity)) Expression) Computation)
- (-> Text ..Extension))
- (function ((~ g!_) (~ g!name))
- (function ((~ g!_) (~ g!translate) (~ g!inputs))
- (case (~ g!inputs)
- (^ (list (~+ g!input+)))
- (do compiler.Monad<Operation>
- [(~+ (|> g!input+
- (list/map (function (_ g!input)
- (list g!input (` ((~ g!translate) (~ g!input))))))
- list.concat))]
- ((~' wrap) ((~ g!extension) [(~+ g!input+)])))
-
- (~' _)
- (compiler.throw wrong-arity [(~ g!name) +1 (list.size (~ g!inputs))])))))))))))
+ Handler)
+ (function ((~ g!_) (~ g!name) (~ g!translate) (~ g!inputs))
+ (case (~ g!inputs)
+ (^ (list (~+ g!input+)))
+ (do /////.Monad<Operation>
+ [(~+ (|> g!input+
+ (list/map (function (_ g!input)
+ (list g!input (` ((~ g!translate) (~ g!input))))))
+ list.concat))]
+ ((~' wrap) ((~ g!extension) [(~+ g!input+)])))
+
+ (~' _)
+ (/////.throw bundle.incorrect-arity [(~ g!name) +1 (list.size (~ g!inputs))]))))))))))
(arity: nullary +0)
(arity: unary +1)
@@ -83,20 +63,20 @@
(arity: trinary +3)
(def: #export (variadic extension)
- (-> Variadic (-> Text Extension))
+ (-> Variadic Handler)
(function (_ extension-name)
(function (_ translate inputsS)
- (do compiler.Monad<Operation>
+ (do /////.Monad<Operation>
[inputsI (monad.map @ translate inputsS)]
(wrap (extension inputsI))))))
-## [Extensions]
+## [Bundle]
## [[Lux]]
-(def: extensions/lux
+(def: bundle::lux
Bundle
- (|> (dict.new text.Hash<Text>)
- (install "is?" (binary (product.uncurry _.eq?/2)))
- (install "try" (unary ///runtime.lux//try))))
+ (|> bundle.empty
+ (bundle.install "is?" (binary (product.uncurry _.eq?/2)))
+ (bundle.install "try" (unary runtime.lux//try))))
## [[Bits]]
(do-template [<name> <op>]
@@ -104,67 +84,67 @@
Binary
(<op> paramO subjectO))]
- [bit//and _.bit-and/2]
- [bit//or _.bit-or/2]
- [bit//xor _.bit-xor/2]
+ [bit::and _.bit-and/2]
+ [bit::or _.bit-or/2]
+ [bit::xor _.bit-xor/2]
)
-(def: (bit//left-shift [subjectO paramO])
+(def: (bit::left-shift [subjectO paramO])
Binary
(_.arithmetic-shift/2 (_.remainder/2 (_.int 64) paramO)
subjectO))
-(def: (bit//arithmetic-right-shift [subjectO paramO])
+(def: (bit::arithmetic-right-shift [subjectO paramO])
Binary
(_.arithmetic-shift/2 (|> paramO (_.remainder/2 (_.int 64)) (_.*/2 (_.int -1)))
subjectO))
-(def: (bit//logical-right-shift [subjectO paramO])
+(def: (bit::logical-right-shift [subjectO paramO])
Binary
- (///runtime.bit//logical-right-shift (_.remainder/2 (_.int 64) paramO) subjectO))
+ (runtime.bit//logical-right-shift (_.remainder/2 (_.int 64) paramO) subjectO))
-(def: extensions/bit
+(def: bundle::bit
Bundle
- (<| (prefix "bit")
- (|> (dict.new text.Hash<Text>)
- (install "and" (binary bit//and))
- (install "or" (binary bit//or))
- (install "xor" (binary bit//xor))
- (install "left-shift" (binary bit//left-shift))
- (install "logical-right-shift" (binary bit//logical-right-shift))
- (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
+ (<| (bundle.prefix "bit")
+ (|> bundle.empty
+ (bundle.install "and" (binary bit::and))
+ (bundle.install "or" (binary bit::or))
+ (bundle.install "xor" (binary bit::xor))
+ (bundle.install "left-shift" (binary bit::left-shift))
+ (bundle.install "logical-right-shift" (binary bit::logical-right-shift))
+ (bundle.install "arithmetic-right-shift" (binary bit::arithmetic-right-shift))
)))
## [[Arrays]]
-(def: (array//new size0)
+(def: (array::new size0)
Unary
(_.make-vector/2 size0 _.nil))
-(def: (array//get [arrayO idxO])
+(def: (array::get [arrayO idxO])
Binary
- (///runtime.array//get arrayO idxO))
+ (runtime.array//get arrayO idxO))
-(def: (array//put [arrayO idxO elemO])
+(def: (array::put [arrayO idxO elemO])
Trinary
- (///runtime.array//put arrayO idxO elemO))
+ (runtime.array//put arrayO idxO elemO))
-(def: (array//remove [arrayO idxO])
+(def: (array::remove [arrayO idxO])
Binary
- (///runtime.array//put arrayO idxO _.nil))
+ (runtime.array//put arrayO idxO _.nil))
-(def: extensions/array
+(def: bundle::array
Bundle
- (<| (prefix "array")
- (|> (dict.new text.Hash<Text>)
- (install "new" (unary array//new))
- (install "get" (binary array//get))
- (install "put" (trinary array//put))
- (install "remove" (binary array//remove))
- (install "size" (unary _.vector-length/1))
+ (<| (bundle.prefix "array")
+ (|> bundle.empty
+ (bundle.install "new" (unary array::new))
+ (bundle.install "get" (binary array::get))
+ (bundle.install "put" (trinary array::put))
+ (bundle.install "remove" (binary array::remove))
+ (bundle.install "size" (unary _.vector-length/1))
)))
## [[Numbers]]
-(host.import: java/lang/Double
+(import: java/lang/Double
(#static MIN_VALUE Double)
(#static MAX_VALUE Double))
@@ -173,9 +153,9 @@
Nullary
(<encode> <const>))]
- [frac//smallest Double::MIN_VALUE _.float]
- [frac//min (f/* -1.0 Double::MAX_VALUE) _.float]
- [frac//max Double::MAX_VALUE _.float]
+ [frac::smallest Double::MIN_VALUE _.float]
+ [frac::min (f/* -1.0 Double::MAX_VALUE) _.float]
+ [frac::max Double::MAX_VALUE _.float]
)
(do-template [<name> <op>]
@@ -183,11 +163,11 @@
Binary
(|> subjectO (<op> paramO)))]
- [int//+ _.+/2]
- [int//- _.-/2]
- [int//* _.*/2]
- [int/// _.quotient/2]
- [int//% _.remainder/2]
+ [int::+ _.+/2]
+ [int::- _.-/2]
+ [int::* _.*/2]
+ [int::/ _.quotient/2]
+ [int::% _.remainder/2]
)
(do-template [<name> <op>]
@@ -195,16 +175,16 @@
Binary
(<op> paramO subjectO))]
- [frac//+ _.+/2]
- [frac//- _.-/2]
- [frac//* _.*/2]
- [frac/// _.//2]
- [frac//% _.mod/2]
- [frac//= _.=/2]
- [frac//< _.</2]
+ [frac::+ _.+/2]
+ [frac::- _.-/2]
+ [frac::* _.*/2]
+ [frac::/ _.//2]
+ [frac::% _.mod/2]
+ [frac::= _.=/2]
+ [frac::< _.</2]
- [text//= _.string=?/2]
- [text//< _.string<?/2]
+ [text::= _.string=?/2]
+ [text::< _.string<?/2]
)
(do-template [<name> <cmp>]
@@ -212,66 +192,66 @@
Binary
(<cmp> paramO subjectO))]
- [int//= _.=/2]
- [int//< _.</2]
+ [int::= _.=/2]
+ [int::< _.</2]
)
-(def: int//char (|>> _.integer->char/1 _.string/1))
+(def: int::char (|>> _.integer->char/1 _.string/1))
-(def: extensions/int
+(def: bundle::int
Bundle
- (<| (prefix "int")
- (|> (dict.new text.Hash<Text>)
- (install "+" (binary int//+))
- (install "-" (binary int//-))
- (install "*" (binary int//*))
- (install "/" (binary int///))
- (install "%" (binary int//%))
- (install "=" (binary int//=))
- (install "<" (binary int//<))
- (install "to-frac" (unary (|>> (_.//2 (_.float 1.0)))))
- (install "char" (unary int//char)))))
-
-(def: extensions/frac
+ (<| (bundle.prefix "int")
+ (|> bundle.empty
+ (bundle.install "+" (binary int::+))
+ (bundle.install "-" (binary int::-))
+ (bundle.install "*" (binary int::*))
+ (bundle.install "/" (binary int::/))
+ (bundle.install "%" (binary int::%))
+ (bundle.install "=" (binary int::=))
+ (bundle.install "<" (binary int::<))
+ (bundle.install "to-frac" (unary (|>> (_.//2 (_.float 1.0)))))
+ (bundle.install "char" (unary int::char)))))
+
+(def: bundle::frac
Bundle
- (<| (prefix "frac")
- (|> (dict.new text.Hash<Text>)
- (install "+" (binary frac//+))
- (install "-" (binary frac//-))
- (install "*" (binary frac//*))
- (install "/" (binary frac///))
- (install "%" (binary frac//%))
- (install "=" (binary frac//=))
- (install "<" (binary frac//<))
- (install "smallest" (nullary frac//smallest))
- (install "min" (nullary frac//min))
- (install "max" (nullary frac//max))
- (install "to-int" (unary _.exact/1))
- (install "encode" (unary _.number->string/1))
- (install "decode" (unary ///runtime.frac//decode)))))
+ (<| (bundle.prefix "frac")
+ (|> bundle.empty
+ (bundle.install "+" (binary frac::+))
+ (bundle.install "-" (binary frac::-))
+ (bundle.install "*" (binary frac::*))
+ (bundle.install "/" (binary frac::/))
+ (bundle.install "%" (binary frac::%))
+ (bundle.install "=" (binary frac::=))
+ (bundle.install "<" (binary frac::<))
+ (bundle.install "smallest" (nullary frac::smallest))
+ (bundle.install "min" (nullary frac::min))
+ (bundle.install "max" (nullary frac::max))
+ (bundle.install "to-int" (unary _.exact/1))
+ (bundle.install "encode" (unary _.number->string/1))
+ (bundle.install "decode" (unary runtime.frac//decode)))))
## [[Text]]
-(def: (text//char [subjectO paramO])
+(def: (text::char [subjectO paramO])
Binary
(_.string/1 (_.string-ref/2 subjectO paramO)))
-(def: (text//clip [subjectO startO endO])
+(def: (text::clip [subjectO startO endO])
Trinary
(_.substring/3 subjectO startO endO))
-(def: extensions/text
+(def: bundle::text
Bundle
- (<| (prefix "text")
- (|> (dict.new text.Hash<Text>)
- (install "=" (binary text//=))
- (install "<" (binary text//<))
- (install "concat" (binary (product.uncurry _.string-append/2)))
- (install "size" (unary _.string-length/1))
- (install "char" (binary text//char))
- (install "clip" (trinary text//clip)))))
+ (<| (bundle.prefix "text")
+ (|> bundle.empty
+ (bundle.install "=" (binary text::=))
+ (bundle.install "<" (binary text::<))
+ (bundle.install "concat" (binary (product.uncurry _.string-append/2)))
+ (bundle.install "size" (unary _.string-length/1))
+ (bundle.install "char" (binary text::char))
+ (bundle.install "clip" (trinary text::clip)))))
## [[Math]]
-(def: (math//pow [subject param])
+(def: (math::pow [subject param])
Binary
(_.expt/2 param subject))
@@ -279,25 +259,25 @@
(-> Text Unary)
(|>> _.global _.apply/1))
-(def: extensions/math
+(def: bundle::math
Bundle
- (<| (prefix "math")
- (|> (dict.new text.Hash<Text>)
- (install "cos" (unary (math-func "cos")))
- (install "sin" (unary (math-func "sin")))
- (install "tan" (unary (math-func "tan")))
- (install "acos" (unary (math-func "acos")))
- (install "asin" (unary (math-func "asin")))
- (install "atan" (unary (math-func "atan")))
- (install "exp" (unary (math-func "exp")))
- (install "log" (unary (math-func "log")))
- (install "ceil" (unary (math-func "ceiling")))
- (install "floor" (unary (math-func "floor")))
- (install "pow" (binary math//pow))
+ (<| (bundle.prefix "math")
+ (|> bundle.empty
+ (bundle.install "cos" (unary (math-func "cos")))
+ (bundle.install "sin" (unary (math-func "sin")))
+ (bundle.install "tan" (unary (math-func "tan")))
+ (bundle.install "acos" (unary (math-func "acos")))
+ (bundle.install "asin" (unary (math-func "asin")))
+ (bundle.install "atan" (unary (math-func "atan")))
+ (bundle.install "exp" (unary (math-func "exp")))
+ (bundle.install "log" (unary (math-func "log")))
+ (bundle.install "ceil" (unary (math-func "ceiling")))
+ (bundle.install "floor" (unary (math-func "floor")))
+ (bundle.install "pow" (binary math::pow))
)))
## [[IO]]
-(def: (io//log input)
+(def: (io::log input)
Unary
(_.begin (list (_.display/1 input)
_.newline/0)))
@@ -306,75 +286,75 @@
(-> Expression Computation)
(_.begin (list code (_.string synthesis.unit))))
-(def: extensions/io
+(def: bundle::io
Bundle
- (<| (prefix "io")
- (|> (dict.new text.Hash<Text>)
- (install "log" (unary (|>> io//log ..void)))
- (install "error" (unary _.raise/1))
- (install "exit" (unary _.exit/1))
- (install "current-time" (nullary (function (_ _) (///runtime.io//current-time (_.string synthesis.unit))))))))
+ (<| (bundle.prefix "io")
+ (|> bundle.empty
+ (bundle.install "log" (unary (|>> io::log ..void)))
+ (bundle.install "error" (unary _.raise/1))
+ (bundle.install "exit" (unary _.exit/1))
+ (bundle.install "current-time" (nullary (function (_ _) (runtime.io//current-time (_.string synthesis.unit))))))))
## [[Atoms]]
-(def: atom//new
+(def: atom::new
Unary
(|>> (list) _.vector/*))
-(def: (atom//read atom)
+(def: (atom::read atom)
Unary
(_.vector-ref/2 atom (_.int 0)))
-(def: (atom//compare-and-swap [atomO oldO newO])
+(def: (atom::compare-and-swap [atomO oldO newO])
Trinary
- (///runtime.atom//compare-and-swap atomO oldO newO))
+ (runtime.atom//compare-and-swap atomO oldO newO))
-(def: extensions/atom
+(def: bundle::atom
Bundle
- (<| (prefix "atom")
- (|> (dict.new text.Hash<Text>)
- (install "new" (unary atom//new))
- (install "read" (unary atom//read))
- (install "compare-and-swap" (trinary atom//compare-and-swap)))))
+ (<| (bundle.prefix "atom")
+ (|> bundle.empty
+ (bundle.install "new" (unary atom::new))
+ (bundle.install "read" (unary atom::read))
+ (bundle.install "compare-and-swap" (trinary atom::compare-and-swap)))))
## [[Box]]
-(def: (box//write [valueO boxO])
+(def: (box::write [valueO boxO])
Binary
- (///runtime.box//write valueO boxO))
+ (runtime.box//write valueO boxO))
-(def: extensions/box
+(def: bundle::box
Bundle
- (<| (prefix "box")
- (|> (dict.new text.Hash<Text>)
- (install "new" (unary atom//new))
- (install "read" (unary atom//read))
- (install "write" (binary box//write)))))
+ (<| (bundle.prefix "box")
+ (|> bundle.empty
+ (bundle.install "new" (unary atom::new))
+ (bundle.install "read" (unary atom::read))
+ (bundle.install "write" (binary box::write)))))
## [[Processes]]
-(def: (process//parallelism-level [])
+(def: (process::parallelism-level [])
Nullary
(_.int 1))
-(def: extensions/process
+(def: bundle::process
Bundle
- (<| (prefix "process")
- (|> (dict.new text.Hash<Text>)
- (install "parallelism-level" (nullary process//parallelism-level))
- (install "schedule" (binary (product.uncurry ///runtime.process//schedule)))
+ (<| (bundle.prefix "process")
+ (|> bundle.empty
+ (bundle.install "parallelism-level" (nullary process::parallelism-level))
+ (bundle.install "schedule" (binary (product.uncurry runtime.process//schedule)))
)))
## [Bundles]
-(def: #export extensions
+(def: #export bundle
Bundle
- (<| (prefix "lux")
- (|> extensions/lux
- (dict.merge extensions/bit)
- (dict.merge extensions/int)
- (dict.merge extensions/frac)
- (dict.merge extensions/text)
- (dict.merge extensions/array)
- (dict.merge extensions/math)
- (dict.merge extensions/io)
- (dict.merge extensions/atom)
- (dict.merge extensions/box)
- (dict.merge extensions/process)
+ (<| (bundle.prefix "lux")
+ (|> bundle::lux
+ (dict.merge bundle::bit)
+ (dict.merge bundle::int)
+ (dict.merge bundle::frac)
+ (dict.merge bundle::text)
+ (dict.merge bundle::array)
+ (dict.merge bundle::math)
+ (dict.merge bundle::io)
+ (dict.merge bundle::atom)
+ (dict.merge bundle::box)
+ (dict.merge bundle::process)
)))
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/extension/host.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/extension/host.jvm.lux
new file mode 100644
index 000000000..b8b2b7612
--- /dev/null
+++ b/stdlib/source/lux/language/compiler/translation/scheme/extension/host.jvm.lux
@@ -0,0 +1,11 @@
+(.module:
+ [lux #*]
+ [///
+ [runtime (#+ Bundle)]
+ [///
+ [extension
+ ["." bundle]]]])
+
+(def: #export bundle
+ Bundle
+ bundle.empty)
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/function.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/function.jvm.lux
index d5dc4541f..01531069e 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/function.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/function.jvm.lux
@@ -1,28 +1,30 @@
(.module:
[lux (#- function)
[control
- [monad (#+ do)]
+ ["." monad (#+ do)]
pipe]
[data
- [product]
+ ["." product]
[text
format]
- [collection [list ("list/" Functor<List>)]]]]
- [/////
- [reference (#+ Register Variable)]
- [name]
- [host ["_" scheme (#+ Expression Computation Var)]]
- [compiler ("operation/" Monad<Operation>)
- [analysis (#+ Variant Tuple Environment Arity Abstraction Application Analysis)]
- [synthesis (#+ Synthesis)]]]
- [///]
- [//runtime (#+ Operation Compiler)]
- [//primitive]
- [//reference])
+ [collection
+ ["." list ("list/" Functor<List>)]]]]
+ [//
+ ["." runtime (#+ Operation Compiler)]
+ ["." reference]
+ ["/." //
+ ["//." // ("operation/" Monad<Operation>)
+ [analysis (#+ Variant Tuple Environment Arity Abstraction Application Analysis)]
+ [synthesis (#+ Synthesis)]
+ [//
+ [reference (#+ Register Variable)]
+ ["." name]
+ [host
+ ["_" scheme (#+ Expression Computation Var)]]]]]])
(def: #export (apply translate [functionS argsS+])
(-> Compiler (Application Synthesis) (Operation Computation))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[functionO (translate functionS)
argsO+ (monad.map @ translate argsS+)]
(wrap (_.apply/* functionO argsO+))))
@@ -38,7 +40,7 @@
_
(_.letrec (list [@closure
(_.lambda [(|> (list.enumerate inits)
- (list/map (|>> product.left //reference.foreign')))
+ (list/map (|>> product.left reference.foreign')))
#.None]
function-definition)])
(_.apply/* @closure inits))))))
@@ -47,17 +49,17 @@
(def: @missing (_.var "missing"))
(def: input
- (|>> inc //reference.local'))
+ (|>> inc reference.local'))
(def: #export (function translate [environment arity bodyS])
(-> Compiler (Abstraction Synthesis) (Operation Computation))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[[function-name bodyO] (///.with-context
(do @
[function-name ///.context]
(///.with-anchor (_.var function-name)
(translate bodyS))))
- closureO+ (monad.map @ //reference.variable environment)
+ closureO+ (monad.map @ reference.variable environment)
#let [arityO (|> arity .int _.int)
@num-args (_.var "num_args")
@function (_.var function-name)
@@ -67,17 +69,17 @@
(_.letrec (list [@function (_.lambda [(list) (#.Some @curried)]
(_.let (list [@num-args (_.length/1 @curried)])
(<| (_.if (|> @num-args (_.=/2 arityO))
- (<| (_.let (list [(//reference.local' +0) @function]))
+ (<| (_.let (list [(reference.local' +0) @function]))
(_.let-values (list [[(|> (list.n/range +0 (dec arity))
(list/map ..input))
#.None]
(_.apply/2 (_.global "apply") (_.global "values") @curried)]))
bodyO))
(_.if (|> @num-args (_.>/2 arityO))
- (let [arity-args (//runtime.slice (_.int 0) arityO @curried)
- output-func-args (//runtime.slice arityO
- (|> @num-args (_.-/2 arityO))
- @curried)]
+ (let [arity-args (runtime.slice (_.int 0) arityO @curried)
+ output-func-args (runtime.slice arityO
+ (|> @num-args (_.-/2 arityO))
+ @curried)]
(|> @function
(apply-poly arity-args)
(apply-poly output-func-args))))
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/loop.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/loop.jvm.lux
index 4e8d90341..9863cf4ed 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/loop.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/loop.jvm.lux
@@ -1,40 +1,41 @@
(.module:
[lux (#- Scope)
[control
- [monad (#+ do)]]
+ ["." monad (#+ do)]]
[data
- [product]
+ ["." product]
["." text
format]
[collection
- [list ("list/" Functor<List>)]]]
- [macro]]
- [/////
- [host ["_" scheme (#+ Computation Var)]]
- ["." compiler
- [synthesis (#+ Scope Synthesis)]]]
- [///]
- [//runtime (#+ Operation Compiler)]
- [//reference])
+ ["." list ("list/" Functor<List>)]]]]
+ [//
+ [runtime (#+ Operation Compiler)]
+ ["." reference]
+ ["/." //
+ ["//." //
+ [synthesis (#+ Scope Synthesis)]
+ [//
+ [host
+ ["_" scheme (#+ Computation Var)]]]]]])
(def: @scope (_.var "scope"))
(def: #export (scope translate [start initsS+ bodyS])
(-> Compiler (Scope Synthesis) (Operation Computation))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[initsO+ (monad.map @ translate initsS+)
bodyO (///.with-anchor @scope
(translate bodyS))]
(wrap (_.letrec (list [@scope (_.lambda [(|> initsS+
list.enumerate
- (list/map (|>> product.left (n/+ start) //reference.local')))
+ (list/map (|>> product.left (n/+ start) reference.local')))
#.None]
bodyO)])
(_.apply/* @scope initsO+)))))
(def: #export (recur translate argsS+)
(-> Compiler (List Synthesis) (Operation Computation))
- (do compiler.Monad<Operation>
+ (do ////.Monad<Operation>
[@scope ///.anchor
argsO+ (monad.map @ translate argsS+)]
(wrap (_.apply/* @scope argsO+))))
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux
index 6ff146393..9c64aad05 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux
@@ -2,8 +2,9 @@
[lux (#- i64)]
[/// (#+ State)]
[/////
- [compiler ("operation/" Monad<Operation>)]
- [host ["_" scheme (#+ Expression)]]]
+ [host
+ ["_" scheme (#+ Expression)]]
+ [compiler ("operation/" Monad<Operation>)]]
[//runtime (#+ Operation)])
(def: #export bit
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/reference.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/reference.jvm.lux
index f9eba9bd7..6828f6d14 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/reference.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/reference.jvm.lux
@@ -5,15 +5,15 @@
[data
[text
format]]]
- [/////
- [reference (#+ Register Variable Reference)]
- [name]
- [host ["_" scheme (#+ Expression Var)]]
- [compiler ("operation/" Monad<Operation>)
+ [//
+ [runtime (#+ Operation)]
+ [/// ("operation/" Monad<Operation>)
[analysis (#+ Variant Tuple)]
- [synthesis (#+ Synthesis)]]]
- [//runtime (#+ Operation)]
- [//primitive])
+ [synthesis (#+ Synthesis)]
+ [//
+ ["." reference (#+ Register Variable Reference)]
+ ["." name]
+ [host ["_" scheme (#+ Expression Var)]]]]])
(do-template [<name> <prefix>]
[(def: #export <name>
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux
index 961a682f2..a2f2250ef 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux
@@ -7,24 +7,29 @@
[number (#+ hex)]
[text
format]
- [collection [list ("list/" Monad<List>)]]]
- [function]
+ [collection
+ ["." list ("list/" Monad<List>)]]]
+ ["." function]
[macro
- [code]
+ ["." code]
["s" syntax (#+ syntax:)]]]
["." ///
["//." //
[analysis (#+ Variant)]
- [synthesis]
+ ["." synthesis]
[//
- [name]
+ ["." name]
[host ["_" scheme (#+ Expression Computation Var)]]]]])
-(type: #export Operation
- (///.Operation Var Expression Expression))
+(do-template [<name> <base>]
+ [(type: #export <name>
+ (<base> Var Expression Expression))]
-(type: #export Compiler
- (///.Compiler Var Expression Expression))
+ [Operation ///.Operation]
+ [Compiler ///.Compiler]
+ [Handler ///.Handler]
+ [Bundle ///.Bundle]
+ )
(def: prefix Text "LuxRuntime")
diff --git a/stdlib/source/lux/language/compiler/translation/scheme/structure.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/structure.jvm.lux
index 4637d1a25..1f7f2cf27 100644
--- a/stdlib/source/lux/language/compiler/translation/scheme/structure.jvm.lux
+++ b/stdlib/source/lux/language/compiler/translation/scheme/structure.jvm.lux
@@ -1,31 +1,33 @@
(.module:
[lux #*
- [control [monad (#+ do)]]]
- [/////
- [host
- ["_" scheme (#+ Expression)]]
- ["." compiler
+ [control
+ ["." monad (#+ do)]]]
+ [//
+ ["." runtime (#+ Operation Compiler)]
+ ["." primitive]
+ ["." ///
[analysis (#+ Variant Tuple)]
- [synthesis (#+ Synthesis)]]]
- [//runtime (#+ Operation Compiler)]
- [//primitive])
+ ["." synthesis (#+ Synthesis)]
+ [//
+ [host
+ ["_" scheme (#+ Expression)]]]]])
(def: #export (tuple translate elemsS+)
(-> Compiler (Tuple Synthesis) (Operation Expression))
(case elemsS+
#.Nil
- (//primitive.text synthesis.unit)
+ (primitive.text synthesis.unit)
(#.Cons singletonS #.Nil)
(translate singletonS)
_
- (do compiler.Monad<Operation>
+ (do ///.Monad<Operation>
[elemsT+ (monad.map @ translate elemsS+)]
(wrap (_.vector/* elemsT+)))))
(def: #export (variant translate [lefts right? valueS])
(-> Compiler (Variant Synthesis) (Operation Expression))
- (do compiler.Monad<Operation>
+ (do ///.Monad<Operation>
[valueT (translate valueS)]
- (wrap (//runtime.variant [lefts right? valueT]))))
+ (wrap (runtime.variant [lefts right? valueT]))))
diff --git a/stdlib/source/lux/language/host/scheme.lux b/stdlib/source/lux/language/host/scheme.lux
index e312e769b..bdcd64990 100644
--- a/stdlib/source/lux/language/host/scheme.lux
+++ b/stdlib/source/lux/language/host/scheme.lux
@@ -3,12 +3,13 @@
[control
pipe]
[data
- [number]
+ ["." number]
["." text
format]
[collection
- [list ("list/" Functor<List> Fold<List>)]]]
- [type abstract]])
+ ["." list ("list/" Functor<List> Fold<List>)]]]
+ [type
+ abstract]])
(abstract: Global' {} Any)
(abstract: Var' {} Any)
diff --git a/stdlib/source/lux/language/name.lux b/stdlib/source/lux/language/name.lux
index 0b3dc7bdd..f6489b89c 100644
--- a/stdlib/source/lux/language/name.lux
+++ b/stdlib/source/lux/language/name.lux
@@ -1,7 +1,7 @@
(.module:
[lux #*
[data
- [maybe]
+ ["." maybe]
["." text
format]]])
diff --git a/stdlib/source/lux/language/syntax.lux b/stdlib/source/lux/language/syntax.lux
index 18fd61c8a..ebe2c3511 100644
--- a/stdlib/source/lux/language/syntax.lux
+++ b/stdlib/source/lux/language/syntax.lux
@@ -32,14 +32,14 @@
["ex" exception (#+ exception:)]]
[data
["e" error]
- [number]
- [product]
- [maybe]
+ ["." number]
+ ["." product]
+ ["." maybe]
["." text
["l" lexer]
format]
[collection
- [row (#+ Row)]
+ ["." row (#+ Row)]
["dict" dictionary (#+ Dictionary)]]]])
(type: #export Aliases (Dictionary Text Text))
diff --git a/stdlib/source/lux/language/type.lux b/stdlib/source/lux/language/type.lux
index 11b1e1223..a3ae7aa91 100644
--- a/stdlib/source/lux/language/type.lux
+++ b/stdlib/source/lux/language/type.lux
@@ -5,15 +5,15 @@
[monad (#+ do Monad)]
["p" parser]]
[data
- [text ("text/" Monoid<Text> Equivalence<Text>)]
+ ["." text ("text/" Monoid<Text> Equivalence<Text>)]
[ident ("ident/" Equivalence<Ident> Codec<Text,Ident>)]
[number ("nat/" Codec<Text,Nat>)]
- [maybe]
- [collection [list ("list/" Functor<List> Monoid<List> Fold<List>)]]]
+ ["." maybe]
+ [collection
+ ["." list ("list/" Functor<List> Monoid<List> Fold<List>)]]]
["." macro
- [code]
- ["s" syntax (#+ Syntax syntax:)]]
- ])
+ ["." code]
+ ["s" syntax (#+ Syntax syntax:)]]])
## [Utils]
(def: (beta-reduce env type)
diff --git a/stdlib/source/lux/language/type/check.lux b/stdlib/source/lux/language/type/check.lux
index abd6bda5e..990a0261c 100644
--- a/stdlib/source/lux/language/type/check.lux
+++ b/stdlib/source/lux/language/type/check.lux
@@ -3,18 +3,19 @@
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
- [monad (#+ do Monad)]
+ ["." monad (#+ do Monad)]
["ex" exception (#+ exception:)]]
[data
- [maybe]
- [product]
- [number ("nat/" Codec<Text,Nat>)]
+ ["." maybe]
+ ["." product]
+ ["e" error]
+ ["." number ("nat/" Codec<Text,Nat>)]
[text ("text/" Monoid<Text> Equivalence<Text>)]
[collection
- [list]
- [set (#+ Set)]]
- ["e" error]]
- [language [type ("type/" Equivalence<Type>)]]
+ ["." list]
+ ["." set (#+ Set)]]]
+ [language
+ ["." type ("type/" Equivalence<Type>)]]
])
(exception: #export (unknown-type-var {id Nat})
diff --git a/stdlib/source/lux/macro.lux b/stdlib/source/lux/macro.lux
index fea0fa783..bbe93cbd1 100644
--- a/stdlib/source/lux/macro.lux
+++ b/stdlib/source/lux/macro.lux
@@ -3,16 +3,18 @@
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
- [monad (#+ do Monad)]]
+ ["." monad (#+ do Monad)]]
[data
- [number ("nat/" Codec<Text,Nat>)]
- [product]
+ ["." product]
[ident ("ident/" Codec<Text,Ident> Equivalence<Ident>)]
- [maybe]
+ ["." maybe]
["e" error]
- [text ("text/" Monoid<Text> Equivalence<Text>)]
- [collection [list ("list/" Monoid<List> Monad<List>)]]]]
- [/ [code]])
+ ["." number ("nat/" Codec<Text,Nat>)]
+ ["." text ("text/" Monoid<Text> Equivalence<Text>)]
+ [collection
+ ["." list ("list/" Monoid<List> Monad<List>)]]]]
+ [/
+ ["." code]])
## (type: (Meta a)
## (-> Lux (e.Error [Lux a])))
diff --git a/stdlib/source/lux/macro/code.lux b/stdlib/source/lux/macro/code.lux
index a599bbae8..a53804630 100644
--- a/stdlib/source/lux/macro/code.lux
+++ b/stdlib/source/lux/macro/code.lux
@@ -1,14 +1,14 @@
(.module:
[lux (#- nat int rev)
[control
- [equivalence (#+ Equivalence)]]
+ ["." equivalence (#+ Equivalence)]]
[data
bit
number
- [text (#+ Equivalence<Text>) ("text/" Monoid<Text>)]
ident
- [collection [list ("list/" Functor<List> Fold<List>)]]
- ]])
+ ["." text (#+ Equivalence<Text>) ("text/" Monoid<Text>)]
+ [collection
+ ["." list ("list/" Functor<List> Fold<List>)]]]])
## [Types]
## (type: (Code' w)
diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux
index cd37a8f4b..b40d1a3ff 100644
--- a/stdlib/source/lux/macro/poly.lux
+++ b/stdlib/source/lux/macro/poly.lux
@@ -1,24 +1,24 @@
(.module:
[lux (#- function)
[control
- [monad (#+ do Monad)]
+ ["." monad (#+ do Monad)]
[equivalence]
["p" parser]
["ex" exception (#+ exception:)]]
- [function]
+ ["." function]
[data
- [text ("text/" Monoid<Text>)]
- [collection
- [list ("list/" Fold<List> Monad<List> Monoid<List>)]
- ["dict" dictionary (#+ Dictionary)]]
- [number ("nat/" Codec<Text,Nat>)]
- [product]
- [bit]
- [maybe]
+ ["." product]
+ ["." bit]
+ ["." maybe]
[ident ("ident/" Equivalence<Ident> Codec<Text,Ident>)]
- ["e" error]]
- [macro (#+ with-gensyms)
- [code]
+ ["e" error]
+ ["." number ("nat/" Codec<Text,Nat>)]
+ ["." text ("text/" Monoid<Text>)]
+ [collection
+ ["." list ("list/" Fold<List> Monad<List> Monoid<List>)]
+ ["dict" dictionary (#+ Dictionary)]]]
+ ["." macro (#+ with-gensyms)
+ ["." code]
["s" syntax (#+ syntax: Syntax)]
[syntax
["cs" common]
@@ -26,8 +26,8 @@
["csr" reader]
["csw" writer]]]]
[language
- [type ("type/" Equivalence<Type>)
- [check]]]
+ ["." type ("type/" Equivalence<Type>)
+ ["." check]]]
])
(type: #export Env (Dictionary Nat [Type Code]))
diff --git a/stdlib/source/lux/macro/poly/equivalence.lux b/stdlib/source/lux/macro/poly/equivalence.lux
index c651a5b59..126a2f607 100644
--- a/stdlib/source/lux/macro/poly/equivalence.lux
+++ b/stdlib/source/lux/macro/poly/equivalence.lux
@@ -5,32 +5,34 @@
["eq" equivalence]
["p" parser]]
[data
- [text ("text/" Monoid<Text>)
+ ["." product]
+ ["." bit]
+ ["." maybe]
+ ["." number ("nat/" Codec<Text,Nat>)]
+ ["." text ("text/" Monoid<Text>)
format]
[collection
- [list ("list/" Monad<List>)]
- [row]
- [array]
- [queue]
- [set]
+ ["." list ("list/" Monad<List>)]
+ ["." row]
+ ["." array]
+ ["." queue]
+ ["." set]
["dict" dictionary (#+ Dictionary)]
- [tree [rose]]]
- [number ("nat/" Codec<Text,Nat>)]
- [product]
- [bit]
- [maybe]]
+ [tree
+ ["." rose]]]]
[time
["du" duration]
["da" date]
["i" instant]]
["." macro
- [code]
+ ["." code]
[syntax (#+ syntax: Syntax)
- [common]]
- [poly (#+ poly:)]]
- [type [unit]]
- [language [type]]
- ])
+ ["." common]]
+ ["." poly (#+ poly:)]]
+ [type
+ ["." unit]]
+ [language
+ ["." type]]])
## [Derivers]
(poly: #export Equivalence<?>
diff --git a/stdlib/source/lux/macro/poly/functor.lux b/stdlib/source/lux/macro/poly/functor.lux
index 5e509935d..824a6ce19 100644
--- a/stdlib/source/lux/macro/poly/functor.lux
+++ b/stdlib/source/lux/macro/poly/functor.lux
@@ -2,20 +2,21 @@
[lux #*
[control
[monad (#+ do Monad)]
- [functor]
+ ["." functor]
["p" parser]]
[data
+ ["." product]
["." text
format]
- [collection [list ("list/" Monad<List> Monoid<List>)]]
- [product]]
+ [collection
+ ["." list ("list/" Monad<List> Monoid<List>)]]]
["." macro
- [code]
+ ["." code]
[syntax (#+ syntax: Syntax)
- [common]]
- [poly (#+ poly:)]]
- [language [type]]
- ])
+ ["." common]]
+ ["." poly (#+ poly:)]]
+ [language
+ ["." type]]])
(poly: #export Functor<?>
(do @
diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux
index 1f5b4aab6..ace84fcb3 100644
--- a/stdlib/source/lux/macro/poly/json.lux
+++ b/stdlib/source/lux/macro/poly/json.lux
@@ -6,20 +6,21 @@
codec
["p" parser]]
[data
- [bit]
+ ["." bit]
maybe
["e" error]
- [sum]
- [product]
+ ["." sum]
+ ["." product]
[number ("frac/" Codec<Text,Frac>) ("nat/" Codec<Text,Nat>)
- [i64]]
- [text ("text/" Equivalence<Text>)
+ ["." i64]]
+ ["." text ("text/" Equivalence<Text>)
["l" lexer]
format]
- [format ["//" json (#+ JSON)]]
+ [format
+ ["//" json (#+ JSON)]]
[collection
- [list ("list/" Fold<List> Monad<List>)]
- [row (#+ Row row) ("row/" Monad<Row>)]
+ ["." list ("list/" Fold<List> Monad<List>)]
+ ["." row (#+ Row row) ("row/" Monad<Row>)]
["d" dictionary]]]
[time
## ["i" instant]
@@ -27,10 +28,12 @@
["da" date]]
[macro (#+ with-gensyms)
["s" syntax (#+ syntax:)]
- [code]
- [poly (#+ poly:)]]
- [type [unit]]
- [language [type]]])
+ ["." code]
+ ["." poly (#+ poly:)]]
+ [type
+ ["." unit]]
+ [language
+ ["." type]]])
(def: tag
(-> Nat Frac)
diff --git a/stdlib/source/lux/macro/syntax.lux b/stdlib/source/lux/macro/syntax.lux
index a22e8a121..1b9229309 100644
--- a/stdlib/source/lux/macro/syntax.lux
+++ b/stdlib/source/lux/macro/syntax.lux
@@ -1,19 +1,20 @@
(.module:
[lux (#- nat int rev)
- [macro (#+ with-gensyms)]
[control
- [monad (#+ do Monad)]
+ ["." monad (#+ do Monad)]
[equivalence (#+ Equivalence)]
["p" parser]]
[data
- [bit]
- [number]
- [text ("text/" Monoid<Text>)]
- [ident]
- [collection [list ("list/" Functor<List>)]]
- [maybe]
- [error (#+ Error)]]]
- [// [code ("code/" Equivalence<Code>)]])
+ ["." bit]
+ ["." ident]
+ ["." maybe]
+ ["." error (#+ Error)]
+ ["." number]
+ ["." text ("text/" Monoid<Text>)]
+ [collection
+ ["." list ("list/" Functor<List>)]]]]
+ ["." // (#+ with-gensyms)
+ ["." code ("code/" Equivalence<Code>)]])
## [Utils]
(def: (join-pairs pairs)
@@ -234,7 +235,7 @@
(case ?parts
(#.Some [name args meta body])
(with-gensyms [g!tokens g!body g!error]
- (do macro.Monad<Meta>
+ (do //.Monad<Meta>
[vars+parsers (monad.map @
(: (-> Code (Meta [Code Code]))
(function (_ arg)
@@ -246,7 +247,7 @@
(wrap [(code.symbol var-name) (` any)])
_
- (macro.fail "Syntax pattern expects records or symbols."))))
+ (//.fail "Syntax pattern expects records or symbols."))))
args)
#let [g!state (code.symbol ["" "*compiler*"])
error-msg (code.text (text/compose "Wrong syntax for " name))
@@ -265,9 +266,9 @@
(: (..Syntax (Meta (List Code)))
((~! do) (~! p.Monad<Parser>)
[(~+ (join-pairs vars+parsers))]
- ((~' wrap) ((~! do) (~! macro.Monad<Meta>)
+ ((~' wrap) ((~! do) (~! //.Monad<Meta>)
[]
(~ body)))))))))))))
_
- (macro.fail "Wrong syntax for syntax:"))))
+ (//.fail "Wrong syntax for syntax:"))))
diff --git a/stdlib/source/lux/macro/syntax/common/reader.lux b/stdlib/source/lux/macro/syntax/common/reader.lux
index a3dafa296..22a785049 100644
--- a/stdlib/source/lux/macro/syntax/common/reader.lux
+++ b/stdlib/source/lux/macro/syntax/common/reader.lux
@@ -4,13 +4,14 @@
monad
["p" parser ("parser/" Monad<Parser>)]]
[data
- [collection [list]]
[ident ("ident/" Equivalence<Ident>)]
- [product]
- [maybe]]
- ["." macro
- ["s" syntax (#+ syntax: Syntax)]]]
- [//])
+ ["." product]
+ ["." maybe]
+ [collection
+ ["." list]]]]
+ ["." //
+ ["/." ///
+ ["s" syntax (#+ syntax: Syntax)]]])
## Exports
(def: #export export
@@ -107,8 +108,8 @@
(do p.Monad<Parser>
[definition-raw s.any
me-definition-raw (|> definition-raw
- macro.expand-all
- (macro.run compiler)
+ ////.expand-all
+ (////.run compiler)
s.lift)]
(s.local me-definition-raw
(s.form (do @
diff --git a/stdlib/source/lux/macro/syntax/common/writer.lux b/stdlib/source/lux/macro/syntax/common/writer.lux
index 7a7416894..150cd7e52 100644
--- a/stdlib/source/lux/macro/syntax/common/writer.lux
+++ b/stdlib/source/lux/macro/syntax/common/writer.lux
@@ -2,10 +2,12 @@
{#.doc "Commons syntax writers."}
[lux #*
[data
- [collection [list ("list/" Functor<List>)]]
- [product]]
- [macro [code]]]
- [//])
+ [collection
+ [list ("list/" Functor<List>)]]
+ ["." product]]
+ [macro
+ ["." code]]]
+ ["." //])
(def: #export (export exported?)
(-> Bit (List Code))
diff --git a/stdlib/source/lux/math.lux b/stdlib/source/lux/math.lux
index d90db4a33..f29eafe63 100644
--- a/stdlib/source/lux/math.lux
+++ b/stdlib/source/lux/math.lux
@@ -4,12 +4,13 @@
monad
["p" parser ("parser/" Functor<Parser>)]]
[data
- [product]
- [number]
- [collection [list ("list/" Fold<List>)]]]
+ ["." product]
+ ["." number]
+ [collection
+ [list ("list/" Fold<List>)]]]
["." macro
["s" syntax (#+ syntax: Syntax)]
- [code]]])
+ ["." code]]])
## [Values]
(do-template [<name> <value> <doc>]
diff --git a/stdlib/source/lux/math/logic/fuzzy.lux b/stdlib/source/lux/math/logic/fuzzy.lux
index 0ee8a0c36..99bc2f8db 100644
--- a/stdlib/source/lux/math/logic/fuzzy.lux
+++ b/stdlib/source/lux/math/logic/fuzzy.lux
@@ -4,9 +4,10 @@
[predicate (#+ Predicate)]]
[data
[collection
- [list]
- [set (#+ Set)]]]]
- [// ["&" continuous]])
+ ["." list]
+ ["." set (#+ Set)]]]]
+ [//
+ ["&" continuous]])
(type: #export (Fuzzy a)
(-> a Rev))
diff --git a/stdlib/source/lux/math/modular.lux b/stdlib/source/lux/math/modular.lux
index bb15adac1..8fda63467 100644
--- a/stdlib/source/lux/math/modular.lux
+++ b/stdlib/source/lux/math/modular.lux
@@ -7,14 +7,14 @@
[monad (#+ do)]]
[data
["e" error (#+ Error)]
- [number ("int/" Codec<Text,Int>)]
+ ["." number ("int/" Codec<Text,Int>)]
[text ("text/" Monoid<Text>)
["l" lexer (#+ Lexer)]]]
- [type abstract]
+ [type
+ abstract]
[macro
- [code]
- ["s" syntax (#+ syntax:)]]
- [math]])
+ ["." code]
+ ["s" syntax (#+ syntax:)]]])
(exception: #export zero-cannot-be-a-modulus)
diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux
index 86c7d9efd..3f9d29d53 100644
--- a/stdlib/source/lux/math/random.lux
+++ b/stdlib/source/lux/math/random.lux
@@ -3,27 +3,29 @@
[control
[functor (#+ Functor)]
[apply (#+ Apply)]
- [monad (#+ do Monad)]
+ ["." monad (#+ do Monad)]
hash]
[data
- [text ("text/" Monoid<Text>)
- [unicode (#+ Char Segment)]]
- [product]
- [maybe]
- [number (#+ hex)
- [i64]
+ ["." product]
+ ["." maybe]
+ ["." number (#+ hex)
+ ["." i64]
["r" ratio]
["c" complex]]
+ ["." text ("text/" Monoid<Text>)
+ ["." unicode (#+ Char Segment)]]
[collection
- [list ("list/" Fold<List>)]
- [array]
- ["dict" dictionary (#+ Dictionary)]
- [queue (#+ Queue)]
- [set (#+ Set)]
- [stack (#+ Stack)]
- [row (#+ Row)]
- [tree [finger (#+ Tree)]]]]
- [type [refinement (#+ Refiner Refined)]]
+ ["." list ("list/" Fold<List>)]
+ ["." array]
+ ["." dictionary (#+ Dictionary)]
+ ["." queue (#+ Queue)]
+ ["." set (#+ Set)]
+ ["." stack (#+ Stack)]
+ ["." row (#+ Row)]
+ [tree
+ ["." finger (#+ Tree)]]]]
+ [type
+ [refinement (#+ Refiner Refined)]]
])
(type: #export #rec PRNG
@@ -248,11 +250,11 @@
(do @
[k key-gen
v value-gen
- #let [kv+ (dict.put k v kv)]]
- (if (n/= size (dict.size kv+))
+ #let [kv+ (dictionary.put k v kv)]]
+ (if (n/= size (dictionary.size kv+))
(wrap kv+)
(recur [])))))
- (:: Monad<Random> wrap (dict.new Hash<a>))))
+ (:: Monad<Random> wrap (dictionary.new Hash<a>))))
(def: #export (run prng calc)
(All [a] (-> PRNG (Random a) [PRNG a]))
diff --git a/stdlib/source/lux/test.lux b/stdlib/source/lux/test.lux
index f9bd93926..723a1d63c 100644
--- a/stdlib/source/lux/test.lux
+++ b/stdlib/source/lux/test.lux
@@ -1,24 +1,27 @@
(.module: {#.doc "Tools for unit & property-based/generative testing."}
[lux #*
- [macro (#+ with-gensyms)
- ["s" syntax (#+ syntax: Syntax)]
- [code]]
[control
- [monad (#+ do Monad)]
+ ["." monad (#+ do Monad)]
["p" parser]]
- [concurrency [promise (#+ Promise)]]
[data
- [product]
- [maybe]
+ ["." product]
+ ["." maybe]
["e" error]
["." text
format]
- [collection [list ("list/" Monad<List> Fold<List>)]]]
- [io (#+ IO io)]
+ [collection
+ ["." list ("list/" Monad<List> Fold<List>)]]]
[time
- [instant]
- [duration]]
- ["r" math/random]])
+ ["." instant]
+ ["." duration]]
+ [math
+ ["r" random]]
+ ["." macro (#+ with-gensyms)
+ ["s" syntax (#+ syntax: Syntax)]
+ ["." code]]
+ [concurrency
+ ["." promise (#+ Promise)]]
+ ["." io (#+ IO io)]])
## [Types]
(type: #export Counters [Nat Nat])
diff --git a/stdlib/source/lux/time/date.lux b/stdlib/source/lux/time/date.lux
index 3851d5ab4..12d928a8f 100644
--- a/stdlib/source/lux/time/date.lux
+++ b/stdlib/source/lux/time/date.lux
@@ -9,11 +9,12 @@
[monad (#+ do)]]
[data
["e" error]
- [maybe]
- [number ("int/" Codec<Text,Int>)]
+ ["." maybe]
+ ["." number ("int/" Codec<Text,Int>)]
[text ("text/" Monoid<Text>)
["l" lexer]]
- [collection [row (#+ Row row)]]]])
+ [collection
+ ["." row (#+ Row row)]]]])
(type: #export Year Int)
diff --git a/stdlib/source/lux/time/duration.lux b/stdlib/source/lux/time/duration.lux
index 748cd039e..48c49e61e 100644
--- a/stdlib/source/lux/time/duration.lux
+++ b/stdlib/source/lux/time/duration.lux
@@ -8,7 +8,7 @@
["p" parser]
[monad (#+ do)]]
[data
- [number ("int/" Codec<Text,Int> Number<Int>)]
+ ["." number ("int/" Codec<Text,Int> Number<Int>)]
[text ("text/" Monoid<Text>)
["l" lexer]]
["e" error]]
diff --git a/stdlib/source/lux/time/instant.lux b/stdlib/source/lux/time/instant.lux
index 9002ff9ef..a574ef208 100644
--- a/stdlib/source/lux/time/instant.lux
+++ b/stdlib/source/lux/time/instant.lux
@@ -1,6 +1,6 @@
(.module:
[lux #*
- [io (#- run)]
+ [io (#+ IO io)]
[control
equivalence
order
@@ -9,18 +9,19 @@
[monad (#+ do Monad)]
["p" parser]]
[data
+ ["e" error]
+ ["." maybe]
+ ["." number ("int/" Codec<Text,Int>)]
[text ("text/" Monoid<Text>)
["l" lexer]]
- [number ("int/" Codec<Text,Int>)]
- ["e" error]
- [maybe]
[collection
- [list ("list/" Fold<List>)]
- [row (#+ Row row) ("row/" Functor<Row> Fold<Row>)]]]
- [type abstract]]
+ ["." list ("list/" Fold<List>)]
+ ["." row (#+ Row row) ("row/" Functor<Row> Fold<Row>)]]]
+ [type
+ abstract]]
[//
- [duration ("duration/" Order<Duration>)]
- [date]])
+ ["." duration ("duration/" Order<Duration>)]
+ ["." date]])
(abstract: #export Instant
{#.doc "Instant is defined as milliseconds since the epoch."}
diff --git a/stdlib/source/lux/type/abstract.lux b/stdlib/source/lux/type/abstract.lux
index 7b8effc5d..f32f60de8 100644
--- a/stdlib/source/lux/type/abstract.lux
+++ b/stdlib/source/lux/type/abstract.lux
@@ -5,17 +5,19 @@
["p" parser]]
[data
[text ("text/" Equivalence<Text> Monoid<Text>)]
- [error]
- [collection [list ("list/" Functor<List> Monoid<List>)]]]
- [macro ("meta/" Monad<Meta>)
- [code]
+ ["." error]
+ [collection
+ [list ("list/" Functor<List> Monoid<List>)]]]
+ ["." macro ("meta/" Monad<Meta>)
+ ["." code]
["s" syntax (#+ syntax:)]
[syntax
["cs" common]
[common
["csr" reader]
["csw" writer]]]]
- [language [type (#+ :cast)]]])
+ [language
+ [type (#+ :cast)]]])
(def: (get k plist)
(All [a]
diff --git a/stdlib/source/lux/type/implicit.lux b/stdlib/source/lux/type/implicit.lux
index 103f79d27..b94eb6684 100644
--- a/stdlib/source/lux/type/implicit.lux
+++ b/stdlib/source/lux/type/implicit.lux
@@ -1,23 +1,24 @@
(.module:
[lux #*
- [control [monad (#+ do Monad)]
+ [control
+ ["." monad (#+ do Monad)]
["eq" equivalence]
["p" parser]]
[data
- [text ("text/" Equivalence<Text>)
+ ["." product]
+ ["." maybe]
+ ["." number]
+ ["." text ("text/" Equivalence<Text>)
format]
- [number]
- [collection [list ("list/" Monad<List> Fold<List>)]
- ["dict" dictionary (#+ Dictionary)]]
- [product]
- [maybe]]
- [macro (#+ Monad<Meta>)
- [code]
+ [collection
+ ["." list ("list/" Monad<List> Fold<List>)]
+ ["dict" dictionary (#+ Dictionary)]]]
+ ["." macro (#+ Monad<Meta>)
+ ["." code]
["s" syntax (#+ syntax: Syntax)]]
[language
- [type]
- [type ["tc" check (#+ Check)]]]
- ])
+ ["." type
+ ["." check (#+ Check)]]]])
(def: (find-type-var id env)
(-> Nat Type-Context (Meta Type))
@@ -59,20 +60,20 @@
(#.Apply arg func)
(case (type.apply (list arg) func)
#.None
- (tc.fail (format "Cannot apply type " (%type func) " to type " (%type arg)))
+ (check.fail (format "Cannot apply type " (%type func) " to type " (%type arg)))
(#.Some sig-type')
(find-member-type idx sig-type'))
(#.Product left right)
(if (n/= +0 idx)
- (:: tc.Monad<Check> wrap left)
+ (:: check.Monad<Check> wrap left)
(find-member-type (dec idx) right))
_
(if (n/= +0 idx)
- (:: tc.Monad<Check> wrap sig-type)
- (tc.fail (format "Cannot find member type " (%n idx) " for " (%type sig-type))))))
+ (:: check.Monad<Check> wrap sig-type)
+ (check.fail (format "Cannot find member type " (%n idx) " for " (%type sig-type))))))
(def: (find-member-name member)
(-> Ident (Meta Ident))
@@ -156,41 +157,41 @@
(apply-function-type func' arg)
(#.UnivQ _)
- (do tc.Monad<Check>
- [[id var] tc.var]
+ (do check.Monad<Check>
+ [[id var] check.var]
(apply-function-type (maybe.assume (type.apply (list var) func))
arg))
(#.Function input output)
- (do tc.Monad<Check>
- [_ (tc.check input arg)]
+ (do check.Monad<Check>
+ [_ (check.check input arg)]
(wrap output))
_
- (tc.fail (format "Invalid function type: " (%type func)))))
+ (check.fail (format "Invalid function type: " (%type func)))))
(def: (concrete-type type)
(-> Type (Check [(List Nat) Type]))
(case type
(#.UnivQ _)
- (do tc.Monad<Check>
- [[id var] tc.var
+ (do check.Monad<Check>
+ [[id var] check.var
[ids final-output] (concrete-type (maybe.assume (type.apply (list var) type)))]
(wrap [(#.Cons id ids)
final-output]))
_
- (:: tc.Monad<Check> wrap [(list) type])))
+ (:: check.Monad<Check> wrap [(list) type])))
(def: (check-apply member-type input-types output-type)
(-> Type (List Type) Type (Check []))
- (do tc.Monad<Check>
- [member-type' (monad.fold tc.Monad<Check>
+ (do check.Monad<Check>
+ [member-type' (monad.fold check.Monad<Check>
(function (_ input member)
(apply-function-type member input))
member-type
input-types)]
- (tc.check output-type member-type')))
+ (check.check output-type member-type')))
(type: #rec Instance
{#constructor Ident
@@ -204,14 +205,14 @@
[compiler macro.get-compiler]
(case (|> alts
(list/map (function (_ [alt-name alt-type])
- (case (tc.run context
- (do tc.Monad<Check>
- [[tvars alt-type] (concrete-type alt-type)
- #let [[deps alt-type] (type.flatten-function alt-type)]
- _ (tc.check dep alt-type)
- context' tc.context
- =deps (monad.map @ (provision compiler context') deps)]
- (wrap =deps)))
+ (case (check.run context
+ (do check.Monad<Check>
+ [[tvars alt-type] (concrete-type alt-type)
+ #let [[deps alt-type] (type.flatten-function alt-type)]
+ _ (check.check dep alt-type)
+ context' check.context
+ =deps (monad.map @ (provision compiler context') deps)]
+ (wrap =deps)))
(#.Left error)
(list)
@@ -232,18 +233,18 @@
(do Monad<Meta> [alts local-structs] (test-provision provision context dep alts))
(do Monad<Meta> [alts import-structs] (test-provision provision context dep alts))))
(#.Left error)
- (tc.fail error)
+ (check.fail error)
(#.Right candidates)
(case candidates
#.Nil
- (tc.fail (format "No candidates for provisioning: " (%type dep)))
+ (check.fail (format "No candidates for provisioning: " (%type dep)))
(#.Cons winner #.Nil)
- (:: tc.Monad<Check> wrap winner)
+ (:: check.Monad<Check> wrap winner)
_
- (tc.fail (format "Too many candidates for provisioning: " (%type dep) " --- " (%list (|>> product.left %ident) candidates))))
+ (check.fail (format "Too many candidates for provisioning: " (%type dep) " --- " (%list (|>> product.left %ident) candidates))))
))
(def: (test-alternatives sig-type member-idx input-types output-type alts)
@@ -253,16 +254,16 @@
context macro.type-context]
(case (|> alts
(list/map (function (_ [alt-name alt-type])
- (case (tc.run context
- (do tc.Monad<Check>
- [[tvars alt-type] (concrete-type alt-type)
- #let [[deps alt-type] (type.flatten-function alt-type)]
- _ (tc.check alt-type sig-type)
- member-type (find-member-type member-idx alt-type)
- _ (check-apply member-type input-types output-type)
- context' tc.context
- =deps (monad.map @ (provision compiler context') deps)]
- (wrap =deps)))
+ (case (check.run context
+ (do check.Monad<Check>
+ [[tvars alt-type] (concrete-type alt-type)
+ #let [[deps alt-type] (type.flatten-function alt-type)]
+ _ (check.check alt-type sig-type)
+ member-type (find-member-type member-idx alt-type)
+ _ (check-apply member-type input-types output-type)
+ context' check.context
+ =deps (monad.map @ (provision compiler context') deps)]
+ (wrap =deps)))
(#.Left error)
(list)
diff --git a/stdlib/source/lux/type/object/interface.lux b/stdlib/source/lux/type/object/interface.lux
index 42284b4b3..d4d6fa518 100644
--- a/stdlib/source/lux/type/object/interface.lux
+++ b/stdlib/source/lux/type/object/interface.lux
@@ -1,26 +1,27 @@
(.module:
[lux #*
[control
- [monad (#+ do Monad)]
+ ["." monad (#+ do Monad)]
["p" parser ("parser/" Monad<Parser>)]]
[data
- [product]
- [maybe]
+ ["." product]
+ ["." maybe]
[ident ("ident/" Equivalence<Ident>)]
["." text
format]
[collection
- [list ("list/" Functor<List> Fold<List> Monoid<List>)]
- [set (#+ Set)]]]
- [macro (#+ Monad<Meta>) ("meta/" Monad<Meta>)
- [code]
+ ["." list ("list/" Functor<List> Fold<List> Monoid<List>)]
+ ["." set (#+ Set)]]]
+ ["." macro (#+ Monad<Meta>) ("meta/" Monad<Meta>)
+ ["." code]
["s" syntax (#+ syntax:)]
[syntax
["cs" common]
[common
["csr" reader]
["csw" writer]]]]
- [language [type]]])
+ [language
+ ["." type]]])
## [Common]
(type: Declaration
diff --git a/stdlib/source/lux/type/object/protocol.lux b/stdlib/source/lux/type/object/protocol.lux
index ebbf9cc4b..64078b865 100644
--- a/stdlib/source/lux/type/object/protocol.lux
+++ b/stdlib/source/lux/type/object/protocol.lux
@@ -2,12 +2,13 @@
[lux #*
[control
["p" parser]
- [monad (#+ do)]]
+ ["." monad (#+ do)]]
[data
- [sum]
- [collection [list ("list/" Functor<List>)]]]
- [macro ("meta/" Monad<Meta>)
- [code]
+ ["." sum]
+ [collection
+ [list ("list/" Functor<List>)]]]
+ ["." macro ("meta/" Monad<Meta>)
+ ["." code]
["s" syntax (#+ syntax:)]
[syntax
["cs" common]
diff --git a/stdlib/source/lux/type/quotient.lux b/stdlib/source/lux/type/quotient.lux
index a2aeeaeec..63d022a31 100644
--- a/stdlib/source/lux/type/quotient.lux
+++ b/stdlib/source/lux/type/quotient.lux
@@ -3,12 +3,15 @@
[control
[monad (#+ do)]
["p" parser]]
- [data ["e" error (#+ Error)]]
- [language [type]]
- [type abstract]
+ [data
+ ["e" error (#+ Error)]]
+ [language
+ ["." type]]
+ [type
+ abstract]
["." macro
["s" syntax (#+ syntax:)]
- [poly]]])
+ ["." poly]]])
(abstract: #export (Class t c q)
{}
diff --git a/stdlib/source/lux/type/refinement.lux b/stdlib/source/lux/type/refinement.lux
index bc8f92dae..52a3c01be 100644
--- a/stdlib/source/lux/type/refinement.lux
+++ b/stdlib/source/lux/type/refinement.lux
@@ -4,12 +4,15 @@
[predicate (#+ Predicate)]
[monad (#+ do)]
["p" parser]]
- [data ["e" error (#+ Error)]]
- [language [type ("type/" Equivalence<Type>)]]
- [type abstract]
+ [data
+ ["e" error (#+ Error)]]
+ [language
+ ["." type ("type/" Equivalence<Type>)]]
+ [type
+ abstract]
["." macro
["s" syntax (#+ syntax:)]
- [poly]]])
+ ["." poly]]])
(abstract: #export (Refined t r)
{#.doc "A refined type 'r' of base type 't' using a predicate."}
diff --git a/stdlib/source/lux/type/resource.lux b/stdlib/source/lux/type/resource.lux
index 89523997b..7dd961ee8 100644
--- a/stdlib/source/lux/type/resource.lux
+++ b/stdlib/source/lux/type/resource.lux
@@ -3,24 +3,26 @@
[control
["p" parser]
["ex" exception (#+ exception:)]
- [monad (#+ Monad do)
+ ["." monad (#+ Monad do)
[indexed (#+ IxMonad)]]]
[data
- [identity (#+ Identity)]
- [maybe]
- [product]
- [number]
+ ["." identity (#+ Identity)]
+ ["." maybe]
+ ["." product]
+ ["." number]
[text
format]
[collection
["dict" dictionary (#+ Dictionary)]
- [set]
- [row (#+ Row)]
- [list ("list/" Functor<List> Fold<List>)]]]
- [concurrency [promise (#+ Promise)]]
+ ["." set]
+ ["." row (#+ Row)]
+ ["." list ("list/" Functor<List> Fold<List>)]]]
+ [concurrency
+ ["." promise (#+ Promise)]]
["." macro ["s" syntax (#+ Syntax syntax:)]]
- [type abstract]
- [io (#+ IO)]])
+ [type
+ abstract]
+ ["." io (#+ IO)]])
(type: #export (Procedure monad input output value)
(-> input (monad [output value])))
diff --git a/stdlib/source/lux/type/unit.lux b/stdlib/source/lux/type/unit.lux
index 341e556d4..e7be06eed 100644
--- a/stdlib/source/lux/type/unit.lux
+++ b/stdlib/source/lux/type/unit.lux
@@ -12,7 +12,7 @@
[text
format]]
["." macro
- [code]
+ ["." code]
["s" syntax (#+ syntax:)]
[syntax
["cs" common]
diff --git a/stdlib/source/lux/world/blob.jvm.lux b/stdlib/source/lux/world/blob.jvm.lux
index ce2e39984..c4c659ccf 100644
--- a/stdlib/source/lux/world/blob.jvm.lux
+++ b/stdlib/source/lux/world/blob.jvm.lux
@@ -5,13 +5,13 @@
["ex" exception (#+ exception:)]
["eq" equivalence]]
[data
- [maybe]
- [error (#+ Error)]
- [text
- format]
+ ["." maybe]
+ ["." error (#+ Error)]
[number
- [i64]]]
- [host (#+ import:)]])
+ ["." i64]]
+ [text
+ format]]
+ ["." host (#+ import:)]])
(exception: #export (index-out-of-bounds {description Text})
description)
diff --git a/stdlib/source/lux/world/console.lux b/stdlib/source/lux/world/console.lux
index b66e83ad3..2aafa9571 100644
--- a/stdlib/source/lux/world/console.lux
+++ b/stdlib/source/lux/world/console.lux
@@ -3,13 +3,15 @@
[control [monad (#+ do)]]
[data
["e" error]
- [text]]
+ ["." text]]
[concurrency
- [promise]
- [task (#+ Task)]]
- [type [object interface]]
- [io (#+ IO Process io)]
- [host]])
+ ["." promise]
+ ["." task (#+ Task)]]
+ [type
+ [object
+ interface]]
+ ["." io (#+ IO Process io)]
+ [host (#+ import:)]])
(interface: #export Console
(read-char [] (Task Text))
@@ -18,27 +20,27 @@
(close [] (Task Any)))
(for {"JVM"
- (as-is (host.import: java/io/InputStream
+ (as-is (import: java/io/InputStream
(read [] #io #try int)
(available [] #io #try int)
(mark [int] #io #try void)
(reset [] #io #try void))
- (host.import: java/io/Reader)
+ (import: java/io/Reader)
- (host.import: java/io/PrintStream
+ (import: java/io/PrintStream
(print [String] #io #try void))
- (host.import: java/lang/System
+ (import: java/lang/System
(#static in java/io/InputStream)
(#static out java/io/PrintStream))
- (host.import: java/lang/Appendable
+ (import: java/lang/Appendable
(append [CharSequence] Appendable))
- (host.import: java/lang/String)
+ (import: java/lang/String)
- (host.import: java/lang/StringBuffer
+ (import: java/lang/StringBuffer
(new [String])
(toString [] String))
diff --git a/stdlib/source/lux/world/environment.jvm.lux b/stdlib/source/lux/world/environment.jvm.lux
index 32af351d4..019dab706 100644
--- a/stdlib/source/lux/world/environment.jvm.lux
+++ b/stdlib/source/lux/world/environment.jvm.lux
@@ -1,29 +1,31 @@
(.module:
[lux #*
[data
- [text]
- [format [context (#+ Context)]]
- [collection [dictionary]]]
+ ["." text]
+ [format
+ [context (#+ Context)]]
+ [collection
+ ["." dictionary]]]
[io (#- run)]
- [host]])
+ [host (#+ import:)]])
-(host.import: java/lang/String)
+(import: java/lang/String)
-(host.import: (java/util/Map$Entry k v)
+(import: (java/util/Map$Entry k v)
(getKey [] k)
(getValue [] v))
-(host.import: (java/util/Iterator a)
+(import: (java/util/Iterator a)
(hasNext [] boolean)
(next [] a))
-(host.import: (java/util/Set a)
+(import: (java/util/Set a)
(iterator [] (Iterator a)))
-(host.import: (java/util/Map k v)
+(import: (java/util/Map k v)
(entrySet [] (Set (Map$Entry k v))))
-(host.import: java/lang/System
+(import: java/lang/System
(#static getenv [] (Map String String)))
(def: (consume-iterator f iterator)
diff --git a/stdlib/source/lux/world/file.lux b/stdlib/source/lux/world/file.lux
index 9758d7e44..acaa2c244 100644
--- a/stdlib/source/lux/world/file.lux
+++ b/stdlib/source/lux/world/file.lux
@@ -1,20 +1,23 @@
(.module:
[lux #*
[control
- [monad (#+ Monad do)]
+ ["." monad (#+ Monad do)]
["ex" exception (#+ Exception exception:)]
pipe]
[data
- [error (#+ Error)]
- text/format
- [collection [array]]]
+ ["." error (#+ Error)]
+ [text
+ format]
+ [collection
+ ["." array]]]
[time
- [instant (#+ Instant)]
- [duration]]
- [world [blob (#+ Blob)]]
- [io (#+ Process)]
+ ["." instant (#+ Instant)]
+ ["." duration]]
+ [world
+ ["." blob (#+ Blob)]]
+ ["." io (#+ Process)]
[host (#+ import:)]
- [language/host]])
+ ["." language/host]])
(type: #export File Text)
diff --git a/stdlib/source/lux/world/net/tcp.jvm.lux b/stdlib/source/lux/world/net/tcp.jvm.lux
index 30c3ef49b..86b19136a 100644
--- a/stdlib/source/lux/world/net/tcp.jvm.lux
+++ b/stdlib/source/lux/world/net/tcp.jvm.lux
@@ -3,34 +3,37 @@
[control
monad]
[concurrency
- [promise (#+ Promise promise)]
+ ["." promise (#+ Promise promise)]
[task (#+ Task)]
- [frp]]
- [data ["e" error]]
- [type abstract]
- [world [blob (#+ Blob)]]
- [io (#+ Process)]
- [host]]
- [//])
+ ["." frp]]
+ [data
+ ["e" error]]
+ [type
+ abstract]
+ [world
+ [blob (#+ Blob)]]
+ ["." io (#+ Process)]
+ [host (#+ import:)]]
+ ["." //])
-(host.import: java/lang/AutoCloseable
+(import: java/lang/AutoCloseable
(close [] #io #try void))
-(host.import: java/io/Flushable
+(import: java/io/Flushable
(flush [] #io #try void))
-(host.import: java/io/InputStream
+(import: java/io/InputStream
(read [(Array byte) int int] #io #try int))
-(host.import: java/io/OutputStream
+(import: java/io/OutputStream
(write [(Array byte) int int] #io #try void))
-(host.import: java/net/Socket
+(import: java/net/Socket
(new [String int] #io #try)
(getInputStream [] #io #try InputStream)
(getOutputStream [] #io #try OutputStream))
-(host.import: java/net/ServerSocket
+(import: java/net/ServerSocket
(new [int] #io #try)
(accept [] #io #try Socket))
diff --git a/stdlib/source/lux/world/net/udp.jvm.lux b/stdlib/source/lux/world/net/udp.jvm.lux
index 9e61e55eb..b7c3533e7 100644
--- a/stdlib/source/lux/world/net/udp.jvm.lux
+++ b/stdlib/source/lux/world/net/udp.jvm.lux
@@ -8,32 +8,35 @@
["T" task]]
[data
["e" error]
- [maybe]
- [collection [array]]]
- [type abstract]
- [world [blob (#+ Blob)]]
- [io]
- [host]]
- [//])
+ ["." maybe]
+ [collection
+ ["." array]]]
+ [type
+ abstract]
+ [world
+ [blob (#+ Blob)]]
+ ["." io]
+ [host (#+ import:)]]
+ ["." //])
-(host.import: java/lang/AutoCloseable
+(import: java/lang/AutoCloseable
(close [] #io #try void))
-(host.import: java/io/Flushable
+(import: java/io/Flushable
(flush [] #io #try void))
-(host.import: java/net/InetAddress
+(import: java/net/InetAddress
(#static getAllByName [String] #io #try (Array InetAddress))
(getHostAddress [] String))
-(host.import: java/net/DatagramPacket
+(import: java/net/DatagramPacket
(new #as new|send [(Array byte) int int InetAddress int])
(new #as new|receive [(Array byte) int int])
(getAddress [] InetAddress)
(getPort [] int)
(getLength [] int))
-(host.import: java/net/DatagramSocket
+(import: java/net/DatagramSocket
(new #as new|client [] #io #try)
(new #as new|server [int] #io #try)
(receive [DatagramPacket] #io #try void)