[Haskell-cafe] Looking for the fastest Haskell primes algorithm

Martijn van Steenbergen martijn at van.steenbergen.nl
Tue Apr 14 09:01:54 EDT 2009

Niemeijer, R.A. wrote:
> Since it’s such a common problem I’d say it would be a good idea to add 
> a package to Hackage that exports
> primes :: [Integer]
> and hides the ugly implementation details. Data.Numbers.Primes seems a 
> logical choice for the namespace, but I’m open to suggestions.

Excellent idea.

Picking the most efficient implementation from the start isn't really 
necessary; if you find a faster implementation later you can just upload 
a new version. The API is unlikely to change in such a case anyway.


More information about the Haskell-Cafe mailing list