diff options
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux index a8006a772..17585b63c 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux @@ -1,22 +1,23 @@ (.module: [lux (#- function) [control - [monad (#+ do)]] + ["." monad (#+ do)]] [data ["." text format] [collection - [list ("list/" Functor<List> Monoid<List>)]]] - [language - ["_." reference (#+ Register Variable)] - ["." compiler - [analysis (#+ Arity)] - [synthesis (#+ Synthesis Abstraction Apply)] - ["." translation]]]] + ["." list ("list/." Functor<List> Monoid<List>)]]] + [compiler + [default + ["_." reference (#+ Register Variable)] + ["." phase + [analysis (#+ Arity)] + [synthesis (#+ Synthesis Abstraction Apply)] + ["." translation]]]]] [luxc [lang [host - ["$" jvm (#+ Label Inst Def Operation Compiler) + ["$" jvm (#+ Label Inst Def Operation Phase) ["." type] ["." def] ["_" inst]]]]] @@ -109,7 +110,7 @@ (def: (instance class arity env) (-> Text Arity (List Variable) (Operation Inst)) - (do compiler.Monad<Operation> + (do phase.Monad<Operation> [captureI+ (monad.map @ reference.variable env) #let [argsI (if (poly-arg? arity) (|> (nullsI (dec arity)) @@ -284,13 +285,13 @@ (with-reset class arity env) applyD ))] - (do compiler.Monad<Operation> + (do phase.Monad<Operation> [instanceI (instance class arity env)] (wrap [functionD instanceI])))) (def: #export (function translate [env arity bodyS]) - (-> Compiler Abstraction (Operation Inst)) - (do compiler.Monad<Operation> + (-> Phase Abstraction (Operation Inst)) + (do phase.Monad<Operation> [@begin _.make-label [function-class bodyI] (translation.with-context (translation.with-anchor [@begin +1] @@ -312,8 +313,8 @@ (list& pre (segment size post))))) (def: #export (call translate [functionS argsS]) - (-> Compiler Apply (Operation Inst)) - (do compiler.Monad<Operation> + (-> Phase Apply (Operation Inst)) + (do phase.Monad<Operation> [functionI (translate functionS) argsI (monad.map @ translate argsS) #let [applyI (|> (segment runtime.num-apply-variants argsI) |