From e12f07ce9f854a28bfc5bd607644644da03fb8d3 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 21 Jun 2009 17:22:40 +0200 Subject: [PATCH 1/1] Add has_free_tyvars predicate. --- CoreTools.hs | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.30.2