fork 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 (<100000) primes
Success #stdin #stdout 0.06s 6232KB
stdin
Standard input is empty
stdout
9592