From: Matthijs Kooijman Date: Sun, 21 Jun 2009 11:58:15 +0000 (+0200) Subject: Make is_fun also work properly for Type CoreExprs. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;ds=sidebyside;h=2ca7af8f94b990f13d9ef299a889e2ad591759a2;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Make is_fun also work properly for Type CoreExprs. Previously, this would generate some debug output from exprType, which isn't properly defined for Type expressions. --- diff --git a/CoreTools.hs b/CoreTools.hs index a8dce3f..0bfe58f 100644 --- a/CoreTools.hs +++ b/CoreTools.hs @@ -98,4 +98,6 @@ is_lam _ = False -- Is the given core expression of a function type? is_fun :: CoreSyn.CoreExpr -> Bool -is_fun = Type.isFunTy . CoreUtils.exprType +-- Treat Type arguments differently, because exprType is not defined for them. +is_fun (CoreSyn.Type _) = False +is_fun expr = (Type.isFunTy . CoreUtils.exprType) expr