Possible Duplicate:
When is memoization automatic in GHC Haskell?
I understand that due to referential transparency in Haskell programs, it should be nearly trivial to memoize most functions. Does the compiler (GHC) do any of this? If so, is there an easy way to determine which functions are getting memoized? (Eg. Using the profiler. Preferably without needing to know Assembly)
If not, is there idiomatic way to do memoization in Haskell? In C/C++/Java I usually have a static or global variable that maps inputs to the computed results but I can't think of a way to represent that in Haskell.