
3 Dec
2009
3 Dec
'09
3:40 p.m.
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