val (<*>) : ('a->'b, 'err)t->('a, 'err)t->('b, 'err)t
a <*> b evaluates a and b, and, in case of success, returns `Ok (a b). Otherwise, it fails, and the error of a is chosen over the error of b if both fail
Collections
val map_l : ('a->('b, 'err)t)->'a list->('b list, 'err)t
val fold_l : ('b->'a->('b, 'err)t)->'b->'a list->('b, 'err)t
val fold_seq : ('b->'a->('b, 'err)t)->'b->'asequence->('b, 'err)t
choose l selects a member of l that is a `Ok _ value, or returns `Error l otherwise, where l is the list of errors.
val retry : int ->(unit ->('a, 'err)t)->('a, 'err list)t
retry n f calls f at most n times, returning the first result of f () that doesn't fail. If f fails n times, retry n f fails with the list of successive errors.
One can register exception printers here, so they will be used by guard, wrap1, etc. The printers should succeed (print) on exceptions they can deal with, and re-raise the exception otherwise. For instance if I register a printer for Not_found, it could look like:
CCError.register_printer
(fun buf exn -> match exn with
| Not_found -> Buffer.add_string buf "Not_found"
| _ -> raise exn
);;
This way a printer that doesn't know how to deal with an exception will let other printers do it.