some infix operators for CCUnix

This commit is contained in:
Simon Cruanes 2015-04-25 12:56:00 +02:00
parent 4f44308445
commit fe1f4f653a
2 changed files with 20 additions and 0 deletions

View file

@ -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

View file

@ -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