added infix operators in the module

This commit is contained in:
Simon Cruanes 2013-03-21 17:03:14 +01:00
parent 13fd7da142
commit a49b37dbdb
2 changed files with 20 additions and 0 deletions

View file

@ -769,6 +769,14 @@ let pp ?(start="") ?(stop="") ?(sep=",") ?(horizontal=false) pp_elem formatter e
next true;
Format.fprintf formatter "%s@]" stop
let (@@) = append
let (>>=) e f = flatMap f e
let (--) = int_range
let (|>) x f = f x
module Infix = struct
let (@@) = append

View file

@ -265,10 +265,22 @@ val pp : ?start:string -> ?stop:string -> ?sep:string -> ?horizontal:bool ->
(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit
(** Pretty print an enum *)
val (@@) : 'a t -> 'a t -> 'a t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val (--) : int -> int -> int t
val (|>) : 'a -> ('a -> 'b) -> 'b
module Infix : sig
val (@@) : 'a t -> 'a t -> 'a t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val (--) : int -> int -> int t
val (|>) : 'a -> ('a -> 'b) -> 'b
end