aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/analyser/common.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/analyser/common.lux')
-rw-r--r--new-luxc/source/luxc/analyser/common.lux20
1 files changed, 11 insertions, 9 deletions
diff --git a/new-luxc/source/luxc/analyser/common.lux b/new-luxc/source/luxc/analyser/common.lux
index c1246d81c..b9142713c 100644
--- a/new-luxc/source/luxc/analyser/common.lux
+++ b/new-luxc/source/luxc/analyser/common.lux
@@ -6,29 +6,31 @@
[product])
[macro #+ Monad<Lux>]
[type]
- (type ["TC" check]))
+ (type ["tc" check]))
(luxc ["&" base]
(lang analysis)))
(def: #export (with-unknown-type action)
(All [a] (-> (Lux Analysis) (Lux [Type Analysis])))
(do Monad<Lux>
- [[var-id var-type] (&;within-type-env
- TC;create-var)
+ [[var-id var-type] (&;with-type-env
+ tc;create)
analysis (&;with-expected-type var-type
action)
- analysis-type (&;within-type-env
- (TC;clean var-id var-type))
- _ (&;within-type-env
- (TC;delete-var var-id))]
+ analysis-type (&;with-type-env
+ (tc;clean var-id var-type))
+ _ (&;with-type-env
+ (tc;delete var-id))]
(wrap [analysis-type analysis])))
(def: #export (with-var body)
(All [a] (-> (-> [Nat Type] (Lux a)) (Lux a)))
(do Monad<Lux>
- [[id var] (&;within-type-env TC;create-var)
+ [[id var] (&;with-type-env
+ tc;create)
output (body [id var])
- _ (&;within-type-env (TC;delete-var id))]
+ _ (&;with-type-env
+ (tc;delete id))]
(wrap output)))
(def: #export (variant-out-of-bounds-error type size tag)