From: simonpj Date: Tue, 16 Dec 2003 14:27:31 +0000 (+0000) Subject: [project @ 2003-12-16 14:27:31 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~195 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=064a4bf8c981c8fe135a648b08d31f940f5693c6;p=ghc-hetmet.git [project @ 2003-12-16 14:27:31 by simonpj] comments only --- diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs index 67d1610..5111730 100644 --- 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 + -- 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