prime package:primes
Efficient, purely functional generation of prime numbers
This Haskell library provides an efficient lazy wheel sieve for prime
generation inspired by Lazy wheel sieves and spirals of
primes by Colin Runciman and The Genuine Sieve of
Eratosthenes by Melissa O'Neil.
Yields the sorted list of prime factors of the given positive number.
This function uses trial division and is impractical for numbers with
very large prime factors.
This global constant is an infinite list of prime numbers. It is
generated by a lazy wheel sieve and shared across the whole program
run. If you are concerned about the memory requirements of sharing
many primes you can call the function wheelSieve directly.
Checks whether a given number is prime.
This function uses trial division to check for divisibility with all
primes below the square root of the given number. It is impractical
for numbers with a very large smallest prime factor.