diff options
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux index 40f4decd9..5e01a4ea0 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux @@ -1,13 +1,14 @@ (.module: [lux #* + ["." function] [control ["." monad (#+ do)]] [data ["." text format] [collection - ["." list ("list/." Functor<List> Monoid<List>)]]] - [platform + ["." list ("#/." functor monoid)]]] + [tool [compiler [reference (#+ Register)] ["." phase @@ -31,7 +32,7 @@ (def: #export (recur translate argsS) (-> Phase (List Synthesis) (Operation Inst)) - (do phase.Monad<Operation> + (do phase.monad [[@begin start] translation.anchor #let [end (|> argsS list.size dec (n/+ start)) pairs (list.zip2 (list.n/range start end) @@ -47,13 +48,13 @@ valuesI+ (monad.map @ (function (_ [register argS]) (: (Operation Inst) (if (constant? register argS) - (wrap id) + (wrap function.identity) (translate argS)))) pairs) #let [storesI+ (list/map (function (_ [register argS]) (: Inst (if (constant? register argS) - id + function.identity (_.ASTORE register)))) (list.reverse pairs))]] (wrap (|>> (_.fuse valuesI+) @@ -62,7 +63,7 @@ (def: #export (scope translate [start initsS+ iterationS]) (-> Phase [Nat (List Synthesis) Synthesis] (Operation Inst)) - (do phase.Monad<Operation> + (do phase.monad [@begin _.make-label initsI+ (monad.map @ translate initsS+) iterationI (translation.with-anchor [@begin start] |