summaryrefslogtreecommitdiff
path: root/src/Gtk/State.dcl
blob: 389ce71429f7ace583993ed715bb2684d8a16abd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
	, shares          :: !Map ShareId Dynamic
	}

:: GtkM a =: GtkM (GtkState -> (a, GtkState))

instance Functor GtkM
instance pure GtkM
instance <*> GtkM
instance Monad GtkM
where
    (>>|) infixl 1 :: (GtkM a) (GtkM b) -> GtkM b

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 ()