@apfelmus,

please read my code. I introduced DivIter to separate divstep from divisions.
But it stores intsqrt dividend also. Thus the sqrt is only recomputed, when a
new factor is found.

Concerning primes': With the sieve of Eratosthenes we cannot make a lazy list,
we need the whole list at any point of computation. And beyond the end we fall
back to x -> x+2.

This is the difference to the list of summands i proposed. And we have the
arbitrary choice of [2,4], [2,4,2,4,2,4,2,6,2,6] or any longer.

Concerning State: There is useful instruction by Ryan Ingram too here. I will
study that and yours. Thank you !

Cheers, Joost







_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to