2 ms·
For those not wanting to click reload a slew of times (it took me about 3 minutes of clicking!)... //Sieve of Eratosthenes primes xs = sieve xs w
by michaelcampbell 11y ago
For those not wanting to click reload a slew of times (it took me about 3 minutes of clicking!)...
//Sieve of Eratosthenes
primes xs = sieve xs
where sieve [] = []
sieve (p::xs) =
& p :: sieve [& x \\ x <- xs | x % p > 0]
//Outputs: [2,3,5,7]
primes [2..10]