From 2e29673fa970b814c97d5838963de49c2a65424b Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Mon, 7 Feb 2022 13:43:24 +0100 Subject: Rename application functions --- lib/application/application.ml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/application') diff --git a/lib/application/application.ml b/lib/application/application.ml index 789bd80..422aa4f 100755 --- a/lib/application/application.ml +++ b/lib/application/application.ml @@ -48,7 +48,7 @@ module Make(S:sig type t end) = struct type t - val update: t -> S.t -> S.t + val process: t -> S.t -> S.t end @@ -58,8 +58,16 @@ module Make(S:sig type t end) = struct let run : ?eq:(S.t -> S.t -> bool) -> S.t -> event Note.E.t -> S.t Note.S.t = fun ?eq init event -> - let action = Note.E.map (fun (E (t, (module Event))) st -> Event.update t st) event in + let action = Note.E.map (fun (E (t, (module Event))) st -> Event.process t st) event in Note.S.accum ?eq init action + + let dispatch + : (module Event with type t = 's) -> 's -> event + = fun (type s) (module M: Event with type t = s) v -> + E + ( v + , (module M : Event with type t = M.t )) + end -- cgit v1.2.3