Sha256: f1f922e9d9e77d7376ca0484eda79aa10f1fdbf49d3e065116d314ef23cbac08
Contents?: true
Size: 289 Bytes
Versions: 79
Compression:
Stored size: 289 Bytes
Contents
module Sieve let rec private sieve remainder primes = match remainder with | [] -> primes |> List.rev | p::xs -> sieve (xs |> List.filter (fun x -> x % p > 0)) (p :: primes) let primes limit = let possiblePrimes = [2 .. limit] sieve possiblePrimes []
Version data entries
79 entries across 79 versions & 1 rubygems