[Haskell-cafe] memorize function with number parameterized types in GHC

Brandon Allbery allbery.b at gmail.com
Sun Nov 6 16:41:09 CET 2011

On Sun, Nov 6, 2011 at 10:31, Bin Jin <bjin1990 at gmail.com> wrote:

> Then how about p2num, how to memorize this function.
> 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.
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.


brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111106/f77fec51/attachment.htm>

More information about the Haskell-Cafe mailing list