Closed b-mehta closed 6 years ago
Added orderedPrimes for ordered Gaussian primes. primes may still be faster since...
IMHO the drawback of cluttering API with two similar but different functions overweights potential fusion losses. If in some circumstances this happens to be a critical performance bottleneck, a user can reimplement old primes
using findPrimes
. That said, my vote is to replace old primes
with a sorted one, instead of introducing a new entry. What do you think?
Sounds good - any other changes you'd suggest?
Everything else look good to me.
Resolves #122.
Added
orderedPrimes
for ordered Gaussian primes.primes
may still be faster sinceData.List.partition
does not appear to fuse as a producer, even though it does fuse as a consumer and thusprimes
is retained also. That said, it may be hard to do a side-by-side comparison of the two as they have different use cases.I've also changed the documentation for
primes
: It does not produce all the Gaussian primes (for instance -1-i is never produced), but it does produce them all up to associates.