On Saturday, April 5, 2014, John M. Dlugosz <ngnr63q02@sneakemail.com> wrote:
On 4/4/2014 3:35 PM, Bob Ippolito wrote:
There's a function named iterate in Prelude:Nice. I followed up with that to understand how it's written.
λ> :info iterate
iterate :: (a -> a) -> a -> [a] -- Defined in `GHC.List'
λ> take 8 (iterate (\x -> 2 * x + 1) 0)
[0,1,3,7,15,31,63,127]
Now, how might I do something like that but "forget" previous values to free up memory?