From 53030c4c29239d3b422cc66dbd296573ef1d0a98 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 13 Oct 2016 10:04:23 +0200 Subject: [PATCH] more general types for `CCArray.{for_all2,exists2}` --- src/core/CCArray.ml | 10 ++++++---- src/core/CCArray.mli | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/core/CCArray.ml b/src/core/CCArray.ml index 7c38eb45..4890a9a3 100644 --- a/src/core/CCArray.ml +++ b/src/core/CCArray.ml @@ -94,15 +94,17 @@ module type S = sig val for_all : ('a -> bool) -> 'a t -> bool - val for_all2 : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool + val for_all2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool (** Forall on pairs of arrays. - @raise Invalid_argument if they have distinct lengths *) + @raise Invalid_argument if they have distinct lengths + allow different types @since NEXT_RELEASE *) val exists : ('a -> bool) -> 'a t -> bool - val exists2 : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool + val exists2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool (** Exists on pairs of arrays. - @raise Invalid_argument if they have distinct lengths *) + @raise Invalid_argument if they have distinct lengths + allow different types @since NEXT_RELEASE *) val shuffle : 'a t -> unit (** shuffle randomly the array, in place *) diff --git a/src/core/CCArray.mli b/src/core/CCArray.mli index fd7eb5bb..6b417c51 100644 --- a/src/core/CCArray.mli +++ b/src/core/CCArray.mli @@ -96,15 +96,17 @@ module type S = sig val for_all : ('a -> bool) -> 'a t -> bool - val for_all2 : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool + val for_all2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool (** Forall on pairs of arrays. - @raise Invalid_argument if they have distinct lengths *) + @raise Invalid_argument if they have distinct lengths + allow different types @since NEXT_RELEASE *) val exists : ('a -> bool) -> 'a t -> bool - val exists2 : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool + val exists2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool (** Exists on pairs of arrays. - @raise Invalid_argument if they have distinct lengths *) + @raise Invalid_argument if they have distinct lengths + allow different types @since NEXT_RELEASE *) val shuffle : 'a t -> unit (** Shuffle randomly the array, in place *)