aboutsummaryrefslogtreecommitdiffhomepage
path: root/clib
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2018-04-29 21:51:05 +0200
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2018-05-23 18:50:10 +0200
commit4e207da568b31fb3fd097fb584f4722bd7166fcf (patch)
tree201b2bce08abddd4e909b5e01181969680c58e5d /clib
parentb81fafbb8fbcba0cd54ea93fd44e6bd69540324a (diff)
Emphasizing the "smart"ness of Array.smartfoldmap{,2} in their documentation.
This follows the model of smartmap and smartmap2.
Diffstat (limited to 'clib')
-rw-r--r--clib/cArray.mli8
1 files changed, 6 insertions, 2 deletions
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