mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25: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;
|
next true;
|
||||||
Format.fprintf formatter "%s@]" stop
|
Format.fprintf formatter "%s@]" stop
|
||||||
|
|
||||||
|
let (@@) = append
|
||||||
|
|
||||||
|
let (>>=) e f = flatMap f e
|
||||||
|
|
||||||
|
let (--) = int_range
|
||||||
|
|
||||||
|
let (|>) x f = f x
|
||||||
|
|
||||||
module Infix = struct
|
module Infix = struct
|
||||||
let (@@) = append
|
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
|
(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit
|
||||||
(** Pretty print an enum *)
|
(** 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
|
module Infix : sig
|
||||||
val (@@) : 'a t -> 'a t -> 'a t
|
val (@@) : 'a t -> 'a t -> 'a t
|
||||||
|
|
||||||
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
|
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
|
||||||
|
|
||||||
val (--) : int -> int -> int t
|
val (--) : int -> int -> int t
|
||||||
|
|
||||||
val (|>) : 'a -> ('a -> 'b) -> 'b
|
val (|>) : 'a -> ('a -> 'b) -> 'b
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue