
On Nov 29, 2007 4:45 PM, Felipe Lessa
Why don't you use an UArray of Bools? They're implemented as bit arrays internally, AFAIK (e.g. see http://www.haskell.org/haskellwiki/Shootout/Nsieve ). And then you would get rid of a lot of shifts and masks in your code -- clearer and faster, the Haskell Way (TM).
fill, fillE and fillS are all looking at a integer value, and not doing any array access. I'm skeptical that an array of bools, even if its internally a mask on an int, could be faster.
Well, I guess it would be faster, but I can't really tell. Could you provide a main function implementing an "use case" for benchmark?
Sure, here is one http://hpaste.org/4151#a1 Compile with: ghc -O2 --make Test.hs It runs a random rule for 1000 steps. Justin