small rename

This commit is contained in:
Simon Cruanes 2016-02-23 14:19:14 +01:00
parent db1de6e6e6
commit 86f170f213
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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