sig
type 'a t = private int
module type S =
sig
type ok_value
type t = ok_value t
val create_ok : ok_value -> t
val create_error : Unix_error.t -> t
val is_ok : t -> bool
val is_error : t -> bool
val to_result : t -> (ok_value, Unix_error.t) Core_kernel.Std.Result.t
val ok_exn : t -> ok_value
val error_exn : t -> Unix_error.t
val reinterpret_error_exn : t -> 'a t
val ok_or_unix_error_exn : t -> syscall_name:string -> ok_value
val ok_or_unix_error_with_args_exn :
t ->
syscall_name:string ->
'a -> ('a -> Core_kernel.Std.Sexp.t) -> ok_value
val sexp_of_t : t -> Sexplib.Sexp.t
val compare : t -> t -> int
end
module type Arg = Syscall_result_intf.Arg
module Make :
functor (M : Arg) () ->
sig
type t = M.t t
val create_ok : M.t -> t
val create_error : Unix_error.t -> t
val is_ok : t -> bool
val is_error : t -> bool
val to_result : t -> (M.t, Unix_error.t) Core_kernel.Std.Result.t
val ok_exn : t -> M.t
val error_exn : t -> Unix_error.t
val reinterpret_error_exn : t -> 'a t
val ok_or_unix_error_exn : t -> syscall_name:string -> M.t
val ok_or_unix_error_with_args_exn :
t ->
syscall_name:string -> 'a -> ('a -> Core_kernel.Std.Sexp.t) -> M.t
val sexp_of_t : t -> Sexplib.Sexp.t
val compare : t -> t -> int
end
module Int :
sig
type t = int t
val create_ok : int -> t
val create_error : Unix_error.t -> t
val is_ok : t -> bool
val is_error : t -> bool
val to_result : t -> (int, Unix_error.t) Core_kernel.Std.Result.t
val ok_exn : t -> int
val error_exn : t -> Unix_error.t
val reinterpret_error_exn : t -> 'a t
val ok_or_unix_error_exn : t -> syscall_name:string -> int
val ok_or_unix_error_with_args_exn :
t ->
syscall_name:string -> 'a -> ('a -> Core_kernel.Std.Sexp.t) -> int
val sexp_of_t : t -> Sexplib.Sexp.t
val compare : t -> t -> int
end
module Unit :
sig
type t = unit t
val create_ok : unit -> t
val create_error : Unix_error.t -> t
val is_ok : t -> bool
val is_error : t -> bool
val to_result : t -> (unit, Unix_error.t) Core_kernel.Std.Result.t
val ok_exn : t -> unit
val error_exn : t -> Unix_error.t
val reinterpret_error_exn : t -> 'a t
val ok_or_unix_error_exn : t -> syscall_name:string -> unit
val ok_or_unix_error_with_args_exn :
t ->
syscall_name:string -> 'a -> ('a -> Core_kernel.Std.Sexp.t) -> unit
val sexp_of_t : t -> Sexplib.Sexp.t
val compare : t -> t -> int
end
val create_error : Unix_error.t -> 'a Syscall_result.t
val unit : Syscall_result.Unit.t
val ignore_ok_value : 'a Syscall_result.t -> Syscall_result.Unit.t
end