mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
added infix operators in the module
This commit is contained in:
parent
13fd7da142
commit
a49b37dbdb
2 changed files with 20 additions and 0 deletions
8
enum.ml
8
enum.ml
|
|
@ -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
|
||||
|
||||
|
|
|
|||
12
enum.mli
12
enum.mli
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue