diff options
author | Eduardo Julian | 2017-10-11 18:57:44 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-11 18:57:44 -0400 |
commit | 74a835634fc9ee5457f3cc7109af069dad9f2d2f (patch) | |
tree | dec444467ecde32ac165627f782f315ac41567e8 /new-luxc/source/luxc/analyser/common.lux | |
parent | ccabfc6a5e41650788199cb8fd5d87731f094bcd (diff) |
- Migrated new-luxc to latest version of stdlib.
- Some refactoring.
Diffstat (limited to 'new-luxc/source/luxc/analyser/common.lux')
-rw-r--r-- | new-luxc/source/luxc/analyser/common.lux | 20 |
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) |