[Haskell-cafe] Prime sieve and Haskell demo
ky3 at atamo.com
Wed Apr 29 02:42:03 UTC 2015
On Wed, Apr 29, 2015 at 8:36 AM, Doug McIlroy <doug at cs.dartmouth.edu> wrote:
> I'm afraid I don't understand why the program isn't a sieve. Is
> the concern that the sequence of integers is thinned by dropping
> composites rather than by merely marking them and counting across
> them? Or is it that a trace of lazy evaluation will show that all
> the divisibility tests on a single integer are clustered together
> in time? Or something I haven't thought of?
When I reread Ertugrul's original email, I see that he's alerting to the
danger of derision. There will be people who will mock Haskell for having
an un-performant and un-Eratosthenian non-sieve on its front page.
As in, Haskell people don't even know their basic math, ha ha.
It used to be fibonaccis. That's too inviting of derision. Primes are more
noble, so the thinking goes.
That very small space on the face of Haskell must perform incredible
duties. Among them, it has to showcase beautiful syntax, see:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe