Re: [Haskell-cafe] ghc has problems with 'zipWith' ?

8 Dec
2004
8 Dec
'04
4:38 a.m.
Daniel Fischer wrote:
Hi, I have recently come across the curious phenomenon that ghci is sometimes much slower than hugs.
[...]
ms as = zipWith (+) (zipWith (*) as (1:ms as)) (0:1:ms as)
Hugs has(**) a specific optimisation for the case where the left hand side of the declaration occurs as a subexpression in the right hand side. You can get a similar benefit under ghci if you share the common subexpression by hand: ms' as = let bs = ms' as in zipWith (+) (zipWith (*) as (1:bs)) (0:1:bs) (**) I haven't actually seen the code in question, and am repeating something which was on one of the mailing lists a few years ago. So please don't treat this as authoritative! Regards, Tom
7472
Age (days ago)
7472
Last active (days ago)
0 comments
1 participants
participants (1)
-
Tom Pledger