diff options
Diffstat (limited to '')
7 files changed, 30 insertions, 30 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/common.lux b/new-luxc/source/luxc/lang/analysis/common.lux index 2f3e3a37d..95355d62f 100644 --- a/new-luxc/source/luxc/lang/analysis/common.lux +++ b/new-luxc/source/luxc/lang/analysis/common.lux @@ -14,7 +14,7 @@ (All [a] (-> (Meta a) (Meta [Type a]))) (do meta;Monad<Meta> [[_ varT] (&;with-type-env tc;var) - analysis (&;with-expected-type varT + analysis (&;with-type varT action) knownT (&;with-type-env (tc;clean varT))] (wrap [knownT analysis]))) diff --git a/new-luxc/source/luxc/lang/analysis/function.lux b/new-luxc/source/luxc/lang/analysis/function.lux index 5403026cb..611e5c8a4 100644 --- a/new-luxc/source/luxc/lang/analysis/function.lux +++ b/new-luxc/source/luxc/lang/analysis/function.lux @@ -77,7 +77,7 @@ ## also to themselves, through a local variable. (&scope;with-local [func-name expectedT]) (&scope;with-local [arg-name inputT]) - (&;with-expected-type outputT) + (&;with-type outputT) (analyse body)) _ diff --git a/new-luxc/source/luxc/lang/analysis/inference.lux b/new-luxc/source/luxc/lang/analysis/inference.lux index 080a6c620..cccaa774a 100644 --- a/new-luxc/source/luxc/lang/analysis/inference.lux +++ b/new-luxc/source/luxc/lang/analysis/inference.lux @@ -113,7 +113,7 @@ (function [_] (Cannot-Infer-Argument (format "Inferred Type: " (%type inputT) "\n" " Argument: " (%code argC)))) - (&;with-expected-type inputT + (&;with-type inputT (analyse argC)))] (wrap [outputT' (list& argA args'A)])) diff --git a/new-luxc/source/luxc/lang/analysis/procedure/common.lux b/new-luxc/source/luxc/lang/analysis/procedure/common.lux index be77e643c..a643cb76a 100644 --- a/new-luxc/source/luxc/lang/analysis/procedure/common.lux +++ b/new-luxc/source/luxc/lang/analysis/procedure/common.lux @@ -56,7 +56,7 @@ [_ (&;infer outputT) argsA (monad;map @ (function [[argT argC]] - (&;with-expected-type argT + (&;with-type argT (analyse argC))) (list;zip2 inputsT+ args))] (wrap (la;procedure proc argsA))) @@ -98,7 +98,7 @@ (do meta;Monad<Meta> [[var-id varT] (&;with-type-env tc;var) _ (&;infer (type (Either Text varT))) - opA (&;with-expected-type (type (io;IO varT)) + opA (&;with-type (type (io;IO varT)) (analyse opC))] (wrap (la;procedure proc (list opA)))) @@ -148,7 +148,7 @@ (^ (list valueC)) (do meta;Monad<Meta> [_ (&;infer (type Type)) - valueA (&;with-expected-type Type + valueA (&;with-type Type (analyse valueC))] (wrap valueA)) @@ -342,7 +342,7 @@ (do meta;Monad<Meta> [[var-id varT] (&;with-type-env tc;var) _ (&;infer (type (Atom varT))) - initA (&;with-expected-type varT + initA (&;with-type varT (analyse initC))] (wrap (la;procedure proc (list initA)))) diff --git a/new-luxc/source/luxc/lang/analysis/procedure/host.jvm.lux b/new-luxc/source/luxc/lang/analysis/procedure/host.jvm.lux index c6a456441..8f5382d2b 100644 --- a/new-luxc/source/luxc/lang/analysis/procedure/host.jvm.lux +++ b/new-luxc/source/luxc/lang/analysis/procedure/host.jvm.lux @@ -197,7 +197,7 @@ (do meta;Monad<Meta> [_ (&;infer Nat) [var-id varT] (&;with-type-env tc;var) - arrayA (&;with-expected-type (type (Array varT)) + arrayA (&;with-type (type (Array varT)) (analyse arrayC))] (wrap (la;procedure proc (list arrayA)))) @@ -210,7 +210,7 @@ (case args (^ (list lengthC)) (do meta;Monad<Meta> - [lengthA (&;with-expected-type Nat + [lengthA (&;with-type Nat (analyse lengthC)) expectedT meta;expected-type [level elem-class] (: (Meta [Nat Text]) @@ -303,12 +303,12 @@ (do meta;Monad<Meta> [[var-id varT] (&;with-type-env tc;var) _ (&;infer varT) - arrayA (&;with-expected-type (type (Array varT)) + arrayA (&;with-type (type (Array varT)) (analyse arrayC)) ?elemT (&;with-type-env (tc;read var-id)) [elemT elem-class] (box-array-element-type (maybe;default varT ?elemT)) - idxA (&;with-expected-type Nat + idxA (&;with-type Nat (analyse idxC))] (wrap (la;procedure proc (list (code;text elem-class) idxA arrayA)))) @@ -323,14 +323,14 @@ (do meta;Monad<Meta> [[var-id varT] (&;with-type-env tc;var) _ (&;infer (type (Array varT))) - arrayA (&;with-expected-type (type (Array varT)) + arrayA (&;with-type (type (Array varT)) (analyse arrayC)) ?elemT (&;with-type-env (tc;read var-id)) [valueT elem-class] (box-array-element-type (maybe;default varT ?elemT)) - idxA (&;with-expected-type Nat + idxA (&;with-type Nat (analyse idxC)) - valueA (&;with-expected-type valueT + valueA (&;with-type valueT (analyse valueC))] (wrap (la;procedure proc (list (code;text elem-class) idxA valueA arrayA)))) diff --git a/new-luxc/source/luxc/lang/analysis/structure.lux b/new-luxc/source/luxc/lang/analysis/structure.lux index 3048d4a4e..76b5a3a42 100644 --- a/new-luxc/source/luxc/lang/analysis/structure.lux +++ b/new-luxc/source/luxc/lang/analysis/structure.lux @@ -45,7 +45,7 @@ (case (list;nth tag flat) (#;Some variant-type) (do @ - [valueA (&;with-expected-type variant-type + [valueA (&;with-type variant-type (analyse valueC)) temp &scope;next-local] (wrap (la;sum tag type-size temp valueA))) @@ -54,7 +54,7 @@ (&common;variant-out-of-bounds-error expectedT type-size tag))) (#;Named name unnamedT) - (&;with-expected-type unnamedT + (&;with-type unnamedT (analyse-sum analyse tag valueC)) (#;Var id) @@ -63,7 +63,7 @@ (tc;read id))] (case ?expectedT' (#;Some expectedT') - (&;with-expected-type expectedT' + (&;with-type expectedT' (analyse-sum analyse tag valueC)) _ @@ -79,7 +79,7 @@ (<tag> _) (do @ [[instance-id instanceT] (&;with-type-env <instancer>)] - (&;with-expected-type (maybe;assume (type;apply (list instanceT) expectedT)) + (&;with-type (maybe;assume (type;apply (list instanceT) expectedT)) (analyse-sum analyse tag valueC)))) ([#;UnivQ tc;existential] [#;ExQ tc;var]) @@ -91,7 +91,7 @@ [?funT' (&;with-type-env (tc;read funT-id))] (case ?funT' (#;Some funT') - (&;with-expected-type (#;Apply inputT funT') + (&;with-type (#;Apply inputT funT') (analyse-sum analyse tag valueC)) _ @@ -105,7 +105,7 @@ (&;throw Not-Quantified-Type (%type funT)) (#;Some outputT) - (&;with-expected-type outputT + (&;with-type outputT (analyse-sum analyse tag valueC)))) _ @@ -123,14 +123,14 @@ ## If the tuple runs out, whatever expression is the last gets ## matched to the remaining type. [tailT (#;Cons tailC #;Nil)] - (&;with-expected-type tailT + (&;with-type tailT (analyse tailC)) ## If the type and the code are still ongoing, match each ## sub-expression to its corresponding type. [(#;Product leftT rightT) (#;Cons leftC rightC)] (do @ - [leftA (&;with-expected-type leftT + [leftA (&;with-type leftT (analyse leftC)) rightA (recur rightT rightC)] (wrap (` [(~ leftA) (~ rightA)]))) @@ -155,7 +155,7 @@ [tailT tailC] (do @ [g!tail (meta;gensym "tail")] - (&;with-expected-type tailT + (&;with-type tailT (analyse (` ("lux case" [(~@ tailC)] (~ g!tail) (~ g!tail)))))) @@ -173,7 +173,7 @@ (analyse-typed-product analyse membersC) (#;Named name unnamedT) - (&;with-expected-type unnamedT + (&;with-type unnamedT (analyse-product analyse membersC)) (#;Var id) @@ -182,7 +182,7 @@ (tc;read id))] (case ?expectedT' (#;Some expectedT') - (&;with-expected-type expectedT' + (&;with-type expectedT' (analyse-product analyse membersC)) _ @@ -199,7 +199,7 @@ (<tag> _) (do @ [[instance-id instanceT] (&;with-type-env <instancer>)] - (&;with-expected-type (maybe;assume (type;apply (list instanceT) expectedT)) + (&;with-type (maybe;assume (type;apply (list instanceT) expectedT)) (analyse-product analyse membersC)))) ([#;UnivQ tc;existential] [#;ExQ tc;var]) @@ -211,7 +211,7 @@ [?funT' (&;with-type-env (tc;read funT-id))] (case ?funT' (#;Some funT') - (&;with-expected-type (#;Apply inputT funT') + (&;with-type (#;Apply inputT funT') (analyse-product analyse membersC)) _ @@ -224,7 +224,7 @@ (&;throw Not-Quantified-Type (%type funT)) (#;Some outputT) - (&;with-expected-type outputT + (&;with-type outputT (analyse-product analyse membersC)))) _ diff --git a/new-luxc/source/luxc/lang/analysis/type.lux b/new-luxc/source/luxc/lang/analysis/type.lux index 4184dd0c0..eb3de08de 100644 --- a/new-luxc/source/luxc/lang/analysis/type.lux +++ b/new-luxc/source/luxc/lang/analysis/type.lux @@ -15,7 +15,7 @@ [actualT (eval Type type) #let [actualT (:! Type actualT)] _ (&;infer actualT)] - (&;with-expected-type actualT + (&;with-type actualT (analyse value)))) (def: #export (analyse-coerce analyse eval type value) @@ -23,5 +23,5 @@ (do meta;Monad<Meta> [actualT (eval Type type) _ (&;infer (:! Type actualT))] - (&;with-expected-type Top + (&;with-type Top (analyse value)))) |