[Haskell-cafe] ghc has problems with 'zipWith' ?
Daniel Fischer
daniel.is.fischer at web.de
Wed Dec 8 07:14:48 EST 2004
Am Mittwoch, 8. Dezember 2004 10:22 schrieben Sie:
> On Tue, Dec 07, 2004 at 06:44:33PM +0100, Daniel Fischer wrote:
> > ms :: [Integer] -> [Integer]
> > ms as = zipWith (+) (zipWith (*) as (1:ms as)) (0:1:ms as)
>
> This version seems to be faster, but I don't know if it addresses your
> concern:
>
> ms as = let l = zipWith (+) (zipWith (*) as (1:l)) (0:1:l) in l
>
> Best regards,
> Tomasz
Thanks,
indeed, this seems to produce roughly the same performance as 'ps' and I have
a vague idea why this is better than 'pms', given that 'ms' is slower than
'ps'. But that is what baffled me in the first place, particularly because in
hugs, things are different.
Best regards,
Daniel
More information about the Haskell-Cafe
mailing list