From: Matthijs Kooijman Date: Sun, 21 Jun 2009 15:23:13 +0000 (+0200) Subject: Add is_applicable predicate. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;ds=sidebyside;h=0273d87f3e6e8790ca7beb5a46bea8d478a89194;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add is_applicable predicate. This predicate should have been committed a few commits before. --- diff --git a/CoreTools.hs b/CoreTools.hs index 4cafec1..73904b9 100644 --- a/CoreTools.hs +++ b/CoreTools.hs @@ -119,6 +119,11 @@ is_var :: CoreSyn.CoreExpr -> Bool is_var (CoreSyn.Var _) = True is_var _ = False +-- Can the given core expression be applied to something? This is true for +-- applying to a value as well as a type. +is_applicable :: CoreSyn.CoreExpr -> Bool +is_applicable expr = is_fun expr || is_poly expr + -- 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)