Hi Mike Try it and time it of course - there are a couple of libraries to help memo-izing on Hackage. Never having used them, but looking at the docs neither data-memocombinators or MemoTrie would seem to be straightforward for Data.Set, so a Word32 or some other number that is an instance of Bits would be a better choice.
My completely unfounded intuition is what you would gain by memoization you would loose by packing and unpacking the bit representation to something that can be read, printed or whatever else you need to do with it. The only algorithm I've transcribed for finding prime form is the one detailed by Paul Nelson here: http://composertools.com/Theory/PCSets.pdf This one goes out of Z12 at step 2 but if you were using a 24bit bit vector (e.g. Word32) it would still cope. Best wishes Stephen 2009/11/15 Michael Mossey <m...@alumni.caltech.edu>: > Hi Stephen, > > I will need a function that computes prime (normal?) form, of course, and it > is just begging to be memoized. I wonder if that is possible with Data.Set, > or whether it would be much faster using the bit vector representation? > > Thanks, > Mike > > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe