add Event.Infix

This commit is contained in:
Simon Cruanes 2024-09-04 10:18:53 -04:00
parent 070f28339f
commit fd89c81f57
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 14 additions and 0 deletions

View file

@ -2,3 +2,10 @@ include Picos_std_event.Event
let[@inline] of_fut (fut : _ Moonpool.Fut.t) : _ t = let[@inline] of_fut (fut : _ Moonpool.Fut.t) : _ t =
from_computation (Moonpool.Fut.Private_.as_computation fut) from_computation (Moonpool.Fut.Private_.as_computation fut)
module Infix = struct
let[@inline] ( let+ ) x f = map f x
let ( >|= ) = ( let+ )
end
include Infix

View file

@ -3,3 +3,10 @@ include module type of struct
end end
val of_fut : 'a Moonpool.Fut.t -> 'a t 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