On Sat, May 17, 2008 at 11:45 PM, Jeroen <[EMAIL PROTECTED]> wrote:
> 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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to