Re: Re[Haskell-cafe] [2]: memoization

2009-09-10 Thread staafmeister
Hi Bulat, Bulat Ziganshin-2 wrote: Hello staafmeister, Thursday, September 10, 2009, 3:54:34 PM, you wrote: What do you think about such a function? This function is a bit of refactoring -- global variable in haskell way cache = unsafePerformIO $ newIORef M.empty memo f x =

Re[2]: Re[Haskell-cafe] [2]: memoization

2009-09-10 Thread Bulat Ziganshin
Hello staafmeister, Thursday, September 10, 2009, 4:23:26 PM, you wrote: This doesn't work and is exactly what I'm afraid the compiler is going to do. Cache needs to be associated with the function f. Otherwise one would get conflicts well, technique i used is well known, we would have

Re: Re[Haskell-cafe] [2]: memoization

2009-09-10 Thread mf-hcafe-15c311f0c
On Thu, Sep 10, 2009 at 05:23:26AM -0700, staafmeister wrote: To: haskell-cafe@haskell.org From: staafmeister g.c.stave...@uu.nl Date: Thu, 10 Sep 2009 05:23:26 -0700 (PDT) Subject: Re: Re[Haskell-cafe] [2]: memoization Hi Bulat, Bulat Ziganshin-2 wrote: Hello staafmeister

Fwd: Re[Haskell-cafe] [2]: memoization

2009-09-10 Thread Alberto G. Corona
: Re: Re[Haskell-cafe] [2]: memoization Hi Bulat, Bulat Ziganshin-2 wrote: Hello staafmeister, Thursday, September 10, 2009, 3:54:34 PM, you wrote: What do you think about such a function? This function is a bit of refactoring -- global variable in haskell

Re: Re[Haskell-cafe] [2]: memoization

2009-09-10 Thread Alberto G. Corona
, staafmeister wrote: To: haskell-cafe@haskell.org From: staafmeister g.c.stave...@uu.nl Date: Thu, 10 Sep 2009 05:23:26 -0700 (PDT) Subject: Re: Re[Haskell-cafe] [2]: memoization Hi Bulat, Bulat Ziganshin-2 wrote: Hello staafmeister, Thursday, September 10, 2009, 3:54:34 PM