
18 May
2008
18 May
'08
11:11 a.m.
On Sat, May 17, 2008 at 11:45 PM, Jeroen
I only tested with -O2 and my primes implementation is the Sieve of Eratosthenes and has signature
primes :: Integral a => [a]
I'm guessing that you already know this, but this declares that primes should *not* be cached globally (and is the reason for the monomorphism restriction). Depending on how it is used, it means that 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. Luke