From: Matthijs Kooijman <m.kooijman@student.utwente.nl>
Date: Wed, 19 Aug 2009 15:31:48 +0000 (+0200)
Subject: Add ty_has_free_tyvars predicate.
X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=96a32048f9da6c1ffb1c8fd95a617b7aa4e82e36;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git

Add ty_has_free_tyvars predicate.
---

diff --git "a/c\316\273ash/CLasH/Utils/Core/CoreTools.hs" "b/c\316\273ash/CLasH/Utils/Core/CoreTools.hs"
index bfe3971..bf2ca27 100644
--- "a/c\316\273ash/CLasH/Utils/Core/CoreTools.hs"
+++ "b/c\316\273ash/CLasH/Utils/Core/CoreTools.hs"
@@ -193,6 +193,10 @@ is_simple _ = False
 has_free_tyvars :: CoreSyn.CoreExpr -> Bool
 has_free_tyvars = not . VarSet.isEmptyVarSet . (CoreFVs.exprSomeFreeVars Var.isTyVar)
 
+-- Does the given type have any free type vars?
+ty_has_free_tyvars :: Type.Type -> Bool
+ty_has_free_tyvars = not . VarSet.isEmptyVarSet . Type.tyVarsOfType
+
 -- Does the given CoreExpr have any free local vars?
 has_free_vars :: CoreSyn.CoreExpr -> Bool
 has_free_vars = not . VarSet.isEmptyVarSet . CoreFVs.exprFreeVars