Re: [Haskell-cafe] Memoisation + unsafePerformIO

2007-07-09 Thread Ryan Ingram
Funny that you mention using unsafePerformIO to do memoizing; I just implemented it a couple of days ago to familiarize myself with techniques that use global state. Here's my implementation which uses trees (Data.Map). module Memoize (memoize, memoizefix) where import System.IO.Unsafe import qu

Re: [Haskell-cafe] Memoisation + unsafePerformIO

2007-07-08 Thread Tim Chevalier
You might look at this paper: http://research.microsoft.com/Users/simonpj/Papers/weak.htm "Stretching the storage manager: weak pointers and stable names in Haskell" - Simon Peyton Jones, Simon Marlow, and Conal Elliott, IFL'99. It describes a solution to exactly the problem you're trying to solv

[Haskell-cafe] Memoisation + unsafePerformIO

2007-07-08 Thread Tony Morris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello everyone, I am trying to write a generalisation of memoisation for a couple of backtracking algorithms that I wrote (which don't specify a memoisation technique), by keeping a local destructive update using unsafePerformIO and IORef - neither of

Re: [Haskell-cafe] Memoisation

2007-02-25 Thread Jeremy Shaw
At Mon, 26 Feb 2007 07:54:56 +1000, Tony Morris wrote: > > [1 ] > [1.1 ] > I have a backtracking algorithm that I need to memoise with. Rather than > go into the intricacies of the algorithm, I figure (and hope) the > factorial function is trivial enough to point out my problem. Have you seen t

Re: [Haskell-cafe] Memoisation

2007-02-25 Thread Bryan Burgers
On 2/25/07, Tony Morris <[EMAIL PROTECTED]> wrote: I have a backtracking algorithm that I need to memoise with. Rather than go into the intricacies of the algorithm, I figure (and hope) the factorial function is trivial enough to point out my problem. Simply, suppose I wish to calculate the fact

[Haskell-cafe] Memoisation

2007-02-25 Thread Tony Morris
I have a backtracking algorithm that I need to memoise with. Rather than go into the intricacies of the algorithm, I figure (and hope) the factorial function is trivial enough to point out my problem. Simply, suppose I wish to calculate the factorial of 10, then "later" the factorial of 5. I have