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. --- new-luxc/source/luxc/lang/analysis/function.lux | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'new-luxc/source/luxc/lang/analysis/function.lux') diff --git a/new-luxc/source/luxc/lang/analysis/function.lux b/new-luxc/source/luxc/lang/analysis/function.lux index 2a9826683..6a4a33e48 100644 --- a/new-luxc/source/luxc/lang/analysis/function.lux +++ b/new-luxc/source/luxc/lang/analysis/function.lux @@ -50,29 +50,21 @@ (#;Var id) (do @ - [? (&;with-type-env - (tc;concrete? id))] - (if ? - (do @ - [expectedT' (&;with-type-env - (tc;read id))] - (recur expectedT')) + [?expectedT' (&;with-type-env + (tc;read id))] + (case ?expectedT' + (#;Some expectedT') + (recur expectedT') + + _ ## Inference (do @ [[input-id inputT] (&;with-type-env tc;var) [output-id outputT] (&;with-type-env tc;var) #let [funT (#;Function inputT outputT)] funA (recur funT) - funT' (&;with-type-env - (tc;clean output-id funT)) - concrete-input? (&;with-type-env - (tc;concrete? input-id)) - funT'' (if concrete-input? - (&;with-type-env - (tc;clean input-id funT')) - (wrap (type;univ-q +1 (&inference;replace-var input-id +1 funT')))) _ (&;with-type-env - (tc;check expectedT funT''))] + (tc;check expectedT funT))] (wrap funA)) )) -- cgit v1.2.3