From 0273d87f3e6e8790ca7beb5a46bea8d478a89194 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 21 Jun 2009 17:23:13 +0200 Subject: [PATCH] Add is_applicable predicate. This predicate should have been committed a few commits before. --- CoreTools.hs | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.30.2