aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/analysis/function.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-11-13 23:45:12 -0400
committerEduardo Julian2017-11-13 23:45:12 -0400
commit530a14bfe7714f94babdb34c237b88321408a685 (patch)
treee91f3059694f707a8b70c4b4adac2e3b6ec1553b /new-luxc/source/luxc/lang/analysis/function.lux
parent70005a6dee1eba3e3f5694aa4903e95988dcaa3d (diff)
- More refactoring.
Diffstat (limited to 'new-luxc/source/luxc/lang/analysis/function.lux')
-rw-r--r--new-luxc/source/luxc/lang/analysis/function.lux19
1 files changed, 8 insertions, 11 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/function.lux b/new-luxc/source/luxc/lang/analysis/function.lux
index 0bb46aba1..2a9826683 100644
--- a/new-luxc/source/luxc/lang/analysis/function.lux
+++ b/new-luxc/source/luxc/lang/analysis/function.lux
@@ -39,17 +39,14 @@
#;None
(&;throw Invalid-Function-Type (%type expectedT)))
-
- (#;UnivQ _)
- (do @
- [[var-id var] (&;with-type-env
- tc;existential)]
- (recur (maybe;assume (type;apply (list var) expectedT))))
- (#;ExQ _)
- (do @
- [[var-id var] (&;with-type-env tc;var)]
- (recur (maybe;assume (type;apply (list var) expectedT))))
+ (^template [<tag> <instancer>]
+ (<tag> _)
+ (do @
+ [[_ instanceT] (&;with-type-env <instancer>)]
+ (recur (maybe;assume (type;apply (list instanceT) expectedT)))))
+ ([#;UnivQ tc;existential]
+ [#;ExQ tc;var])
(#;Var id)
(do @
@@ -106,5 +103,5 @@
(format "\n " (%n idx) " " (%code argC))))
(text;join-with "")))))
(do meta;Monad<Meta>
- [[applyT argsA] (&inference;apply-function analyse funcT args)]
+ [[applyT argsA] (&inference;general analyse funcT args)]
(wrap (la;apply argsA funcA)))))