mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 11:45:31 -05:00
minor style changes
This commit is contained in:
parent
289fc8af7b
commit
a721d9aed3
2 changed files with 6 additions and 3 deletions
|
|
@ -70,9 +70,11 @@ let of_exn_trace e =
|
|||
|
||||
let opt_map f e = match e with
|
||||
| None -> Ok None
|
||||
| Some x -> (match f x with
|
||||
| Some x ->
|
||||
begin match f x with
|
||||
| Ok x -> Ok (Some x)
|
||||
| Error e -> Error e)
|
||||
| Error e -> Error e
|
||||
end
|
||||
|
||||
let map f e = match e with
|
||||
| Ok x -> Ok (f x)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ val add_ctxf : ('a, Format.formatter, unit, ('b, string) t -> ('b, string) t) fo
|
|||
@since 1.2 *)
|
||||
|
||||
val opt_map : ('a -> ('b, 'c) t) -> 'a option -> ('b option, 'c) t
|
||||
(** Map optional success *)
|
||||
(** Map a fallible operation through an option.
|
||||
@since NEXT_RELEASE *)
|
||||
|
||||
val map : ('a -> 'b) -> ('a, 'err) t -> ('b, 'err) t
|
||||
(** Map on success. *)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue