Primzahlen

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

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

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



Johannes Waldmann 2011-01-18