<div dir="ltr">On Sun, Nov 6, 2011 at 10:31, Bin Jin <span dir="ltr">&lt;<a href="mailto:bjin1990@gmail.com">bjin1990@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<p>Then how about p2num, how to memorize this function.</p>
<p>Also I think it&#39;s okay to memorize this kind of function. The type system ensure all calling of montgKeys have the same type, e.g., it&#39;s a pure function without parameter, it&#39;s safe to memorize it since it didn&#39;t occupy more memory than representing dynamic generated types.</p>
</blockquote><div>Did you read the wiki page you were pointed to?  ghc never memoizes functions by itself; the page provides pointers to a number of ways that you can add memoization, along with pointers to discussion of why there is no automated memoization.</div>
<div><br></div><div><a href="http://haskell.org/haskellwiki/Memoization">http://haskell.org/haskellwiki/Memoization</a></div></div><div><br></div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>
wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br><br>
</div>