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

Bin Jin bjin1990 at gmail.com
Sun Nov 6 16:51:36 CET 2011


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.

Also p2num is a general function used in number parameterized types, so I
asked this question here.
On Nov 6, 2011 11:41 PM, "Brandon Allbery" <allbery.b at gmail.com> wrote:

> 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.
>
> http://haskell.org/haskellwiki/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/19a21eb6/attachment.htm>


More information about the Haskell-Cafe mailing list