aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source
diff options
context:
space:
mode:
authorEduardo Julian2021-09-05 22:52:26 -0400
committerEduardo Julian2021-09-05 22:52:26 -0400
commit132ffdae1add622c8a3c6065d7730a8fe8ea5e78 (patch)
tree540310f190007d192b892db2d0a520d17b73ad48 /lux-jvm/source
parent09e2747bf8c6dcdc1d7318f2490f0de37d77b39f (diff)
Changed the syntax of do/be's (co)monad bindings.
Diffstat (limited to 'lux-jvm/source')
-rw-r--r--lux-jvm/source/luxc/lang/directive/jvm.lux30
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/case.lux2
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux2
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux10
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/function.lux6
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/loop.lux4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/reference.lux4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/structure.lux2
8 files changed, 30 insertions, 30 deletions
diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux
index cce373dfc..246e49761 100644
--- a/lux-jvm/source/luxc/lang/directive/jvm.lux
+++ b/lux-jvm/source/luxc/lang/directive/jvm.lux
@@ -599,7 +599,7 @@
(template [<name> <type> <parser>]
[(def: <name>
(Parser <type>)
- (do {! <>.monad}
+ (do [! <>.monad]
[raw <code>.text]
(<>.lifted (<text>.result <parser> raw))))]
@@ -1009,7 +1009,7 @@
(def: (constructor_method_analysis archive [class_name class_tvars] method)
(-> Archive Declaration (Constructor Code) (Operation (Constructor Analysis)))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[privacy strict_floating_point? annotations method_tvars exceptions
self arguments constructor_argumentsC
bodyC] method]
@@ -1044,7 +1044,7 @@
(def: (override_method_analysis archive [class_name class_tvars] supers method)
(-> Archive Declaration (List (Type Class)) (Override Code) (Operation (Override Analysis)))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[[super_name super_tvars] method_name strict_floating_point? annotations
method_tvars self arguments returnJ exceptionsJ
bodyC] method]
@@ -1074,7 +1074,7 @@
(def: (virtual_method_analysis archive [class_name class_tvars] method)
(-> Archive Declaration (Virtual Code) (Operation (Virtual Analysis)))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[name privacy final? strict_floating_point? annotations method_tvars
self arguments returnJ exceptionsJ
bodyC] method]
@@ -1102,7 +1102,7 @@
(def: (static_method_analysis archive method)
(-> Archive (Static Code) (Operation (Static Analysis)))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[name privacy strict_floating_point? annotations method_tvars
arguments returnJ exceptionsJ
bodyC] method]
@@ -1157,7 +1157,7 @@
(def: (constructor_method_synthesis archive method)
(-> Archive (Constructor Analysis) (Operation (Constructor Synthesis)))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[privacy strict_floating_point? annotations method_tvars exceptions
self arguments constructor_argumentsA
bodyA] method]
@@ -1180,7 +1180,7 @@
(def: (override_method_synthesis archive method)
(-> Archive (Override Analysis) (Operation (Override Synthesis)))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[[super_name super_tvars] method_name strict_floating_point? annotations
method_tvars self arguments returnJ exceptionsJ
bodyA] method]
@@ -1199,7 +1199,7 @@
(def: (virtual_method_synthesis archive method)
(-> Archive (Virtual Analysis) (Operation (Virtual Synthesis)))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[name privacy final? strict_floating_point? annotations method_tvars
self arguments returnJ exceptionsJ
bodyA] method]
@@ -1218,7 +1218,7 @@
(def: (static_method_synthesis archive method)
(-> Archive (Static Analysis) (Operation (Static Synthesis)))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[name privacy strict_floating_point? annotations method_tvars
arguments returnJ exceptionsJ
bodyA] method]
@@ -1260,7 +1260,7 @@
(def: (constructor_method_generation archive super_class method)
(-> Archive (Type Class) (Constructor Synthesis) (Operation jvm.Def))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[privacy strict_floating_point? annotations method_tvars exceptions
self arguments constructor_argumentsS
bodyS] method]
@@ -1294,7 +1294,7 @@
(def: (override_method_generation archive method)
(-> Archive (Override Synthesis) (Operation jvm.Def))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[[super_name super_tvars] method_name strict_floating_point? annotations
method_tvars self arguments returnJ exceptionsJ
bodyS] method]
@@ -1315,7 +1315,7 @@
(def: (virtual_method_generation archive method)
(-> Archive (Virtual Synthesis) (Operation jvm.Def))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[method_name privacy final? strict_floating_point? annotations method_tvars
self arguments returnJ exceptionsJ
bodyS] method]
@@ -1340,7 +1340,7 @@
(def: (static_method_generation archive method)
(-> Archive (Static Synthesis) (Operation jvm.Def))
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[method_name privacy strict_floating_point? annotations method_tvars
arguments returnJ exceptionsJ
bodyS] method]
@@ -1414,7 +1414,7 @@
annotations
fields
methodsC])
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [[class_name type_variables] declaration
header (..header [class_name type_variables]
super_class
@@ -1458,7 +1458,7 @@
(<code>.tuple (<>.some ..annotation))
(<>.some ..method_declaration))
(function (_ extension_name phase archive [[class_name type_variables] supers annotations method_declarations])
- (do {! phase.monad}
+ (do [! phase.monad]
[.let [directive [class_name
(def.interface #jvm.V1_6 #jvm.Public jvm.noneC class_name
(list\each ..constraint type_variables)
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
index 41511f300..33aa7f793 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
@@ -130,7 +130,7 @@
(^template [<tag> <unwrap> <dup> <pop> <test> <comparison> <if>]
[(<tag> cons)
- (do {@ phase.monad}
+ (do [@ phase.monad]
[forkG (: (Operation Inst)
(monad.mix @ (function (_ [test thenP] elseG)
(do @
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
index 2d33970db..706c69c00 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
@@ -95,7 +95,7 @@
(function (_ extension_name phase archive [input else conditionals])
(<| _.with_label (function (_ @end))
_.with_label (function (_ @else))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[inputG (phase archive input)
elseG (phase archive else)
conditionalsG+ (: (Operation (List [(List [Int Label])
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
index 16ef783f2..802d13d3f 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -733,7 +733,7 @@
(..custom
[($_ <>.and ..class <synthesis>.text ..return (<>.some ..input))
(function (_ extension_name generate archive [class method outputT inputsTS])
- (do {! phase.monad}
+ (do [! phase.monad]
[inputsTI (monad.each ! (generate_input generate archive) inputsTS)]
(in (|>> (_.fuse (list\each product.right inputsTI))
(_.INVOKESTATIC class method (type.method [(list) (list\each product.left inputsTI) outputT (list)]))
@@ -745,7 +745,7 @@
(..custom
[($_ <>.and ..class <synthesis>.text ..return <synthesis>.any (<>.some ..input))
(function (_ extension_name generate archive [class method outputT objectS inputsTS])
- (do {! phase.monad}
+ (do [! phase.monad]
[objectI (generate archive objectS)
inputsTI (monad.each ! (generate_input generate archive) inputsTS)]
(in (|>> objectI
@@ -768,7 +768,7 @@
(..custom
[($_ <>.and ..class (<>.some ..input))
(function (_ extension_name generate archive [class inputsTS])
- (do {! phase.monad}
+ (do [! phase.monad]
[inputsTI (monad.each ! (generate_input generate archive) inputsTS)]
(in (|>> (_.NEW class)
_.DUP
@@ -989,7 +989,7 @@
(def: (anonymous_instance generate archive class env)
(-> Phase Archive (Type Class) (Environment Synthesis) (Operation Inst))
- (do {! phase.monad}
+ (do [! phase.monad]
[captureI+ (monad.each ! (generate archive) env)]
(in (|>> (_.NEW class)
_.DUP
@@ -1085,7 +1085,7 @@
super_interfaces
inputsTS
overriden_methods])
- (do {! phase.monad}
+ (do [! phase.monad]
[[context _] (generation.with_new_context archive (in []))
.let [[module_id artifact_id] context
anonymous_class_name (///.class_name context)
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
index 69605bb8a..9cd5efdfb 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
@@ -108,7 +108,7 @@
(def: (instance generate archive class arity env)
(-> Phase Archive (Type Class) Arity (Environment Synthesis) (Operation Inst))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[captureI+ (monad.each @ (generate archive) env)
.let [argsI (if (poly_arg? arity)
(|> (nullsI (-- arity))
@@ -305,7 +305,7 @@
(def: .public (function' forced_context generate archive [env arity bodyS])
(-> (Maybe Context) (Generator Abstraction))
- (do {! phase.monad}
+ (do [! phase.monad]
[@begin _.make_label
[function_context bodyI] (case forced_context
(#.Some function_context)
@@ -341,7 +341,7 @@
(def: .public (call generate archive [functionS argsS])
(Generator Apply)
- (do {@ phase.monad}
+ (do [@ phase.monad]
[functionI (generate archive functionS)
argsI (monad.each @ (generate archive) argsS)
.let [applyI (|> argsI
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux
index 260d14ca8..1583cbed3 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux
@@ -38,7 +38,7 @@
(def: .public (recur translate archive argsS)
(Generator (List Synthesis))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[[@begin start] generation.anchor
.let [pairs (|> argsS
list.enumeration
@@ -70,7 +70,7 @@
(def: .public (scope translate archive [start initsS+ iterationS])
(Generator [Nat (List Synthesis) Synthesis])
- (do {@ phase.monad}
+ (do [@ phase.monad]
[@begin _.make_label
initsI+ (monad.each @ (translate archive) initsS+)
iterationI (generation.with_anchor [@begin start]
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux
index 1adc46589..204fddfa8 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux
@@ -38,7 +38,7 @@
(def: (foreign archive variable)
(-> Archive Register (Operation Inst))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[class_name (\ @ each //.class_name
(generation.context archive))]
(in (|>> (_.ALOAD 0)
@@ -61,7 +61,7 @@
(def: .public (constant archive name)
(-> Archive Name (Operation Inst))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[class_name (\ @ each //.class_name
(generation.remember archive name))]
(in (_.GETSTATIC (type.class class_name (list)) //.value_field //.$Value))))
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux
index 109c44b22..8e4e309de 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux
@@ -44,7 +44,7 @@
(def: .public (tuple generate archive members)
(Generator (List Synthesis))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[.let [size (list.size members)]
_ (phase.assertion ..not_a_tuple size
(n.>= 2 size))