projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6aa013b
)
[project @ 2001-11-05 16:45:02 by simonpj]
author
simonpj
<unknown>
Mon, 5 Nov 2001 16:45:02 +0000
(16:45 +0000)
committer
simonpj
<unknown>
Mon, 5 Nov 2001 16:45:02 +0000
(16:45 +0000)
Wibble to eta reduction
ghc/compiler/simplCore/SimplUtils.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/simplCore/SimplUtils.lhs
b/ghc/compiler/simplCore/SimplUtils.lhs
index
ffeb43c
..
51504c6
100644
(file)
--- a/
ghc/compiler/simplCore/SimplUtils.lhs
+++ b/
ghc/compiler/simplCore/SimplUtils.lhs
@@
-546,7
+546,11
@@
tryEtaReduce bndrs body
go [] (Var fun) | ok_fun fun = Just (Var fun) -- Success!
go _ _ = Nothing -- Failure!
- ok_fun fun = not (fun `elem` bndrs)
+ ok_fun fun = not (fun `elem` bndrs) &&
+ isEvaldUnfolding (idUnfolding fun)
+ -- The exprIsValue is because eta reduction is not
+ -- valid in general: \x. bot /= bot
+ -- So we need to be sure that the "fun" is a value.
ok_arg b arg = varToCoreExpr b `cheapEqExpr` arg
\end{code}