From 15121222d570f8fe3c5a326208e4f0bad737e63c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 31 Oct 2017 23:39:49 -0400 Subject: - Re-organized analysis. --- new-luxc/source/luxc/analyser/common.lux | 41 -------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 new-luxc/source/luxc/analyser/common.lux (limited to 'new-luxc/source/luxc/analyser/common.lux') diff --git a/new-luxc/source/luxc/analyser/common.lux b/new-luxc/source/luxc/analyser/common.lux deleted file mode 100644 index 4cbf5aedf..000000000 --- a/new-luxc/source/luxc/analyser/common.lux +++ /dev/null @@ -1,41 +0,0 @@ -(;module: - lux - (lux (control monad - pipe) - (data text/format - [product]) - [meta #+ Monad] - (meta [type] - (type ["tc" check]))) - (luxc ["&" base] - (lang analysis))) - -(def: #export (with-unknown-type action) - (All [a] (-> (Meta Analysis) (Meta [Type Analysis]))) - (do Monad - [[var-id var-type] (&;with-type-env - tc;create) - analysis (&;with-expected-type var-type - action) - 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] (Meta a)) (Meta a))) - (do Monad - [[id var] (&;with-type-env - tc;create) - output (body [id var]) - _ (&;with-type-env - (tc;delete id))] - (wrap output))) - -(def: #export (variant-out-of-bounds-error type size tag) - (All [a] (-> Type Nat Nat (Meta a))) - (&;fail (format "Trying to create variant with tag beyond type's limitations." "\n" - " Tag: " (%i (nat-to-int tag)) "\n" - "Size: " (%i (nat-to-int size)) "\n" - "Type: " (%type type)))) -- cgit v1.2.3