Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
eve :: (MonadIO m, Typeable m) => AppT AppState m () -> m AppState Source #
This runs your application. It accepts an initialization block (which
is the same as any other App
or Action
block, which
registers event listeners and event providers. Note that nothing in this
block should use dispatchEvent
since it is possible that not all listeners
have yet been registered. You can use the afterInit
trigger to dispatch
any events you'd like to run at start-up.
It is polymorphic in the Monad it operates over, so you may use it with any
custom base monad which implements MonadIO
.
If you don't need this functionality; the easiest way to get started is to simply call it like so:
import Eve initialize = App () initialize = do addListener ... ... startApp :: IO () startApp = eve_ initialize