[Icfp04-discuss] Re: haskell simulator performance

David Brown icfp04 at davidb.org
Wed Jun 9 18:21:08 EDT 2004


On Wed, Jun 09, 2004 at 12:07:36PM +1000, Ben Lippmeier wrote:

> What structure did you store the terrain in? After several false starts 
> with one or other of the umteen different kinds of Haskell arrays, I 
> ended up copping out and storing the whole lot in C land, using foreign 
> ccalls to access it from the IO monad.

I used an IOARRAY (Int, Int) Cell
data Cell
  = Rocky
  | Clear {
     cellFood    :: Int,
     cellMarkers :: Markers
     cellHill    :: Maybe Color
  }

where the index was (y, x).  Not the best performance, but not too bad.

Dave


More information about the Icfp04-discuss mailing list