[CCResult] new formulation for map_l

This commit is contained in:
Fardale 2018-12-21 02:08:02 +01:00
parent f18c9411f1
commit 61da6944d6

View file

@ -188,9 +188,9 @@ end
(** {2 Collections} *) (** {2 Collections} *)
val map_l : ('a -> ('b, 'err) t) -> 'a list -> ('b list, 'err) t val map_l : ('a -> ('b, 'err) t) -> 'a list -> ('b list, 'err) t
(** [map_l f l] apply [f] on every element of [l], and, in case of success for every (** [map_l f \[a1; ...; an\]] applies function f to a1, ..., an , and, in case of
element, return [Ok (List.map f l)]. Otherwise, it fails, and the first error is success for every elements, return the list of [Ok]-value.
returned.*) Otherwise, it fails and return the first error encountered. Tail-recursive.*)
val fold_l : ('b -> 'a -> ('b, 'err) t) -> 'b -> 'a list -> ('b, 'err) t val fold_l : ('b -> 'a -> ('b, 'err) t) -> 'b -> 'a list -> ('b, 'err) t