↧
Answer by Will Ness for double stream feed to prevent unneeded memoization?
Normally, definition of primes stream in Richard Bird's formulation of the sieve of Eratosthenes is self-referential:import Data.List.Ordered (minus, union, unionAll)ps = 2 : minus [3..] -- `:` is...
View Articledouble stream feed to prevent unneeded memoization?
I'm new to Haskell and I'm trying to implement Euler's Sieve in stream processing style.When I checked the Haskell Wiki page about prime numbers, I found some mysterious optimization technique for...
View Article