it does, thank you very much for the quick answer, unfortunately as I understand it, it doesn't work well on ints :(<br><br>for just now i created a list <br><br>slowFunctionCacheList= [slowFunction (i) | i <-[0..5000000]]
<br>and use "slowFunctionCacheList !! i" instead of "slowFunction (i)"<br><br>it helped alot (i mean i stoped the program after "3 hours still working" and got the result in 2 minutes :))<br>
<br>i am still curious about a better method (and a general one), because this is ugly, and it only works on ints as i see it.<br><br>but then again thank you for telling me it doesn't do it, because i had the false impresion it does and i wouldn't stop it otherwise
<br><br><div><span class="gmail_quote">On 10/13/06, <b class="gmail_sendername">Tom Phoenix</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 10/12/06, Silviu Gheorghe <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:<br><br>> I'd like to know if the results are "cached" by the compiler<br><br>Hardly ever, as I understand things.
<br><br>> if they are not I'd like to know what is the best way to cache them<br>> manually, and where can I read more about this, and the optimizations the<br>> compiler does, because I've searched the web before and i found very little
<br>> on this topic.<br><br>You need to search for the word "memoize" (or "memoise"). Here's a<br>page about a memo function for GHC.<br><br> <a href="http://www.haskell.org/ghc/docs/6.4.2/html/hslibs/memo-library.html">
http://www.haskell.org/ghc/docs/6.4.2/html/hslibs/memo-library.html</a><br><br>Hope this helps!<br><br>--Tom Phoenix<br></blockquote></div><br>