infix map operators for CCArray

This commit is contained in:
carm 2015-01-01 17:43:27 -05:00
parent b3a38657d1
commit 83994f1f5e
2 changed files with 12 additions and 0 deletions

View file

@ -392,6 +392,10 @@ let lookup ?(cmp=Pervasives.compare) k a =
let (>>=) a f = flat_map f a
let (>>|) a f = map f a
let (>|=) a f = map f a
let for_all p a = _for_all p a 0 (Array.length a)
let exists p a = _exists p a 0 (Array.length a)

View file

@ -155,6 +155,14 @@ val flat_map : ('a -> 'b t) -> 'a t -> 'b array
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
(** Infix version of {!flat_map} *)
val (>>|) : 'a t -> ('a -> 'b) -> 'b t
(** Infix version of {!map}
@since NEXT_RELEASE *)
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
(** Infix version of {!map}
@since NEXT_RELEASE *)
val except_idx : 'a t -> int -> 'a list
(** Remove given index, obtaining the list of the other elements *)