On Saturday, April 5, 2014, John M. Dlugosz <<a href="mailto:ngnr63q02@sneakemail.com">ngnr63q02@sneakemail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 4/4/2014 3:35 PM, Bob Ippolito wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There's a function named iterate in Prelude:<br>
<br>
λ> :info iterate<br>
iterate :: (a -> a) -> a -> [a] -- Defined in `GHC.List'<br>
λ> take 8 (iterate (\x -> 2 * x + 1) 0)<br>
[0,1,3,7,15,31,63,127]<br>
<br>
</blockquote>
Nice.  I followed up with that to understand how it's written.<br>
<br>
Now, how might I do something like that but "forget" previous values to free up memory?<br>
</blockquote><div><br></div><div>Garbage Collection does that for you. If all the references are gone, the memory can be freed. If you have a specific use in mind I can show you what that looks like.</div>