From 4e207da568b31fb3fd097fb584f4722bd7166fcf Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 29 Apr 2018 21:51:05 +0200 Subject: Emphasizing the "smart"ness of Array.smartfoldmap{,2} in their documentation. This follows the model of smartmap and smartmap2. --- clib/cArray.mli | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clib') diff --git a/clib/cArray.mli b/clib/cArray.mli index 56cc3656d..c461d856b 100644 --- a/clib/cArray.mli +++ b/clib/cArray.mli @@ -91,10 +91,14 @@ sig [f x y == y] for all [x] in [a] and [y] in [b] pointwise. *) val smartfoldmap : ('r -> 'a -> 'r * 'a) -> 'r -> 'a array -> 'r * 'a array - (** Same as [smartmap] but threads an additional state left-to-right. *) + (** [smartfoldmap f a b] behaves as [fold_left_map] but + returns [b] as second component instead of a copy of [b] when + the output array is pointwise the same as the input array [b] *) val smartfoldmap2 : ('r -> 'a -> 'b -> 'r * 'b) -> 'r -> 'a array -> 'b array -> 'r * 'b array - (** Same as [smartmap2] but threads an additional state left-to-right. *) + (** [smartfoldmap2 f a b c] behaves as [fold_left2_map] but + returns [c] as second component instead of a copy of [c] when + the output array is pointwise the same as the input array [c] *) val map2 : ('a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array val map2_i : (int -> 'a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array -- cgit v1.2.3