or primes = 2: 3: sieve [] (tail primes) 5 where sieve fs (p
s) x = [i | i<- [x,x+2..q-2], a!i] ++ sieve ((2*p,q):fs') ps (q+2) where q = p*p mults = [ [y+s,y+2*s..q] | (s,y)<- fs] fs' = [ (s,last ms) | ((s,_),ms)<- zip fs mults] a = accumArray (a b-False) True (x,q-2) [(i,()) | ms<- mults, i<- ms] Umm, really? I'd think if you see what that does, you won't have difficulties with a mutable array sieve.
_______________________________________________ Haskell-Cafe mailing list
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
http://www.haskell.org/mailman/listinfo/haskell-cafe