aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2022-02-07 13:43:24 +0100
committerSébastien Dailly <sebastien@dailly.me>2022-02-07 16:22:43 +0100
commit2e29673fa970b814c97d5838963de49c2a65424b (patch)
tree09d61022038ebfd392873c1a0c62e984d901d11a /lib
parent155fec516022d2d5a1343312792dce21f466573a (diff)
Rename application functions
Diffstat (limited to 'lib')
-rwxr-xr-xlib/application/application.ml12
1 files changed, 10 insertions, 2 deletions
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