sig
type 'a sequence = ('a -> unit) -> unit
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Buffer.t -> 'a -> unit
type 'a formatter = Format.formatter -> 'a -> unit
type ('good, 'bad) t = [ `Error of 'bad | `Ok of 'good ]
val return : 'a -> ('a, 'err) CCError.t
val fail : 'err -> ('a, 'err) CCError.t
val of_exn : exn -> ('a, string) CCError.t
val of_exn_trace : exn -> ('a, string) CCError.t
val fail_printf :
('a, Buffer.t, unit, ('a, string) CCError.t) Pervasives.format4 -> 'a
val map : ('a -> 'b) -> ('a, 'err) CCError.t -> ('b, 'err) CCError.t
val map_err :
('err1 -> 'err2) -> ('a, 'err1) CCError.t -> ('a, 'err2) CCError.t
val map2 :
('a -> 'b) ->
('err1 -> 'err2) -> ('a, 'err1) CCError.t -> ('b, 'err2) CCError.t
val iter : ('a -> unit) -> ('a, 'b) CCError.t -> unit
val get_exn : ('a, 'b) CCError.t -> 'a
val catch : ('a, 'err) CCError.t -> ok:('a -> 'b) -> err:('err -> 'b) -> 'b
val flat_map :
('a -> ('b, 'err) CCError.t) ->
('a, 'err) CCError.t -> ('b, 'err) CCError.t
val ( >|= ) : ('a, 'err) CCError.t -> ('a -> 'b) -> ('b, 'err) CCError.t
val ( >>= ) :
('a, 'err) CCError.t ->
('a -> ('b, 'err) CCError.t) -> ('b, 'err) CCError.t
val equal :
?err:'err CCError.equal ->
'a CCError.equal -> ('a, 'err) CCError.t CCError.equal
val compare :
?err:'err CCError.ord ->
'a CCError.ord -> ('a, 'err) CCError.t CCError.ord
val fold :
success:('a -> 'b) -> failure:('err -> 'b) -> ('a, 'err) CCError.t -> 'b
val guard : (unit -> 'a) -> ('a, exn) CCError.t
val guard_str : (unit -> 'a) -> ('a, string) CCError.t
val guard_str_trace : (unit -> 'a) -> ('a, string) CCError.t
val wrap1 : ('a -> 'b) -> 'a -> ('b, exn) CCError.t
val wrap2 : ('a -> 'b -> 'c) -> 'a -> 'b -> ('c, exn) CCError.t
val wrap3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> ('d, exn) CCError.t
val pure : 'a -> ('a, 'err) CCError.t
val ( <*> ) :
('a -> 'b, 'err) CCError.t ->
('a, 'err) CCError.t -> ('b, 'err) CCError.t
val join : (('a, 'err) CCError.t, 'err) CCError.t -> ('a, 'err) CCError.t
val both :
('a, 'err) CCError.t -> ('b, 'err) CCError.t -> ('a * 'b, 'err) CCError.t
module Infix :
sig
val ( >|= ) :
('a, 'err) CCError.t -> ('a -> 'b) -> ('b, 'err) CCError.t
val ( >>= ) :
('a, 'err) CCError.t ->
('a -> ('b, 'err) CCError.t) -> ('b, 'err) CCError.t
val ( <*> ) :
('a -> 'b, 'err) CCError.t ->
('a, 'err) CCError.t -> ('b, 'err) CCError.t
end
val map_l :
('a -> ('b, 'err) CCError.t) -> 'a list -> ('b list, 'err) CCError.t
val fold_l :
('b -> 'a -> ('b, 'err) CCError.t) ->
'b -> 'a list -> ('b, 'err) CCError.t
val fold_seq :
('b -> 'a -> ('b, 'err) CCError.t) ->
'b -> 'a CCError.sequence -> ('b, 'err) CCError.t
val choose : ('a, 'err) CCError.t list -> ('a, 'err list) CCError.t
val retry :
int -> (unit -> ('a, 'err) CCError.t) -> ('a, 'err list) CCError.t
module type MONAD =
sig
type 'a t
val return : 'a -> 'a CCError.MONAD.t
val ( >>= ) :
'a CCError.MONAD.t ->
('a -> 'b CCError.MONAD.t) -> 'b CCError.MONAD.t
end
module Traverse :
functor (M : MONAD) ->
sig
val sequence_m : ('a M.t, 'err) CCError.t -> ('a, 'err) CCError.t M.t
val fold_m :
('b -> 'a -> 'b M.t) -> 'b -> ('a, 'err) CCError.t -> 'b M.t
val map_m :
('a -> 'b M.t) -> ('a, 'err) CCError.t -> ('b, 'err) CCError.t M.t
val retry_m :
int ->
(unit -> ('a, 'err) CCError.t M.t) -> ('a, 'err list) CCError.t M.t
end
val to_opt : ('a, 'b) CCError.t -> 'a option
val of_opt : 'a option -> ('a, string) CCError.t
val to_seq : ('a, 'b) CCError.t -> 'a CCError.sequence
val pp : 'a CCError.printer -> ('a, string) CCError.t CCError.printer
val pp' :
'a CCError.printer ->
'e CCError.printer -> ('a, 'e) CCError.t CCError.printer
val print :
'a CCError.formatter -> ('a, string) CCError.t CCError.formatter
val print' :
'a CCError.formatter ->
'e CCError.formatter -> ('a, 'e) CCError.t CCError.formatter
val register_printer : exn CCError.printer -> unit
end