summaryrefslogtreecommitdiff
path: root/editor/app
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2021-12-03 04:37:14 +0100
committerSébastien Dailly <sebastien@dailly.me>2022-02-07 16:43:33 +0100
commit47e4ab0cf1b7d364439a1a47df53f2d58a216239 (patch)
treed2dd3e37d0168d114198777c78b5278a9d77c254 /editor/app
parentc6265278f05aa4d3af60e420f2d4d13e4bce8ad7 (diff)
Helper to build application events
Diffstat (limited to 'editor/app')
-rw-r--r--editor/app/editor_app.ml11
-rw-r--r--editor/app/editor_app.mli2
2 files changed, 12 insertions, 1 deletions
diff --git a/editor/app/editor_app.ml b/editor/app/editor_app.ml
index 2d23cfb..e4c944a 100644
--- a/editor/app/editor_app.ml
+++ b/editor/app/editor_app.ml
@@ -1 +1,10 @@
-include Application.Make(struct type t = State.t end)
+module App = Application.Make(struct type t = State.t end)
+
+let ev
+ : (module App.Event with type t = 's) -> 's -> App.event
+ = fun (type s) (module M: App.Event with type t = s) v ->
+ App.E
+ ( v
+ , (module M : App.Event with type t = M.t ))
+
+include App
diff --git a/editor/app/editor_app.mli b/editor/app/editor_app.mli
index 3c7646b..dade546 100644
--- a/editor/app/editor_app.mli
+++ b/editor/app/editor_app.mli
@@ -12,3 +12,5 @@ type event = E : 'a * (module Event with type t = 'a) -> event
val run
: ?eq:(State.t -> State.t -> bool) -> State.t -> event Note.E.t -> State.t Note.S.t
+val ev
+ : (module Event with type t = 's) -> 's -> event