On 25.06.2010 11:07, corentin.dup...@ext.mpsa.com wrote:

2. For now, the game is more or less playable in GHCi. But my concern is:
When you use GHCi, you are in the IO monad, right? How to had state to this
monad?
I would like that the player can compose his rule in GHCi, and when he is
done, he can submit it in GHCi with something like:

*Nomic>  submitRule<myrule>

You can use IORefs for this purpose. However you have to initialize the IORef before running the first action and then you must pass the IORef to every subsequent action.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to