aboutsummaryrefslogtreecommitdiff
path: root/lib/application/application.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/application/application.ml')
-rwxr-xr-xlib/application/application.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/application/application.ml b/lib/application/application.ml
new file mode 100755
index 0000000..15452fb
--- /dev/null
+++ b/lib/application/application.ml
@@ -0,0 +1,9 @@
+(** 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