diff options
author | Camil Staps | 2019-10-19 19:57:53 +0200 |
---|---|---|
committer | Camil Staps | 2019-10-20 09:11:19 +0200 |
commit | ad98343da1467653dacc811a9e52b7da2282c200 (patch) | |
tree | 159ee3beadf5ddb022d1640ba441aebee7f39a54 /src/Gtk/State.dcl |
Initial commit
Diffstat (limited to 'src/Gtk/State.dcl')
-rw-r--r-- | src/Gtk/State.dcl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Gtk/State.dcl b/src/Gtk/State.dcl new file mode 100644 index 0000000..d750900 --- /dev/null +++ b/src/Gtk/State.dcl @@ -0,0 +1,28 @@ +definition module Gtk.State + +from StdMaybe import :: Maybe + +from Control.Applicative import class pure +from Control.Monad.State import :: State, :: StateT, + instance pure (StateT m s) +from Control.Monad.Identity import :: Identity, + instance pure Identity +from Data.Map import :: Map + +from Gtk.Signal import :: GSignalHandlerInternal + +:: GtkState = + { world :: !() + , return :: !Bool + , signal_handlers :: !Map Int GSignalHandlerInternal + , signal_counter :: !Int + } + +newGtkState :: GtkState + +runGtk :: !(State GtkState a) !*World -> (!a, !*World) + +toState :: !(A.a: a -> a) -> State GtkState () +toStateR :: !(A.a: a -> (r,a)) -> State GtkState r + +quit :: State GtkState () |