diff --git a/src/sync/event.ml b/src/sync/event.ml index 3ab78478..90446648 100644 --- a/src/sync/event.ml +++ b/src/sync/event.ml @@ -2,3 +2,10 @@ include Picos_std_event.Event let[@inline] of_fut (fut : _ Moonpool.Fut.t) : _ t = from_computation (Moonpool.Fut.Private_.as_computation fut) + +module Infix = struct + let[@inline] ( let+ ) x f = map f x + let ( >|= ) = ( let+ ) +end + +include Infix diff --git a/src/sync/event.mli b/src/sync/event.mli index 6840433b..309edbc7 100644 --- a/src/sync/event.mli +++ b/src/sync/event.mli @@ -3,3 +3,10 @@ include module type of struct end val of_fut : 'a Moonpool.Fut.t -> 'a t + +module Infix : sig + val ( >|= ) : 'a t -> ('a -> 'b) -> 'b t + val ( let+ ) : 'a t -> ('a -> 'b) -> 'b t +end + +include module type of Infix