mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2026-01-23 01:26:41 -05:00
small rename
This commit is contained in:
parent
db1de6e6e6
commit
86f170f213
2 changed files with 4 additions and 4 deletions
|
|
@ -58,11 +58,11 @@ let iter f e = match e with
|
|||
| Ok x -> f x
|
||||
| Error _ -> ()
|
||||
|
||||
exception GetOnError
|
||||
exception Get_error
|
||||
|
||||
let get_exn = function
|
||||
| Ok x -> x
|
||||
| Error _ -> raise GetOnError
|
||||
| Error _ -> raise Get_error
|
||||
|
||||
let catch e ~ok ~err = match e with
|
||||
| Ok x -> ok x
|
||||
|
|
|
|||
|
|
@ -56,13 +56,13 @@ val map2 : ('a -> 'b) -> ('err1 -> 'err2) -> ('a, 'err1) t -> ('b, 'err2) t
|
|||
val iter : ('a -> unit) -> ('a, _) t -> unit
|
||||
(** Apply the function only in case of Ok *)
|
||||
|
||||
exception GetOnError
|
||||
exception Get_error
|
||||
|
||||
val get_exn : ('a, _) t -> 'a
|
||||
(** Extract the value [x] from [Ok x], fails otherwise.
|
||||
You should be careful with this function, and favor other combinators
|
||||
whenever possible.
|
||||
@raise GetOnError if the value is an error. *)
|
||||
@raise Get_error if the value is an error. *)
|
||||
|
||||
val catch : ('a, 'err) t -> ok:('a -> 'b) -> err:('err -> 'b) -> 'b
|
||||
(** [catch e ~ok ~err] calls either [ok] or [err] depending on
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue