
18 May
2008
18 May
'08
11:14 a.m.
Hello Luke, Sunday, May 18, 2008, 7:11:13 PM, you wrote:
primes :: Integral a => [a]
you might be computing the list of primes many times. Using a monomorphic signature like [Int] or [Integer] will allow primes to be cached, probably increasing the performance quite dramatically.
besides caching, polymorphism decreases performance many tens times -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com