<p>Yes, but I think it's not a funtion since the function didn't use the parameter. So maybe there is a way to make memorizing possible. </p>
<p>Also p2num is a general function used in number parameterized types, so I asked this question here.</p>
<div class="gmail_quote">On Nov 6, 2011 11:41 PM, "Brandon Allbery" <<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">On Sun, Nov 6, 2011 at 10:31, Bin Jin <span dir="ltr"><<a href="mailto:bjin1990@gmail.com" target="_blank">bjin1990@gmail.com</a>></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's okay to memorize this kind of function. The type system ensure all calling of montgKeys have the same type, e.g., it's a pure function without parameter, it's safe to memorize it since it didn'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" target="_blank">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) <a href="tel:%28412%29%20475-9364" value="+14124759364" target="_blank">(412) 475-9364</a> vm/sms<br><br>
</div>
</blockquote></div>