I'm making an implementation of Grand Theft Wumpus using
reactive-banana. I'm using the slot machine example to work from.
For now, I'm just building a simple graph where a Player can move from
Node to Node. I'm not sure I have the Data Structures right, so I
wanted to run it by the community. I'm conceptualizing each Node (a
Street) and the Player as a Behavior. I reason that since the Graph
won't change, just the values inside a Node, I can update any Node as
needed, instead of creating a new Graph whenever a value in a Node
changes. It seems though, as I scale up, I'd end up with a big union
of Behaviors. Does it make sense to describe each Node as a Behavior?
Even though I'm starting simply, I intend to write a complete
implementiation.
http://nostarch.com/download/Lisp08.pdf
data StreetName = Baker
| Main
| Atlantic
| Baltic
| Connecticut
deriving (Enum,Bounded,Show)
type Player t = Behavior t Player_
type Street t = Behavior t Street_
data Player_ = Player {location :: StreetName } deriving Show
data Street_ = Street_ {sName :: StreetName
,player :: Maybe Player_
} deriving Show
data GameEvent = MovePlayer Street
| Look
does that look okay so far?