Multidimensional Matrices in Haskell

Hi, A friend of mine wanted to do some Cellular Automata experiments in Haskell and was asking me what packages/libraries are there for multidimensional matrices. I'm interested in both immutable and mutable ones but I don't want them to be trapped inside a monad of any kind. Any hints? -- MM

Doesn't mutable state have to be held in a monad? If you want "mutable like behaviour" without a monad, you may want a tree or some other data structure. On Wed, 7 Jul 2010 17:08:48 +0300, you wrote:
Hi,
A friend of mine wanted to do some Cellular Automata experiments in Haskell and was asking me what packages/libraries are there for multidimensional matrices. I'm interested in both immutable and mutable ones but I don't want them to be trapped inside a monad of any kind.
Any hints? -- Regards, Casey

Hi Mihai,
A friend of mine wanted to do some Cellular Automata experiments in Haskell and was asking me what packages/libraries are there for multidimensional matrices. I'm interested in both immutable and mutable ones but I don't want them to be trapped inside a monad of any kind.
You may like to have a look at the recently released Repa library: http://hackage.haskell.org/package/repa There is a draft paper about it: http://www.cse.unsw.edu.au/~chak/papers/KCLPL10.html Manuel

I've found using Data.Vector works fine for this, just write an indexing function to handle the multiple dimensions. The gloss-examples package has a nice graphical demo of Conway's game of life that uses Vector. Gloss is specifically designed for beginners, so no monads required. The code for the demo is at: http://code.haskell.org/gloss/gloss-stable/examples/Conway/ and the gloss homepage is at: http://trac.haskell.org/gloss/ Ben. On 08/07/2010, at 12:08 AM, Mihai Maruseac wrote:
Hi,
A friend of mine wanted to do some Cellular Automata experiments in Haskell and was asking me what packages/libraries are there for multidimensional matrices. I'm interested in both immutable and mutable ones but I don't want them to be trapped inside a monad of any kind.
Any hints?
-- MM _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (4)
-
Ben Lippmeier
-
Casey Hawthorne
-
Manuel M T Chakravarty
-
Mihai Maruseac