From 5d5549c168af51195e66bf67cc5b23382b8c7d52 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Mon, 7 Feb 2022 16:09:14 +0100 Subject: Changed the organisation in the applications --- lib/application/application.ml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 lib/application/application.ml (limited to 'lib/application/application.ml') 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 -- cgit v1.2.3