On 2003-02-21T13:37:26-0500, Mike T. Machenry wrote:
> Eh, state is not possible. This is a recursive state space search. I need
> to branch the state of the game and not allow branches to effect others.
I see-- so you don't care about performing array updates in place,
because you will be copying
Ah, I see. Finite maps might be appropriate, then. Here's a sketch of
how you might implement arraylike objects with finite maps.
-- Array-like objects built from FiniteMaps
-- Dean Herington, Feb. 22, 2003
module FMArray (FMArray, fmArray, get, set, update) where
import Array
import FiniteMa
Eh, state is not possible. This is a recursive state space search. I need
to branch the state of the game and not allow branches to effect others.
Though I'd really like to represent them as arrays like such:
data Player = Red | Green | Blue deriving (Enum,Eq,Ix)
data Ticket = Taxi | Bus | Undergr
[moved to haskell-cafe]
While I largely agree with what Nils said, it does seem that arrays are a good match
for your application. It is true, unfortunately, as you're discovering, that
mutable arrays are awkward in a pure functional language. I think the most
appropriate way to deal with them w