definition module Gtk.State from StdMaybe import :: Maybe from Control.Applicative import class pure, class <*>, class Applicative from Control.Monad import class Monad from Data.Functor import class Functor from Data.Map import :: Map from Gtk.Shares import :: ShareId from Gtk.Signal import :: SignalHandlerInternal :: GtkState = { world :: !() , return :: !Bool , signal_handlers :: !Map Int SignalHandlerInternal , signal_counter :: !Int , timeouts :: !Map Int (GtkM Bool) , timeout_counter :: !Int , shares :: !Map ShareId Dynamic // TODO: make this map strict to be able to free references in it } :: GtkM a =: GtkM (GtkState -> (a, GtkState)) instance Functor GtkM instance pure GtkM instance <*> GtkM instance Monad GtkM newGtkState :: GtkState runGtk :: !(GtkM a) !*World -> (!a, !*World) getState :: GtkM GtkState modState :: !(GtkState -> GtkState) -> GtkM GtkState toState :: !(A.a: a -> a) -> GtkM () toStateR :: !(A.a: a -> (r,a)) -> GtkM r appWorld :: !(*World -> *World) -> GtkM () accWorld :: !(*World -> (r,*World)) -> GtkM r quit :: GtkM () runWhileEventsPending :: GtkM ()