
28 Jun
2010
28 Jun
'10
2:38 p.m.
On 25.06.2010 11:07, corentin.dupont@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.