[Haskell-beginners] iterated function value sequence

John M. Dlugosz ngnr63q02 at sneakemail.com
Sun Apr 6 07:44:34 UTC 2014


On 4/5/2014 10:55 AM, Bob Ippolito wrote:
>     Now, how might I do something like that but "forget" previous values to free up memory?
>
>
> 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.
>
>
Say,
	zz = abs <$> numerator <$> iterate (\x->x^2-7%4) 0

and at some point I
	print $ zz!!30

How does the GC know that I'll never refer to zz!!n again where n < 30 ?



More information about the Beginners mailing list