Module Bos_setup.R

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