aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/case.jvm.lux8
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/expression.jvm.lux31
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/extension.jvm.lux8
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/extension/common.jvm.lux6
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/function.jvm.lux12
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/loop.jvm.lux35
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/primitive.jvm.lux4
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/reference.jvm.lux12
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/runtime.jvm.lux10
-rw-r--r--stdlib/source/lux/lang/compiler/translation/scheme/structure.jvm.lux8
-rw-r--r--stdlib/source/lux/macro/poly/functor.lux4
-rw-r--r--stdlib/source/lux/macro/poly/json.lux4
-rw-r--r--stdlib/source/lux/type/quotient.lux2
-rw-r--r--stdlib/source/lux/type/unit.lux2
-rw-r--r--stdlib/test/test/lux/math/modular.lux2
-rw-r--r--stdlib/test/test/lux/type/implicit.lux4
-rw-r--r--stdlib/test/test/lux/world/blob.lux12
17 files changed, 82 insertions, 82 deletions
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/case.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/case.jvm.lux
index 40d2625fb..0ee52c54b 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/case.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/case.jvm.lux
@@ -7,10 +7,10 @@
text/format
(coll [list "list/" Functor<List> Fold<List>]
(set ["set" unordered #+ Set]))))
- (//// [reference #+ Register]
- (host ["_" scheme #+ Expression Computation Var])
- [compiler #+ "operation/" Monad<Operation>]
- [synthesis #+ Synthesis Path])
+ (///// [reference #+ Register]
+ (host ["_" scheme #+ Expression Computation Var])
+ [compiler #+ "operation/" Monad<Operation>]
+ (compiler [synthesis #+ Synthesis Path]))
[//runtime #+ Operation Translator]
[//reference])
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/expression.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/expression.jvm.lux
index 96bb17126..a654fe4d0 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/expression.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/expression.jvm.lux
@@ -1,15 +1,16 @@
(.module:
lux
(lux (control [monad #+ do]))
- (//// [compiler]
- [synthesis]
- [extension])
+ (///// [compiler]
+ (compiler [synthesis]
+ [extension]))
[//runtime #+ Translator]
[//primitive]
[//structure]
[//reference]
[//function]
- [//case])
+ [//case]
+ [//loop])
(def: #export (translate synthesis)
Translator
@@ -31,12 +32,6 @@
(#synthesis.Reference reference)
(//reference.reference reference)
- (^ (synthesis.function/apply application))
- (//function.apply translate application)
-
- (^ (synthesis.function/abstraction abstraction))
- (//function.function translate abstraction)
-
(^ (synthesis.branch/case case))
(//case.case translate case)
@@ -46,8 +41,14 @@
(^ (synthesis.branch/if if))
(//case.if translate if)
- (#synthesis.Extension [extension argsS])
- (do compiler.Monad<Operation>
- [extension (extension.find-translation extension)]
- (extension argsS))
- ))
+ (^ (synthesis.loop/scope scope))
+ (//loop.scope translate scope)
+
+ (^ (synthesis.loop/recur updates))
+ (//loop.recur translate updates)
+
+ (^ (synthesis.function/abstraction abstraction))
+ (//function.function translate abstraction)
+
+ (^ (synthesis.function/apply application))
+ (//function.apply translate application)))
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/extension.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/extension.jvm.lux
index 6475caf68..e2cdc3e03 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/extension.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/extension.jvm.lux
@@ -5,10 +5,10 @@
(data [maybe]
text/format
(coll (dictionary ["dict" unordered #+ Dict]))))
- (//// [reference #+ Register Variable]
- (host ["_" scheme #+ Computation])
- [compiler "operation/" Monad<Operation>]
- [synthesis #+ Synthesis])
+ (///// [reference #+ Register Variable]
+ (host ["_" scheme #+ Computation])
+ [compiler "operation/" Monad<Operation>]
+ (compiler [synthesis #+ Synthesis]))
[//runtime #+ Operation Translator]
[/common]
## [/host]
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/extension/common.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/extension/common.jvm.lux
index 644557bdc..dbb02da7f 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/extension/common.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/extension/common.jvm.lux
@@ -13,9 +13,9 @@
(macro [code]
["s" syntax #+ syntax:])
[host])
- (///// (host ["_" scheme #+ Expression Computation])
- [compiler]
- [synthesis #+ Synthesis])
+ (////// (host ["_" scheme #+ Expression Computation])
+ [compiler]
+ (compiler [synthesis #+ Synthesis]))
[///runtime #+ Operation Translator])
## [Types]
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/function.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/function.jvm.lux
index 11c64076c..4ec601257 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/function.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/function.jvm.lux
@@ -5,12 +5,12 @@
(data [product]
text/format
(coll [list "list/" Functor<List>])))
- (//// [reference #+ Register Variable]
- [name]
- [compiler "operation/" Monad<Operation>]
- [analysis #+ Variant Tuple Environment Arity Abstraction Application Analysis]
- [synthesis #+ Synthesis]
- (host ["_" scheme #+ Expression Computation Var]))
+ (///// [reference #+ Register Variable]
+ [name]
+ (host ["_" scheme #+ Expression Computation Var])
+ [compiler "operation/" Monad<Operation>]
+ (compiler [analysis #+ Variant Tuple Environment Arity Abstraction Application Analysis]
+ [synthesis #+ Synthesis]))
[///]
[//runtime #+ Operation Translator]
[//primitive]
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/loop.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/loop.jvm.lux
index 6f305336e..e9ea1c3e8 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/loop.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/loop.jvm.lux
@@ -1,39 +1,36 @@
(.module:
- [lux #- loop]
+ [lux #- Scope]
(lux (control [monad #+ do])
(data [product]
[text]
text/format
(coll [list "list/" Functor<List>]))
[macro])
- [////]
- (//// [name]
- (host ["_" scheme #+ Computation Var])
- [compiler "operation/" Monad<Operation>]
- [synthesis #+ Synthesis])
+ (///// (host ["_" scheme #+ Computation Var])
+ [compiler]
+ (compiler [synthesis #+ Scope Synthesis]))
[///]
[//runtime #+ Operation Translator]
[//reference])
-(def: @loop (_.var "loop"))
+(def: @scope (_.var "scope"))
-(def: #export (loop translate offset initsS+ bodyS)
- (-> Translator Nat (List Synthesis) Synthesis
- (Operation Computation))
+(def: #export (scope translate [start initsS+ bodyS])
+ (-> Translator (Scope Synthesis) (Operation Computation))
(do compiler.Monad<Operation>
[initsO+ (monad.map @ translate initsS+)
- bodyO (///.with-anchor @loop
+ bodyO (///.with-anchor @scope
(translate bodyS))]
- (wrap (_.letrec (list [@loop (_.lambda [(|> initsS+
- list.enumerate
- (list/map (|>> product.left (n/+ offset) //reference.local')))
- #.None]
- bodyO)])
- (_.apply/* @loop initsO+)))))
+ (wrap (_.letrec (list [@scope (_.lambda [(|> initsS+
+ list.enumerate
+ (list/map (|>> product.left (n/+ start) //reference.local')))
+ #.None]
+ bodyO)])
+ (_.apply/* @scope initsO+)))))
(def: #export (recur translate argsS+)
(-> Translator (List Synthesis) (Operation Computation))
(do compiler.Monad<Operation>
- [@loop ///.anchor
+ [@scope ///.anchor
argsO+ (monad.map @ translate argsS+)]
- (wrap (_.apply/* @loop argsO+))))
+ (wrap (_.apply/* @scope argsO+))))
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/primitive.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/primitive.jvm.lux
index ac775fa82..e78df5b74 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/primitive.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/primitive.jvm.lux
@@ -1,8 +1,8 @@
(.module:
[lux #- i64]
[/// #+ State]
- (//// [compiler #+ "operation/" Monad<Operation>]
- (host ["_" scheme #+ Expression]))
+ (///// [compiler #+ "operation/" Monad<Operation>]
+ (host ["_" scheme #+ Expression]))
[//runtime #+ Operation])
(def: #export bool
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/reference.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/reference.jvm.lux
index 453d4edb6..e1cb6a642 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/reference.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/reference.jvm.lux
@@ -2,12 +2,12 @@
lux
(lux (control pipe)
(data text/format))
- (//// [reference #+ Register Variable Reference]
- [name]
- [compiler "operation/" Monad<Operation>]
- [analysis #+ Variant Tuple]
- [synthesis #+ Synthesis]
- (host ["_" scheme #+ Expression Var]))
+ (///// [reference #+ Register Variable Reference]
+ [name]
+ (host ["_" scheme #+ Expression Var])
+ [compiler "operation/" Monad<Operation>]
+ (compiler [analysis #+ Variant Tuple]
+ [synthesis #+ Synthesis]))
[//runtime #+ Operation Translator]
[//primitive])
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/runtime.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/runtime.jvm.lux
index b30aff3a2..7ba873999 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/runtime.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/runtime.jvm.lux
@@ -9,11 +9,11 @@
(macro [code]
["s" syntax #+ syntax:]))
[/// #+ State]
- (//// [name]
- [compiler]
- [analysis #+ Variant]
- [synthesis]
- (host ["_" scheme #+ Expression Computation Var])))
+ (///// [name]
+ (host ["_" scheme #+ Expression Computation Var])
+ [compiler]
+ (compiler [analysis #+ Variant]
+ [synthesis])))
(type: #export Operation
(compiler.Operation (State Var Expression)))
diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/structure.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/structure.jvm.lux
index a11434594..c3b93e7a1 100644
--- a/stdlib/source/lux/lang/compiler/translation/scheme/structure.jvm.lux
+++ b/stdlib/source/lux/lang/compiler/translation/scheme/structure.jvm.lux
@@ -1,10 +1,10 @@
(.module:
lux
(lux (control [monad #+ do]))
- (//// [compiler]
- [analysis #+ Variant Tuple]
- [synthesis #+ Synthesis]
- (host ["_" scheme #+ Expression]))
+ (///// (host ["_" scheme #+ Expression])
+ [compiler]
+ (compiler [analysis #+ Variant Tuple]
+ [synthesis #+ Synthesis]))
[//runtime #+ Operation Translator]
[//primitive])
diff --git a/stdlib/source/lux/macro/poly/functor.lux b/stdlib/source/lux/macro/poly/functor.lux
index bf9421cde..0f7b67b57 100644
--- a/stdlib/source/lux/macro/poly/functor.lux
+++ b/stdlib/source/lux/macro/poly/functor.lux
@@ -28,10 +28,10 @@
#let [@Functor (: (-> Type Code)
(function (_ unwrappedT)
(if (n/= +1 num-vars)
- (` (functor.Functor (~ (poly.to-code *env* unwrappedT))))
+ (` ((~! functor.Functor) (~ (poly.to-code *env* unwrappedT))))
(let [paramsC (|> num-vars dec list.indices (L/map (|>> %n code.local-symbol)))]
(` (All [(~+ paramsC)]
- (functor.Functor ((~ (poly.to-code *env* unwrappedT)) (~+ paramsC)))))))))
+ ((~! functor.Functor) ((~ (poly.to-code *env* unwrappedT)) (~+ paramsC)))))))))
Arg<?> (: (-> Code (poly.Poly Code))
(function (Arg<?> valueC)
($_ p.either
diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux
index 775b86b69..fd85087d7 100644
--- a/stdlib/source/lux/macro/poly/json.lux
+++ b/stdlib/source/lux/macro/poly/json.lux
@@ -1,12 +1,12 @@
(.module: {#.doc "Codecs for values in the JSON format."}
lux
(lux (control [monad #+ do Monad]
- [equivalence #+ Eq]
+ [equivalence #+ Equivalence]
codec
["p" parser "p/" Monad<Parser>])
(data [bool]
[bit]
- [text "text/" Eq<Text>]
+ [text "text/" Equivalence<Text>]
(text ["l" lexer]
format)
[number "frac/" Codec<Text,Frac> "nat/" Codec<Text,Nat>]
diff --git a/stdlib/source/lux/type/quotient.lux b/stdlib/source/lux/type/quotient.lux
index 567d7af42..35e681159 100644
--- a/stdlib/source/lux/type/quotient.lux
+++ b/stdlib/source/lux/type/quotient.lux
@@ -54,7 +54,7 @@
(do p.Monad<Parser>
[[valueT classT quotient-ex] (<| poly.apply (p.after (poly.this ..Class))
($_ p.seq poly.any poly.any poly.existential))]
- (wrap (.type (..Quotient valueT classT (~ (#.Ex quotient-ex))))))))
+ (wrap (.type (..Quotient valueT classT (:~ (#.Ex quotient-ex))))))))
(syntax: #export (type {quotient s.symbol})
(do @
diff --git a/stdlib/source/lux/type/unit.lux b/stdlib/source/lux/type/unit.lux
index 5072a677f..569c6f8c2 100644
--- a/stdlib/source/lux/type/unit.lux
+++ b/stdlib/source/lux/type/unit.lux
@@ -136,7 +136,7 @@
(def: #export (re-scale from to quantity)
(All [si so u] (-> (Scale si) (Scale so) (Qty (si u)) (Qty (so u))))
- (let [[numerator denominator] (|> (:: to ratio) (r.r// (:: from ratio)))]
+ (let [[numerator denominator] (|> (:: to ratio) (r./ (:: from ratio)))]
(|> quantity
out
(i/* (.int numerator))
diff --git a/stdlib/test/test/lux/math/modular.lux b/stdlib/test/test/lux/math/modular.lux
index 7102e684d..dcfdb4e11 100644
--- a/stdlib/test/test/lux/math/modular.lux
+++ b/stdlib/test/test/lux/math/modular.lux
@@ -11,7 +11,7 @@
lux/test)
(def: %3 (/.modulus 3))
-(type: Mod3 (~ (type-of %3)))
+(`` (type: Mod3 (~~ (type-of %3))))
(def: modulusR
(r.Random Int)
diff --git a/stdlib/test/test/lux/type/implicit.lux b/stdlib/test/test/lux/type/implicit.lux
index 33c0bd6c5..30f20b073 100644
--- a/stdlib/test/test/lux/type/implicit.lux
+++ b/stdlib/test/test/lux/type/implicit.lux
@@ -1,7 +1,9 @@
(.module:
lux
(lux [io]
- (control [monad #+ do Monad])
+ (control [equivalence]
+ [functor]
+ [monad #+ do Monad])
(data [number]
[bool "bool/" Equivalence<Bool>]
(coll [list]))
diff --git a/stdlib/test/test/lux/world/blob.lux b/stdlib/test/test/lux/world/blob.lux
index 8e69e4176..908a4050f 100644
--- a/stdlib/test/test/lux/world/blob.lux
+++ b/stdlib/test/test/lux/world/blob.lux
@@ -28,7 +28,7 @@
(if (n/< size idx)
(do r.Monad<Random>
[byte r.nat]
- (exec (e.assume (/.write-8 idx byte output))
+ (exec (e.assume (/.write/8 idx byte output))
(recur (inc idx))))
(:: r.Monad<Random> wrap output)))))
@@ -59,18 +59,18 @@
(test "Can get size of blob."
(|> random-blob /.size (n/= blob-size)))
(test "Can read/write 8-bit values."
- (bits-io +1 /.read-8 /.write-8 value))
+ (bits-io +1 /.read/8 /.write/8 value))
(test "Can read/write 16-bit values."
- (bits-io +2 /.read-16 /.write-16 value))
+ (bits-io +2 /.read/16 /.write/16 value))
(test "Can read/write 32-bit values."
- (bits-io +4 /.read-32 /.write-32 value))
+ (bits-io +4 /.read/32 /.write/32 value))
(test "Can read/write 64-bit values."
- (bits-io +8 /.read-64 /.write-64 value))
+ (bits-io +8 /.read/64 /.write/64 value))
(test "Can slice blobs."
(let [slice-size (|> to (n/- from) inc)
random-slice (e.assume (/.slice from to random-blob))
idxs (list.n/range +0 (dec slice-size))
- reader (function (_ blob idx) (/.read-8 idx blob))]
+ reader (function (_ blob idx) (/.read/8 idx blob))]
(and (n/= slice-size (/.size random-slice))
(case [(monad.map e.Monad<Error> (reader random-slice) idxs)
(monad.map e.Monad<Error> (|>> (n/+ from) (reader random-blob)) idxs)]