diff --git a/src/core/CCArray.ml b/src/core/CCArray.ml index 32634263..e4e10882 100644 --- a/src/core/CCArray.ml +++ b/src/core/CCArray.ml @@ -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) diff --git a/src/core/CCArray.mli b/src/core/CCArray.mli index 51665df7..1a5c26a4 100644 --- a/src/core/CCArray.mli +++ b/src/core/CCArray.mli @@ -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 *)