Primzahlen

primes :: [ Int ]
primes = sieve $ enumFrom 2

enumFrom :: Int -> [ Int ]
enumFrom n = n : enumFrom ( n+1 )

sieve :: [ Int ] -> [ Int ]
sieve (x : xs) = x : ...



Johannes Waldmann 2014-07-10