[Haskell-cafe] Re: [Haskell] Making 'Super Nario Bros' in Haskell

2008-10-30 Thread Achim Schneider
Eli Ford [EMAIL PROTECTED] wrote: Is there a better way than IORefs The state Monad. Do you mean one state shared among all actors, like this? type MGame = State GameState newtype GameState = GameState { shared state } That gets part of the way, but I'm thinking of a

[Haskell-cafe] RE: [Haskell] Making 'Super Nario Bros' in Haskell

2008-10-29 Thread Achim Schneider
Eli Ford [EMAIL PROTECTED] wrote: Is there a better way than IORefs Without looking at the code: The state Monad. Imperative implementations of games are usually[1] modelled as finite automata, there's no reason to do it any different in a functional language. Add a bit of glue to translate

RE: [Haskell-cafe] RE: [Haskell] Making 'Super Nario Bros' in Haskell

2008-10-29 Thread Eli Ford
Is there a better way than IORefs The state Monad. Do you mean one state shared among all actors, like this? type MGame = State GameState newtype GameState = GameState { shared state } That gets part of the way, but I'm thinking of a situation where each instance of a