package ppx_factory

  1. Overview
  2. Docs
val all_ok : ('a, 'b) Stdlib.result list -> ('a list, 'b) Stdlib.result

all_ok l return l' if all elements of l are Ok _ or the first encountered error otherwise.

val find_ok : f:('a -> ('b, 'err) Stdlib.result) -> 'a list -> ('b, [ `Empty | `Last of 'err ]) Stdlib.result

Apply the given function to the given list's elements until it returns Ok _. Return Error `Empty if the list is empty or Error (`Last err) with the last error returned by f if it returned an error for every elements.