[Haskell-cafe] GHCi and State

Roman Beslik beroal at ukr.net
Fri Jun 25 06:34:12 EDT 2010


  On 25.06.10 12:07, corentin.dupont at 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 store a set of rules in IORef or another IO-mutable type. I 
think "you are in the IO monad" is pretty vague. Obviously, GHCi runs 
pure computations also.

-- 
Best regards,
   Roman Beslik.



More information about the Haskell-Cafe mailing list