summaryrefslogtreecommitdiff
path: root/editor/app
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2021-12-03 04:19:53 +0100
committerSébastien Dailly <sebastien@dailly.me>2022-02-07 16:43:33 +0100
commitc6265278f05aa4d3af60e420f2d4d13e4bce8ad7 (patch)
treedece2b116d79a052a00e20c1ee2f7677c64190f9 /editor/app
parente78c236a8d28784370f192a3410693c456dc628f (diff)
Removed the application mecanism from the state module
Diffstat (limited to 'editor/app')
-rwxr-xr-xeditor/app/dune8
-rw-r--r--editor/app/editor_app.ml1
-rw-r--r--editor/app/editor_app.mli14
3 files changed, 23 insertions, 0 deletions
diff --git a/editor/app/dune b/editor/app/dune
new file mode 100755
index 0000000..f88bc75
--- /dev/null
+++ b/editor/app/dune
@@ -0,0 +1,8 @@
+(library
+ (name editor_app)
+ (libraries
+ state
+ application
+ )
+ (preprocess (pps js_of_ocaml-ppx))
+ )
diff --git a/editor/app/editor_app.ml b/editor/app/editor_app.ml
new file mode 100644
index 0000000..2d23cfb
--- /dev/null
+++ b/editor/app/editor_app.ml
@@ -0,0 +1 @@
+include Application.Make(struct type t = State.t end)
diff --git a/editor/app/editor_app.mli b/editor/app/editor_app.mli
new file mode 100644
index 0000000..3c7646b
--- /dev/null
+++ b/editor/app/editor_app.mli
@@ -0,0 +1,14 @@
+module type Event = sig
+
+ type t
+
+ val update: t -> State.t -> State.t
+
+end
+
+type event = E : 'a * (module Event with type t = 'a) -> event
+
+(** Simple helper for the main event loop *)
+val run
+ : ?eq:(State.t -> State.t -> bool) -> State.t -> event Note.E.t -> State.t Note.S.t
+