-
Notifications
You must be signed in to change notification settings - Fork 0
/
widget.urs
39 lines (29 loc) · 1.22 KB
/
widget.urs
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
(* General client-side GUI widgets *)
class t :: Type (* final value generated *)
-> Type (* internal state *)
-> Type
con t' (value :: Type, state :: Type) = t value state
val create : value ::: Type -> state ::: Type -> t value state -> transaction state
val initialize : value ::: Type -> state ::: Type -> t value state -> value -> transaction state
val asWidget : value ::: Type -> state ::: Type -> t value state -> state -> xbody
val value : value ::: Type -> state ::: Type -> t value state -> state -> signal value
val asValue : value ::: Type -> state ::: Type -> t value state -> value -> xbody
val make : value ::: Type -> state ::: Type
-> { Create : transaction state,
Initialize : value -> transaction state,
AsWidget : state -> xbody,
Value : state -> signal value,
AsValue : value -> xbody }
-> t value state
(* Some default widgets *)
type urlbox
val urlbox : t string urlbox
(* This one is earlier in the list so that [textbox] overrides it by default! *)
type textbox
val textbox : t string textbox
type checkbox
val checkbox : t bool checkbox
type intbox
val intbox : t int intbox
type timebox
val timebox : t time timebox