"Silviu Gheorghe" <[EMAIL PROTECTED]> writes:

> slowFunctionCacheList= [slowFunction (i) | i <-[0..5000000]]
> and use "slowFunctionCacheList !! i" instead of "slowFunction (i)"

> i am still curious about a better method (and a general one)

Not much different in principle, but better in practice - you could
use an array rather than a list.  O(1) lookups should make things (a
lot) faster.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to