summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-09-22 20:04:19 +1000
committerJed Barber <jjbarber@y7mail.com>2012-09-22 20:04:19 +1000
commit271bfd69c10cfd0e20d696f6d79b04e9b5ca28d8 (patch)
tree3f4230521fb3b8afac75f6d8f3789dbb42ff9307
parent1f0fff649092f69a796cc7c8724608568c14d8d4 (diff)
Added a function to check whether a given type is a type variable
-rw-r--r--Library/TypeVar.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/TypeVar.hs b/Library/TypeVar.hs
index fbb06a6..078d5d3 100644
--- a/Library/TypeVar.hs
+++ b/Library/TypeVar.hs
@@ -14,7 +14,8 @@ module Library.TypeVar (
mkEqualsType,
typeFunc,
typeBool,
- typeVarsInType
+ typeVarsInType,
+ isTypeVar
) where
@@ -75,3 +76,9 @@ typeBool = AType [] (TypeOp (Name [] "bool"))
typeVarsInType :: Type -> Set.Set Type
typeVarsInType (TypeVar t) = Set.singleton (TypeVar t)
typeVarsInType (AType list _) = Set.unions . (map typeVarsInType) $ list
+
+
+isTypeVar :: Type -> Bool
+isTypeVar (TypeVar _) = True
+isTypeVar _ = False
+