mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
add Event.Infix
This commit is contained in:
parent
070f28339f
commit
fd89c81f57
2 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue