Haskell caching results of a function
问题 I have a function that takes a parameter and produces a result. Unfortunately, it takes quite long for the function to produce the result. The function is being called quite often with the same input, that's why it would be convenient if I could cache the results. Something like let cachedFunction = createCache slowFunction in (cachedFunction 3.1) + (cachedFunction 4.2) + (cachedFunction 3.1) I was looking into Data.Array and although the array is lazy, I need to initialize it with a list of