summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TypeVar.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/TypeVar.hs b/TypeVar.hs
index 904eab7..6196d63 100644
--- a/TypeVar.hs
+++ b/TypeVar.hs
@@ -58,13 +58,17 @@ instance Show Var where
mkEqualsType :: Type -> Type
-mkEqualsType ty = typeFunc (AType [] (TypeOp (Name [] "bool"))) (typeFunc ty ty)
+mkEqualsType ty = typeFunc typeBool (typeFunc ty ty)
typeFunc :: Type -> Type -> Type
typeFunc ty1 ty2 = AType [ty1,ty2] (TypeOp (Name [] "->"))
+typeBool :: Type
+typeBool = AType [] (TypeOp (Name [] "bool"))
+
+
typeVarsInType :: Type -> Set Type
typeVarsInType (TypeVar t) = Set.singleton (TypeVar t)
typeVarsInType (AType list _) = unions . (map typeVarsInType) $ list