summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-05-10 16:29:42 +1000
committerJed Barber <jjbarber@y7mail.com>2012-05-10 17:00:49 +1000
commite3ef1ba861661d2c20bb2ce79c6132704e7d12ed (patch)
treeefc122b1ce37359f77c02e10dd420193cc8e9b7c
parent8b9a9d2ce14159541de1a0a7a7ef533c1983a516 (diff)
typeOf definition fixed
-rw-r--r--Semantic.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Semantic.hs b/Semantic.hs
index 09c1b68..b58eac3 100644
--- a/Semantic.hs
+++ b/Semantic.hs
@@ -530,6 +530,11 @@ rename (TAbs (TVar v) t) varlist =
typeOf :: Term -> Type
typeOf (TConst c ty) = ty
+typeOf (TVar v) = varTy v
+typeOf (TAbs v t) = typeFunc (typeOf v) (typeOf t)
+typeOf (TApp f _) =
+ -- type of f is of the form [[a,b], "->"]
+ last . aType . typeOf $ f
mkEquals :: Term -> Term -> Term