[top]
-- Prime numbers written in Haskell -- Using infinite list and list comprehension primes = sieve [2..] sieve (x:xs) = x : sieve [ n | n <- xs, n `rem` x /= 0]