Combinators for constructing reactive web programs. See
http://www.smlserver.org/smltojs/slides_diku_2007-11-27.pdf for an
introduction to the use of the combinators.
structure Rwp : RWP
signature RWP =
sigeqtype B eqtype E (* Kinds: Behaviors (B) and Events (E) *)
type ('a,'k)t
type 'a b = ('a, B)t (* Behaviors *)
type 'a e = ('a, E)t (* Events *)
(* Arrow operations *)
type ('a,'b,'k)arr = ('a,'k)t -> ('b,'k)t
valarr : (''b -> ''c) -> (''b,''c,'k) arr
val>>> : (''b,''c,'k)arr * (''c,''d,'k)arr -> (''b,''d,'k)arr
valfst : (''b,''c,'k)arr -> (''b*''d,''c*''d,'k)arr
valsnd : (''b,''c,'k)arr -> (''d*''b,''d*''c,'k)arr
val*** : (''b,''c,'k)arr * (''d,''e,'k)arr -> (''b*''d,''c*''e,'k)arr
val&&& : (''b,''c,'k)arr * (''b,''d,'k)arr -> (''b,''c*''d,'k)arr
(* Behavior operations *)
valtimer : int -> Time.time b
valtextField : string -> string b
valmouseOver : string -> bool b
valmouse : unit -> (int*int) b
valpair : ''a b * ''b b -> (''a * ''b) b
valtup3 : ''a b * ''b b * ''c b -> (''a * ''b * ''c) b
vallist : ''a b list -> ''a list b
valdelay : int -> (''a,''a,B)arr
valcalm : int -> (''a,''a,B)arr
valconst : ''a -> ''a b
valiff : bool b * ''a b * ''a b -> ''a b
valwhen : bool b * ''a b -> ''a b
valuntil : bool b * ''a b -> ''a b
valcurrent : ''a b -> ''a
valpoll : (unit -> ''a) -> int -> ''a b
valinsertDOM : string -> string b -> unit
valsetStyle : string -> (string * string b) -> unit
valsetAttr : string -> (string * string b) -> unit
valflatten : ''a b b -> ''a b
(* Event operations *)
valmerge : ''a e * ''a e -> ''a e
valfold : (''a * ''b -> ''b) -> ''b -> ''a e -> ''b e
valclick : string -> ''a -> ''a e
valempty : unit -> ''a e
(* Mixed and General operations *)
valchanges : ''a b -> ''a e
valhold : ''a -> ''a e -> ''a b
valsend : (''a,'k)t -> ''a -> unit
valaddListener : (''a,'k)t -> (''a -> unit) -> unit
(* Element operations *)
valinsertDOM_elem : Js.elem -> string b -> unit
valsetStyle_elem : Js.elem -> (string * string b) -> unit
valsetAttr_elem : Js.elem -> (string * string b) -> unit
valtextField_elem : Js.elem -> string b
valmouseOver_elem : Js.elem -> bool b
valclick_elem : Js.elem -> ''a -> ''a e
valmouse_elem : Js.elem -> (int*int) b
valmouse_doc : Js.doc -> (int*int) b
end
[type 'a b]
type of behavior with underlying values of type 'a.
[type 'a e]
type of event stream with underlying values of type 'a.
[type ('b,'c,'k)arr]
type of behavior (kind 'k = B) or event stream
(kind 'k = E) transformers from type 'b to type 'c.
returns a string behavior holding the current content
of an input field value identified by id. Raises Fail if there is no
element identified by id in the DOM.
[mouseover id]
returns a boolean behavior with a value indicating
whether the mouse is over the element identified by id. Raises Fail
if there is no element identified by id in the DOM.
returns the behavior that changes according to y when x
is true and otherwise does not change. The initial value of the
resulting behavior is identical to the current value of y. Sem[when(x,y)] =
\t.if Sem[x](t) then Sem[y](t) else Sem[y](t-delta).
returns the behavior that changes according to y until
x becomes true the first time. After this, the resulting behavior is
constant. The initial value of the resulting behavior is identical to
the current value of y.