fork(1) download
  1. primes = 2 : filter isPrime [3..]
  2. isPrime 1 = False
  3. isPrime x = check primes where
  4. check (p:ps) | p*p > x = True
  5. | x `mod` p == 0 = False
  6. | otherwise = check ps
  7.  
  8. main = print $ length $ takeWhile (<1000000) primes
Success #stdin #stdout 1.06s 8280KB
stdin
Standard input is empty
stdout
78498