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