mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
some infix operators for CCUnix
This commit is contained in:
parent
4f44308445
commit
fe1f4f653a
2 changed files with 20 additions and 0 deletions
|
|
@ -146,3 +146,11 @@ let async_call ?(env=[||]) cmd =
|
|||
method wait = Unix.close_process_full (oc, ic, errc)
|
||||
end
|
||||
)
|
||||
|
||||
module Infix = struct
|
||||
let (?|) fmt = call fmt
|
||||
|
||||
let (?|&) fmt = async_call fmt
|
||||
end
|
||||
|
||||
include Infix
|
||||
|
|
|
|||
|
|
@ -96,4 +96,16 @@ val async_call : ?env:string array ->
|
|||
to die. Channels can be closed independently.
|
||||
@since NEXT_RELEASE *)
|
||||
|
||||
module Infix : sig
|
||||
val (?|) : ('a, Buffer.t, unit, call_result) format4 -> 'a
|
||||
(** Infix version of {!call}
|
||||
@since NEXT_RELEASE *)
|
||||
|
||||
val (?|&) : ('a, Buffer.t, unit, async_call_result) format4 -> 'a
|
||||
(** Infix version of {!async_call}
|
||||
@since NEXT_RELEASE *)
|
||||
end
|
||||
|
||||
include module type of Infix
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue