aboutsummaryrefslogtreecommitdiff
path: root/lib/application/application.ml
blob: 15452fbfdb89c91eacc7adcdb6a593f94824666c (plain)
1
2
3
4
5
6
7
8
9
(** The type for the applcation *)
type ('a, 'b) t = 'a -> 'b -> 'b

(** Simple helper for the main event loop *)
let run
  : ?eq:('b -> 'b -> bool) -> ('a, 'b) t -> 'b -> 'a Note.E.t -> 'b Note.S.t
  = fun ?eq f init event ->
    let action = Note.E.map f event in
    Note.S.accum ?eq init action