From 7a0eb21089bc60cf779469d04fe35632aec43f0e Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Tue, 15 May 2012 00:31:58 +1000 Subject: Added a standard reference for a bool type --- TypeVar.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit