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:
de02e02
)
[project @ 2003-12-16 14:27:31 by simonpj]
author
simonpj
<unknown>
Tue, 16 Dec 2003 14:27:31 +0000
(14:27 +0000)
committer
simonpj
<unknown>
Tue, 16 Dec 2003 14:27:31 +0000
(14:27 +0000)
comments only
ghc/compiler/coreSyn/CoreUtils.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/coreSyn/CoreUtils.lhs
b/ghc/compiler/coreSyn/CoreUtils.lhs
index
67d1610
..
5111730
100644
(file)
--- a/
ghc/compiler/coreSyn/CoreUtils.lhs
+++ b/
ghc/compiler/coreSyn/CoreUtils.lhs
@@
-793,6
+793,11
@@
arityType (App f a) = case arityType f of
-- Case/Let; keep arity if either the expression is cheap
-- or it's a 1-shot lambda
-- Case/Let; keep arity if either the expression is cheap
-- or it's a 1-shot lambda
+ -- The former is not really right for Haskell
+ -- f x = case x of { (a,b) -> \y. e }
+ -- ===>
+ -- f x y = case x of { (a,b) -> e }
+ -- The difference is observable using 'seq'
arityType (Case scrut _ alts) = case foldr1 andArityType [arityType rhs | (_,_,rhs) <- alts] of
xs@(AFun one_shot _) | one_shot -> xs
xs | exprIsCheap scrut -> xs
arityType (Case scrut _ alts) = case foldr1 andArityType [arityType rhs | (_,_,rhs) <- alts] of
xs@(AFun one_shot _) | one_shot -> xs
xs | exprIsCheap scrut -> xs