<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>I was reading this article:</div><div><br></div><a href="http://scienceblogs.com/goodmath/2009/11/writing_basic_functions_in_has.php">http://scienceblogs.com/goodmath/2009/11/writing_basic_functions_in_has.php</a><br clear="all">

<br><div>And came to the part where it shows:</div><div><br></div><div><span class="Apple-style-span" style="font-family: &#39;Trebuchet MS&#39;, Arial, Verdana, Geneva, Helvetica, sans-serif; font-size: 12px; line-height: 16px; "><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 12px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; ">

&gt; fiblist = 0 : 1 : (zipWith (+) fiblist (tail fiblist))
</pre><div><br></div></span></div><div>Very interesting stuff for somebody who comes from an imperative world of course.</div><div>But then I read that &quot;<span class="Apple-style-span" style="font-family: &#39;Trebuchet MS&#39;, Arial, Verdana, Geneva, Helvetica, sans-serif; font-size: 12px; line-height: 16px; ">Once it&#39;s been referenced, then the list up to where you looked is concrete - the computations <em style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 12px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; ">won&#39;t</em> be repeated.</span>&quot;</div>

<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>and I started wondering how that works.</div><div>Because this seems to mean that functions could have unknown (to the caller) memory requirements.</div>

<div>How does one, programming in Haskell, keep that in check?</div><div>And when does that memory get reclaimed?</div><div><br></div><div>Cheers,<br>-Tako<br>
</div>