On Sun, Nov 29, 2009 at 03:11:23PM +0100, papa.e...@free.fr wrote: > However, I wonder how to do it reusing the "pure" versions, > runGame and Strategy?
There's a nice approach to this problem which is described and implemented in the MonadPrompt package[1]. Basically you have prompt :: MonadPrompt p m => p a -> m a which allows you to interact with the outside world. The beauty here is that the interection is generic, you may write a pure simulator (like yours), an IO-heavy game (like what you're trying) and possibly more, like unit tests and property checks. Cheers, [1] http://hackage.haskell.org/package/MonadPrompt -- Felipe. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe