sig
type ('a, 'e) t = ('a, 'e) BatPervasives.result = Ok of 'a | Error of 'e
val ok : 'a -> ('a, 'b) BatResult.t
val error : 'e -> ('a, 'e) BatResult.t
val value : ('a, 'e) BatResult.t -> default:'a -> 'a
val default : 'a -> ('a, 'b) BatResult.t -> 'a
val get_ok : ('a, 'e) BatResult.t -> 'a
val get_error : ('a, 'e) BatResult.t -> 'e
val get : ('a, exn) BatResult.t -> 'a
val catch : ('a -> 'e) -> 'a -> ('e, exn) BatResult.t
val catch2 : ('a -> 'b -> 'c) -> 'a -> 'b -> ('c, exn) BatResult.t
val catch3 :
('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> ('d, exn) BatResult.t
val bind :
('a, 'e) BatResult.t ->
('a -> ('b, 'e) BatResult.t) -> ('b, 'e) BatResult.t
val join : (('a, 'e) BatResult.t, 'e) BatResult.t -> ('a, 'e) BatResult.t
val map : ('a -> 'b) -> ('a, 'e) BatResult.t -> ('b, 'e) BatResult.t
val map_error : ('e -> 'f) -> ('a, 'e) BatResult.t -> ('a, 'f) BatResult.t
val map_both :
('a1 -> 'a2) ->
('b1 -> 'b2) -> ('a1, 'b1) BatResult.t -> ('a2, 'b2) BatResult.t
val map_default : 'b -> ('a -> 'b) -> ('a, 'c) BatResult.t -> 'b
val fold : ok:('a -> 'c) -> error:('e -> 'c) -> ('a, 'e) BatResult.t -> 'c
val iter : ('a -> unit) -> ('a, 'e) BatResult.t -> unit
val iter_error : ('e -> unit) -> ('a, 'e) BatResult.t -> unit
val is_ok : ('a, 'e) BatResult.t -> bool
val is_error : ('a, 'e) BatResult.t -> bool
val is_bad : ('a, 'e) BatResult.t -> bool
val is_exn : exn -> ('a, exn) BatResult.t -> bool
val equal :
ok:('a -> 'a -> bool) ->
error:('e -> 'e -> bool) ->
('a, 'e) BatResult.t -> ('a, 'e) BatResult.t -> bool
val compare :
ok:('a -> 'a -> int) ->
error:('e -> 'e -> int) ->
('a, 'e) BatResult.t -> ('a, 'e) BatResult.t -> int
val to_option : ('a, 'b) BatResult.t -> 'a option
val of_option : 'a option -> ('a, unit) BatResult.t
val to_list : ('a, 'e) BatResult.t -> 'a list
val to_seq : ('a, 'e) BatResult.t -> 'a BatSeq.t
module Monad :
sig
val bind :
('a, 'e) BatResult.t ->
('a -> ('c, 'e) BatResult.t) -> ('c, 'e) BatResult.t
val ( >>= ) :
('a, 'e) BatResult.t ->
('a -> ('c, 'e) BatResult.t) -> ('c, 'e) BatResult.t
val return : 'a -> ('a, 'b) BatResult.t
end
module Infix :
sig
val ( >>= ) :
('a, 'e) BatResult.t ->
('a -> ('c, 'e) BatResult.t) -> ('c, 'e) BatResult.t
end
val print :
('b BatInnerIO.output -> 'a -> unit) ->
'b BatInnerIO.output -> ('a, exn) BatResult.t -> unit
end