On Sat, 12 Jan 2008, David Benbennick wrote: > On 1/12/08, Henning Thielemann <[EMAIL PROTECTED]> wrote: > > Caching is not the default, but you can easily code this by yourself: > > Define an array and initialize it with all function values. Because of > > lazy evaluation the function values are computed only when they are > > requested and then they persist in the array. > > But how can I implement memoization for a more complicated function? > For example, perhaps I want to memoize > > f :: String -> Int -> Double -> String -> Bool
There was a long thread about a sophisticated technique called "blue prints", which allows you to use binary search trees as memoizing structure. http://www.haskell.org/pipermail/haskell-cafe/2006-September/018204.html _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe