> 1) Using State GameState r and then call execState for each game event > (i.e. user input) so I can do IO > 2) Using StateT GameState IO () and have the entire game live in one > big execStateT call. (I note XMonad does something similar.)
I'm also interested in the answer to this question. One concern I would have about option 2 is that it looks like it "breaks encapsulation", to use a phrase from OOP. What I mean is, it seems like good design would mean that you could write and test the game logic totally independently of any IO. Game functions such as "makeMove" ought to have type signatures that don't involve any IO. Can this be achieved in option 2? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe