summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-05-15 00:31:58 +1000
committerJed Barber <jjbarber@y7mail.com>2012-05-15 00:31:58 +1000
commit7a0eb21089bc60cf779469d04fe35632aec43f0e (patch)
tree65e990da9451d0acc85122c3e6e566b91af92f28
parent0ec171c9aa15390e8579c14d996d1f8be20b7b55 (diff)
Added a standard reference for a bool type
-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