diff options
Diffstat (limited to 'stdlib/source/lux/lang/synthesis/loop.lux')
-rw-r--r-- | stdlib/source/lux/lang/synthesis/loop.lux | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/stdlib/source/lux/lang/synthesis/loop.lux b/stdlib/source/lux/lang/synthesis/loop.lux index 4dcc25873..1b5d3401c 100644 --- a/stdlib/source/lux/lang/synthesis/loop.lux +++ b/stdlib/source/lux/lang/synthesis/loop.lux @@ -6,7 +6,8 @@ (coll [list "list/" Functor<List>])) (macro [code] [syntax])) - [///analysis #+ Register Variable Environment] + [///reference #+ Register Variable] + [///analysis #+ Environment] [// #+ Path Abstraction Synthesis]) (type: #export (Transform a) @@ -18,11 +19,11 @@ (#.Some _) true #.None false)) -(template: #export (self-reference) - (#//.Reference (#///analysis.Variable (#///analysis.Local +0)))) +(template: #export (self) + (#//.Reference (///reference.local +0))) (template: (recursive-apply args) - (#//.Apply (self-reference) args)) + (#//.Apply (self) args)) (def: proper Bool true) (def: improper Bool false) @@ -30,7 +31,7 @@ (def: (proper? exprS) (-> Synthesis Bool) (case exprS - (^ (self-reference)) + (^ (self)) improper (#//.Structure structure) @@ -82,7 +83,7 @@ (#//.Function functionS) (case functionS (#//.Abstraction environment arity bodyS) - (list.every? ///analysis.self? environment) + (list.every? ///reference.self? environment) (#//.Apply funcS argsS) (and (proper? funcS) @@ -162,7 +163,7 @@ (-> Environment (Transform Variable)) (function (_ variable) (case variable - (#///analysis.Foreign register) + (#///reference.Foreign register) (list.nth register environment) _ @@ -210,18 +211,16 @@ (#//.Reference reference) (case reference - (#///analysis.Constant constant) + (^ (///reference.constant constant)) (#.Some exprS) - - (#///analysis.Variable variable) - (case variable - (#///analysis.Local register) - (#.Some (#//.Reference (#///analysis.Variable (#///analysis.Local (n/+ offset register))))) - - (#///analysis.Foreign register) - (|> scope-environment - (list.nth register) - (maybe/map (|>> #///analysis.Variable #//.Reference))))) + + (^ (///reference.local register)) + (#.Some (#//.Reference (///reference.local (n/+ offset register)))) + + (^ (///reference.foreign register)) + (|> scope-environment + (list.nth register) + (maybe/map (|>> #///reference.Variable #//.Reference)))) (^ (//.branch/case [inputS pathS])) (do maybe.Monad<Maybe> |