On Thu, 3 Dec 2009, Emmanuel CHANTREAU wrote:

Hello

One thing is magic for me: how GHC can know what function results to
remember and what results can be forgotten ?

Is it just a stupid buffer algorithm or is there some mathematics
truths behind this ?

Although it is not required by the Haskell 98 report, the 'let' expression usually stores variable values (sharing) and top-level constants are also stored. I wonder how much of currently existing Haskell code would still work, if this would be changed, since this behavior is essential for memory usage and speed.
 If you want to cache function results, see:
  http://www.haskell.org/haskellwiki/Memoization
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to