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:
7d8ad02
)
exprIsHNF should "look through" lets
author
simonpj@microsoft.com
<unknown>
Tue, 17 Nov 2009 12:55:26 +0000
(12:55 +0000)
committer
simonpj@microsoft.com
<unknown>
Tue, 17 Nov 2009 12:55:26 +0000
(12:55 +0000)
I can't quite remember when I spotted this, but exprIsHNF (and
similarly exprIsConLike) should ignore enclosing let-bindings,
since they don't affect termination.
compiler/coreSyn/CoreUtils.lhs
patch
|
blob
|
history
diff --git
a/compiler/coreSyn/CoreUtils.lhs
b/compiler/coreSyn/CoreUtils.lhs
index
58beaf0
..
d200f81
100644
(file)
--- a/
compiler/coreSyn/CoreUtils.lhs
+++ b/
compiler/coreSyn/CoreUtils.lhs
@@
-736,6
+736,7
@@
exprIsHNFlike is_con is_con_unf = is_hnf_like
is_hnf_like (Cast e _) = is_hnf_like e
is_hnf_like (App e (Type _)) = is_hnf_like e
is_hnf_like (App e a) = app_is_value e [a]
+ is_hnf_like (Let _ e) = is_hnf_like e -- Lazy let(rec)s don't affect us
is_hnf_like _ = False
-- There is at least one value argument