From: Matthijs Kooijman Date: Sun, 21 Jun 2009 15:22:40 +0000 (+0200) Subject: Add has_free_tyvars predicate. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=e12f07ce9f854a28bfc5bd607644644da03fb8d3;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add has_free_tyvars predicate. --- diff --git a/CoreTools.hs b/CoreTools.hs index 444a4ba..4cafec1 100644 --- a/CoreTools.hs +++ b/CoreTools.hs @@ -22,8 +22,10 @@ import qualified DynFlags import qualified SrcLoc import qualified CoreSyn import qualified Var +import qualified VarSet import qualified Unique import qualified CoreUtils +import qualified CoreFVs import GhcTools import HsTools @@ -117,3 +119,6 @@ is_var :: CoreSyn.CoreExpr -> Bool is_var (CoreSyn.Var _) = True is_var _ = False +-- Does the given CoreExpr have any free type vars? +has_free_tyvars :: CoreSyn.CoreExpr -> Bool +has_free_tyvars = not . VarSet.isEmptyVarSet . (CoreFVs.exprSomeFreeVars Var.isTyVar)