From e3ef1ba861661d2c20bb2ce79c6132704e7d12ed Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Thu, 10 May 2012 16:29:42 +1000 Subject: typeOf definition fixed --- Semantic.hs | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit