Re: [Haskell-cafe] Memoization local to a function

2009-02-26 Thread Dušan Kolář
Thanks for all the hints and code provided, nevertheless, it implied another questions: 1) Am I right that MemoCombinators can be hardly ever used with hugs? If not, which guidelines to be used for installation... 2) Is there any paper/tutorial/wiki that describes, which local definitions/expr

Re: [Haskell-cafe] Memoization local to a function

2009-02-26 Thread Dusan Kolar
Thanks for all the hints and code provided, nevertheless, it implied another questions: 1) Am I right that MemoCombinators can be hardly ever used with hugs? If not, which guidelines to be used for installation... 2) Is there any paper/tutorial/wiki that describes, which local definitions/expr

Re: [Haskell-cafe] Memoization local to a function

2009-02-25 Thread Henning Thielemann
On Wed, 25 Feb 2009, Luke Palmer wrote: On Wed, Feb 25, 2009 at 10:38 AM, Dusan Kolar wrote:  I have a function a computation of which is quite expensive, it is recursively dependent on itself with respect to some other function values - we can roughly model its behaviour w

Re: [Haskell-cafe] Memoization local to a function

2009-02-25 Thread Luke Palmer
On Wed, Feb 25, 2009 at 10:38 AM, Dusan Kolar wrote: > I have a function a computation of which is quite expensive, it is > recursively dependent on itself with respect to some other function values - > we can roughly model its behaviour with fib function (returns n-th number of > Fibonacci's se

RE: [Haskell-cafe] Memoization local to a function

2009-02-25 Thread Sittampalam, Ganesh
Dusan Kolar wrote: > Nevertheless, local version does not > work. Restructure your code like this: > fibL m = > let > allfib = 0:1:[allfib!!n + allfib!!(n+1) | n <- [0..]] > in allfib !! m fibL = let allfib = 0:1:[allfib!!n + allfib!!(n+1) | n <- [0..]] in \m -> allfib !! m i