From c05bbbf515a2e0011f1244a7d64a26c7b78b3b26 Mon Sep 17 00:00:00 2001 From: Thibault Martin <thi.martin.pro@pm.me> Date: Tue, 14 May 2024 10:42:04 +0200 Subject: [PATCH] [doc] Specify which error is kept if both arguments are (Error e) --- src/libraries/utils/result.mli | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libraries/utils/result.mli b/src/libraries/utils/result.mli index abbdeb65b2..0411390df5 100644 --- a/src/libraries/utils/result.mli +++ b/src/libraries/utils/result.mli @@ -25,6 +25,9 @@ include module type of Stdlib.Result +(** [zip r1 r2] regroups values in a pair [Ok (v1, v2)] if both arguments are + [Ok v1] and [Ok v2] and propagate errors in other cases. If both [r1] + and [r2] are errors we keep the first one, in this case [r1]. *) val zip : ('a, 'e) result -> ('b, 'e) result -> ('a * 'b, 'e) result module Operators : sig -- GitLab