Re: [Haskell-cafe] GHCi and State

2010-07-02 Thread Matthias Görgens
Hi Corentin, Interesting. Have you thought about following the example of XMonad instead? The analogy could goes as follows: XMonad's configuration file (~/.xmonad/xmonad.hs) <=> Your rules. XMonad's state <=> Your state. Editing the config file <=> Changing the rules. Of course you normally ed

Re: [Haskell-cafe] GHCi and State

2010-06-28 Thread Henning Thielemann
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,

Re: [Haskell-cafe] GHCi and State

2010-06-28 Thread Martin Hilbig
hi, On 25.06.2010 11:07, corentin.dup...@ext.mpsa.com wrote: Another couple of reflexions (sorry for monopolizing): 1. Since i am making a Nomic game, players will have to submit rules. These rules will be written in a sub-set of haskell. Instead of writing my own reader/interpreter, i'd like

Re: Réf. : Re: [Haskell-cafe] GHCi and State

2010-06-25 Thread Tillmann Rendel
Hi Corentin, corentin.dup...@ext.mpsa.com schrieb: for GHCi, i will try an IORef. Too bad i allready coded it using "StateT GameState IO ()" extensively through the code ;) That shouldn't be a problem, you could switch back and forth in submitRule, approximately like this: startGame :: IO

Réf. : Re: [Haskell-cafe] GHCi and State

2010-06-25 Thread corentin . dupont
haskell-cafe@haskell.org Envoyé par : cc haskell-cafe-bou n...@haskell.orgObjet

Re: [Haskell-cafe] GHCi and State

2010-06-25 Thread Roman Beslik
On 25.06.10 12: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 c

Re: [Haskell-cafe] GHCi and State

2010-06-25 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/25/10 05:07 , corentin.dup...@ext.mpsa.com wrote: > Instead of writing my own reader/interpreter, i'd like to use GHC to compil > them on the fly, and then add them to the current "legislation". > What would you suggest me to do that? Any pointers

[Haskell-cafe] GHCi and State

2010-06-25 Thread corentin . dupont
Another couple of reflexions (sorry for monopolizing): 1. Since i am making a Nomic game, players will have to submit rules. These rules will be written in a sub-set of haskell. Instead of writing my own reader/interpreter, i'd like to use GHC to compil them on the fly, and then add them to the