aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/lux/language/compiler/synthesis.lux13
-rw-r--r--stdlib/source/lux/language/compiler/synthesis/expression.lux20
2 files changed, 20 insertions, 13 deletions
diff --git a/stdlib/source/lux/language/compiler/synthesis.lux b/stdlib/source/lux/language/compiler/synthesis.lux
index baea48c30..f4d7a6407 100644
--- a/stdlib/source/lux/language/compiler/synthesis.lux
+++ b/stdlib/source/lux/language/compiler/synthesis.lux
@@ -63,10 +63,14 @@
#arity Arity
#body s})
+(type: #export (Apply' s)
+ {#function s
+ #arguments (List s)})
+
(type: #export (Branch s)
- (#Case s (Path' s))
(#Let s Register s)
- (#If s s s))
+ (#If s s s)
+ (#Case s (Path' s)))
(type: #export (Scope s)
{#start Register
@@ -151,6 +155,9 @@
(type: #export Abstraction
(Abstraction' Synthesis))
+(type: #export Apply
+ (Apply' Synthesis))
+
(def: #export unit Text "")
(do-template [<name> <value>]
@@ -248,8 +255,8 @@
[branch/let #..Branch #..Let]
[branch/if #..Branch #..If]
- [loop/scope #..Loop #..Scope]
[loop/recur #..Loop #..Recur]
+ [loop/scope #..Loop #..Scope]
[function/abstraction #..Function #..Abstraction]
[function/apply #..Function #..Apply]
diff --git a/stdlib/source/lux/language/compiler/synthesis/expression.lux b/stdlib/source/lux/language/compiler/synthesis/expression.lux
index be20b7b0b..999d49b15 100644
--- a/stdlib/source/lux/language/compiler/synthesis/expression.lux
+++ b/stdlib/source/lux/language/compiler/synthesis/expression.lux
@@ -54,16 +54,6 @@
[tupleS (monad.map @ synthesize (analysis.tuple analysis))]
(wrap (#//.Structure (#//.Tuple tupleS)))))
- (#analysis.Apply _)
- (function.apply (|>> synthesize //.indirectly) analysis)
-
- (#analysis.Function environmentA bodyA)
- (function.function synthesize environmentA bodyA)
-
- (#analysis.Extension name args)
- (extension.apply (|>> synthesize //.indirectly)
- [name args])
-
(#analysis.Reference reference)
(case reference
(#reference.Constant constant)
@@ -91,4 +81,14 @@
(#analysis.Case inputA branchesAB+)
(case.synthesize (|>> synthesize //.indirectly) inputA branchesAB+)
+
+ (#analysis.Apply _)
+ (function.apply (|>> synthesize //.indirectly) analysis)
+
+ (#analysis.Function environmentA bodyA)
+ (function.function synthesize environmentA bodyA)
+
+ (#analysis.Extension name args)
+ (extension.apply (|>> synthesize //.indirectly)
+ [name args])
))