From 2ca7af8f94b990f13d9ef299a889e2ad591759a2 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 21 Jun 2009 13:58:15 +0200 Subject: [PATCH] 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. --- CoreTools.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.30.2