aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/scope.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/scope.lux')
-rw-r--r--new-luxc/source/luxc/scope.lux38
1 files changed, 19 insertions, 19 deletions
diff --git a/new-luxc/source/luxc/scope.lux b/new-luxc/source/luxc/scope.lux
index e15e01130..1dc5b932d 100644
--- a/new-luxc/source/luxc/scope.lux
+++ b/new-luxc/source/luxc/scope.lux
@@ -1,12 +1,12 @@
(;module:
lux
(lux (control monad)
- (data [text "T/" Eq<Text>]
+ (data [text]
text/format
- [maybe #+ Monad<Maybe> "Maybe/" Monad<Maybe>]
+ [maybe "maybe/" Monad<Maybe>]
[product]
["R" result]
- (coll [list "L/" Fold<List> Monoid<List>]))
+ (coll [list "list/" Fold<List> Monoid<List>]))
[macro])
(luxc ["&" base]))
@@ -25,7 +25,7 @@
(|> scope
(get@ [<slot> #;mappings])
(&;pl-get name)
- (Maybe/map (function [[type value]]
+ (maybe/map (function [[type value]]
[type (<then> value)]))))]
[#;locals is-local? get-local #;Local]
@@ -57,20 +57,20 @@
(#;Right [compiler #;None])
(#;Cons top-outer _)
- (let [[ref-type init-ref] (default (undefined)
- (get-ref name top-outer))
- [ref inner'] (L/fold (: (-> Scope [Ref (List Scope)] [Ref (List Scope)])
- (function [scope [ref inner]]
- [(#;Captured (get@ [#;captured #;counter] scope))
- (#;Cons (update@ #;captured
- (: (-> Captured Captured)
- (|>. (update@ #;counter n.inc)
- (update@ #;mappings (&;pl-put name [ref-type ref]))))
- scope)
- inner)]))
- [init-ref #;Nil]
- (list;reverse inner))
- scopes (L/append inner' outer)]
+ (let [[ref-type init-ref] (maybe;default (undefined)
+ (get-ref name top-outer))
+ [ref inner'] (list/fold (: (-> Scope [Ref (List Scope)] [Ref (List Scope)])
+ (function [scope [ref inner]]
+ [(#;Captured (get@ [#;captured #;counter] scope))
+ (#;Cons (update@ #;captured
+ (: (-> Captured Captured)
+ (|>. (update@ #;counter n.inc)
+ (update@ #;mappings (&;pl-put name [ref-type ref]))))
+ scope)
+ inner)]))
+ [init-ref #;Nil]
+ (list;reverse inner))
+ scopes (list/compose inner' outer)]
(#;Right [(set@ #;scopes scopes compiler)
(#;Some [ref-type ref])]))
))))
@@ -141,7 +141,7 @@
(#R;Success [compiler' output])
(#R;Success [(update@ #;scopes
- (|>. list;tail (default (list)))
+ (|>. list;tail (maybe;default (list)))
compiler')
output])
))