Fixes map_or

~default arg for `map_or`, as well as function, should not depend on the type of error case.
This commit is contained in:
Roma Sokolov 2016-10-04 14:27:34 +03:00 committed by GitHub
parent d7e8cb24fd
commit d4d22b1488

View file

@ -67,7 +67,7 @@ val get_exn : ('a, _) t -> 'a
val get_or : ('a, _) t -> default:'a -> 'a
(** [get_or e ~default] returns [x] if [e = Ok x], [default] otherwise *)
val map_or : ('a -> 'b) -> ('a, 'b) t -> default:'b -> 'b
val map_or : ('a -> 'b) -> ('a, 'c) t -> default:'b -> 'b
(** [map_or f e ~default] returns [f x] if [e = Ok x], [default] otherwise *)
val catch : ('a, 'err) t -> ok:('a -> 'b) -> err:('err -> 'b) -> 'b