projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf4d72c
)
Make is_fun also work properly for Type CoreExprs.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Sun, 21 Jun 2009 11:58:15 +0000
(13:58 +0200)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Sun, 21 Jun 2009 14:52:57 +0000
(16:52 +0200)
Previously, this would generate some debug output from exprType, which
isn't properly defined for Type expressions.
CoreTools.hs
patch
|
blob
|
history
diff --git
a/CoreTools.hs
b/CoreTools.hs
index a8dce3fab43ac345762307704a27b6d1e31592b3..0bfe58fa8fd4657149cf171e5295da54eb001559 100644
(file)
--- 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