Re: [GHC] #7994: Make foldl into a good consumer

#7994: Make foldl into a good consumer
-------------------------------------+------------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by nomeata):
Yesterday it looked as if this has magically improved, but at least with
the example from the ticket, put into self-contained as follows:
{{{#!haskell
module Foo( foo ) where
import Data.Complex
import Prelude hiding (sum, foldl)
foldl k z xs = foldr (\v fn z -> fn (k z v)) id xs z
{-# INLINE foldl #-}
sum = foldl (+) 0
{-# INLINE sum #-}
foo x = sum [f n | n <- [1 .. x]]
f :: Int -> Complex Double
{-# NOINLINE f #-}
f n = mkPolar 1 ((2*pi)/fromIntegral n) ^ n
}}}
I still get bad code:
{{{
Foo.$wfoo :: GHC.Prim.Int# -> Data.Complex.Complex GHC.Types.Double
[GblId,
Arity=1,
Str=DmdType
participants (1)
-
GHC