Hello.
usual wxHaskell program looks like
main = do
run gui
gui = do
....
....
gui must have type IO a
, run has type IO a -> IO ()
, also there is some initialization routines in run
.
I'm tring to do following:
data AppGlobals = AG { ... some data ... }
type MApp a = StateT AppGlobals IO a
But in this case gui must have type gui :: MApp AppGlobals
. Due to it's type it becomes impossible to use usual IO monad syntax, I mean Ihave to use liftIO
every time I performing IO action.
Is there Any convinient possibility to use State monad in wxHaskell? It's not very convinient to pass state to each event handler manually.