Module Rresult.R

type (!'a, !'b) t = ('a, 'b) result
val ok : 'a -> ('a, 'b) result
val error : 'b -> ('a, 'b) result
val reword_error : ('b -> 'c) -> ('a, 'b) result -> ('a, 'c) result
val get_ok : ('a, 'b) result -> 'a
val get_error : ('a, 'b) result -> 'b
val return : 'a -> ('a, 'b) result
val fail : 'b -> ('a, 'b) result
val bind : ('a, 'b) result -> ('a -> ('c, 'b) result) -> ('c, 'b) result
val map : ('a -> 'c) -> ('a, 'b) result -> ('c, 'b) result
val join : (('a, 'b) result, 'b) result -> ('a, 'b) result
val (>>=) : ('a, 'b) result -> ('a -> ('c, 'b) result) -> ('c, 'b) result
val (>>|) : ('a, 'b) result -> ('a -> 'c) -> ('c, 'b) result
module Infix : sig ... end
type msg = [
  1. | `Msg of string
]
val msg : string -> [> msg ]
val msgf : ('a, Format.formatter, unit, [> msg ]) format4 -> 'a
val pp_msg : Format.formatter -> msg -> unit
val error_msg : string -> ('a, [> msg ]) result
val error_msgf : ('a, Format.formatter, unit, ('b, [> msg ]) result) format4 -> 'a
val reword_error_msg : ?replace:bool -> (string -> msg) -> ('a, msg) result -> ('a, [> msg ]) result
val error_to_msg : pp_error:(Format.formatter -> 'b -> unit) -> ('a, 'b) result -> ('a, [> msg ]) result
val error_msg_to_invalid_arg : ('a, msg) result -> 'a
val open_error_msg : ('a, msg) result -> ('a, [> msg ]) result
val failwith_error_msg : ('a, msg) result -> 'a
type exn_trap = [
  1. | `Exn_trap of exn * Printexc.raw_backtrace
]
val pp_exn_trap : Format.formatter -> exn_trap -> unit
val trap_exn : ('a -> 'b) -> 'a -> ('b, [> exn_trap ]) result
val error_exn_trap_to_msg : ('a, exn_trap) result -> ('a, [> msg ]) result
val open_error_exn_trap : ('a, exn_trap) result -> ('a, [> exn_trap ]) result
val pp : ok:(Format.formatter -> 'a -> unit) -> error:(Format.formatter -> 'b -> unit) -> Format.formatter -> ('a, 'b) result -> unit
val dump : ok:(Format.formatter -> 'a -> unit) -> error:(Format.formatter -> 'b -> unit) -> Format.formatter -> ('a, 'b) result -> unit
val is_ok : ('a, 'b) result -> bool
val is_error : ('a, 'b) result -> bool
val equal : ok:('a -> 'a -> bool) -> error:('b -> 'b -> bool) -> ('a, 'b) result -> ('a, 'b) result -> bool
val compare : ok:('a -> 'a -> int) -> error:('b -> 'b -> int) -> ('a, 'b) result -> ('a, 'b) result -> int
val to_option : ('a, 'b) result -> 'a option
val of_option : none:(unit -> ('a, 'b) result) -> 'a option -> ('a, 'b) result
val to_presult : ('a, 'b) result -> [> `Error of 'b | `Ok of 'a ]
val of_presult : [< `Error of 'b | `Ok of 'a ] -> ('a, 'b) result
val ignore_error : use:('b -> 'a) -> ('a, 'b) result -> 'a
val kignore_error : use:('b -> ('a, 'c) result) -> ('a, 'b) result -> ('a, 'c) result