From 290c2389bc762dfaf625d72a76a675ce15119985 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 14 Nov 2017 01:14:26 -0400 Subject: - Yet more refactoring. --- .../source/luxc/lang/analysis/procedure/common.lux | 36 ---------------------- .../luxc/lang/analysis/procedure/host.jvm.lux | 12 ++++---- 2 files changed, 6 insertions(+), 42 deletions(-) (limited to 'new-luxc/source/luxc/lang/analysis/procedure') diff --git a/new-luxc/source/luxc/lang/analysis/procedure/common.lux b/new-luxc/source/luxc/lang/analysis/procedure/common.lux index fff5de504..3965e78ba 100644 --- a/new-luxc/source/luxc/lang/analysis/procedure/common.lux +++ b/new-luxc/source/luxc/lang/analysis/procedure/common.lux @@ -141,42 +141,6 @@ [lux//check typeA;analyse-check] [lux//coerce typeA;analyse-coerce]) -(def: (clean-type inputT) - (-> Type (tc;Check Type)) - (case inputT - (#;Primitive name paramsT+) - (do tc;Monad - [paramsT+' (monad;map @ clean-type paramsT+)] - (wrap (#;Primitive name paramsT+'))) - - (^or #;Void #;Unit (#;Bound _) (#;Ex _) (#;Named _)) - (:: tc;Monad wrap inputT) - - (^template [] - ( leftT rightT) - (do tc;Monad - [leftT' (clean-type leftT) - rightT' (clean-type rightT)] - (wrap ( leftT' rightT')))) - ([#;Sum] [#;Product] [#;Function] [#;Apply]) - - (#;Var id) - (do tc;Monad - [? (tc;concrete? id)] - (if ? - (do @ - [actualT (tc;read id)] - (clean-type actualT)) - (wrap inputT))) - - (^template [] - ( envT+ unquantifiedT) - (do tc;Monad - [envT+' (monad;map @ clean-type envT+)] - (wrap ( envT+' unquantifiedT)))) - ([#;UnivQ] [#;ExQ]) - )) - (def: (lux//check//type proc) (-> Text Proc) (function [analyse eval args] 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 39ca0eb43..cd5fdc7bb 100644 --- a/new-luxc/source/luxc/lang/analysis/procedure/host.jvm.lux +++ b/new-luxc/source/luxc/lang/analysis/procedure/host.jvm.lux @@ -305,9 +305,9 @@ _ (&;infer varT) arrayA (&;with-expected-type (type (Array varT)) (analyse arrayC)) - elemT (&;with-type-env - (tc;read var-id)) - [elemT elem-class] (box-array-element-type elemT) + ?elemT (&;with-type-env + (tc;read var-id)) + [elemT elem-class] (box-array-element-type (maybe;default varT ?elemT)) idxA (&;with-expected-type Nat (analyse idxC))] (wrap (la;procedure proc (list (code;text elem-class) idxA arrayA)))) @@ -325,9 +325,9 @@ _ (&;infer (type (Array varT))) arrayA (&;with-expected-type (type (Array varT)) (analyse arrayC)) - elemT (&;with-type-env - (tc;read var-id)) - [valueT elem-class] (box-array-element-type elemT) + ?elemT (&;with-type-env + (tc;read var-id)) + [valueT elem-class] (box-array-element-type (maybe;default varT ?elemT)) idxA (&;with-expected-type Nat (analyse idxC)) valueA (&;with-expected-type valueT -- cgit v1.2.3