package octez-proto-libs
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
    
    
  sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
    
    
  doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V8/Make/Error_monad/index.html
Module Make.Error_monadSource
CORE : errors
val error_encoding : error Data_encoding.tval pp : Format.formatter -> error -> unitEXT : error registration/query
val register_error_kind : 
  error_category ->
  id:string ->
  title:string ->
  description:string ->
  ?pp:(Format.formatter -> 'err -> unit) ->
  'err Data_encoding.t ->
  (error -> 'err option) ->
  ('err -> error) ->
  unitval json_of_error : error -> Data_encoding.jsonval error_of_json : Data_encoding.json -> errortype error_info = {- category : error_category;
- id : string;
- title : string;
- description : string;
- schema : Data_encoding.json_schema;
}val pp_info : Format.formatter -> error_info -> unitval get_registered_errors : unit -> error_info listRetrieves information of registered errors
MONAD : trace, monad, etc.
type 'a tzresult = ('a, error trace) Pervasives.resultval trace_encoding : error trace Data_encoding.tval result_encoding : 'a Data_encoding.t -> 'a tzresult Data_encoding.tval ok : 'a -> ('a, 'trace) Pervasives.resultval return : 'a -> ('a, 'trace) Pervasives.result Lwt.tval return_unit : (unit, 'trace) Pervasives.result Lwt.tval return_none : ('a option, 'trace) Pervasives.result Lwt.tval return_some : 'a -> ('a option, 'trace) Pervasives.result Lwt.tval return_nil : ('a list, 'trace) Pervasives.result Lwt.tval return_true : (bool, 'trace) Pervasives.result Lwt.tval return_false : (bool, 'trace) Pervasives.result Lwt.tval (>>?) : 
  ('a, 'trace) Pervasives.result ->
  ('a -> ('b, 'trace) Pervasives.result) ->
  ('b, 'trace) Pervasives.resultval (>|?) : 
  ('a, 'trace) Pervasives.result ->
  ('a -> 'b) ->
  ('b, 'trace) Pervasives.resultval (>>=?) : 
  ('a, 'trace) Pervasives.result Lwt.t ->
  ('a -> ('b, 'trace) Pervasives.result Lwt.t) ->
  ('b, 'trace) Pervasives.result Lwt.tval (>|=?) : 
  ('a, 'trace) Pervasives.result Lwt.t ->
  ('a -> 'b) ->
  ('b, 'trace) Pervasives.result Lwt.tval (>>?=) : 
  ('a, 'trace) Pervasives.result ->
  ('a -> ('b, 'trace) Pervasives.result Lwt.t) ->
  ('b, 'trace) Pervasives.result Lwt.tval (>|?=) : 
  ('a, 'trace) Pervasives.result ->
  ('a -> 'b Lwt.t) ->
  ('b, 'trace) Pervasives.result Lwt.tval record_trace : 
  'err ->
  ('a, 'err trace) Pervasives.result ->
  ('a, 'err trace) Pervasives.resultval trace : 
  'err ->
  ('b, 'err trace) Pervasives.result Lwt.t ->
  ('b, 'err trace) Pervasives.result Lwt.tval record_trace_eval : 
  (unit -> 'err) ->
  ('a, 'err trace) Pervasives.result ->
  ('a, 'err trace) Pervasives.resultval trace_eval : 
  (unit -> 'err) ->
  ('b, 'err trace) Pervasives.result Lwt.t ->
  ('b, 'err trace) Pervasives.result Lwt.tval error_unless : bool -> 'err -> (unit, 'err trace) Pervasives.resultval error_when : bool -> 'err -> (unit, 'err trace) Pervasives.resultval fail_unless : bool -> 'err -> (unit, 'err trace) Pervasives.result Lwt.tval fail_when : bool -> 'err -> (unit, 'err trace) Pervasives.result Lwt.tval unless : 
  bool ->
  (unit -> (unit, 'trace) Pervasives.result Lwt.t) ->
  (unit, 'trace) Pervasives.result Lwt.tval when_ : 
  bool ->
  (unit -> (unit, 'trace) Pervasives.result Lwt.t) ->
  (unit, 'trace) Pervasives.result Lwt.tval dont_wait : 
  (exn -> unit) ->
  ('trace -> unit) ->
  (unit -> (unit, 'trace) Pervasives.result Lwt.t) ->
  unitcatch f executes f within a try-with block and wraps exceptions within a tzresult. catch f is equivalent to try Ok (f ()) with e -> Error (error_of_exn e).
If catch_only is set, then only exceptions e such that catch_only e is true are caught.
Whether catch_only is set or not, this function never catches non-deterministic runtime exceptions of OCaml such as Stack_overflow and Out_of_memory nor system-exceptions such as Unix.Unix_error and Sys_error.
catch_f f handler is equivalent to map_error (catch f) handler. In other words, it catches exceptions in f () and either returns the value in an Ok or passes the exception to handler for the Error.
catch_only has the same use as with catch. The same restriction on catching non-deterministic runtime exceptions applies.
catch_s is like catch but when f returns a promise. It is equivalent to
Lwt.try_bind f
  (fun v -> Lwt.return (Ok v))
  (fun e -> Lwt.return (Error (error_of_exn e)))If catch_only is set, then only exceptions e such that catch_only e is true are caught.
Whether catch_only is set or not, this function never catches non-deterministic runtime exceptions of OCaml such as Stack_overflow and Out_of_memory nor system-exceptions such as Unix.Unix_error and Sys_error.
val join_e : 
  (unit, 'err trace) Pervasives.result list ->
  (unit, 'err trace) Pervasives.resultval all_e : 
  ('a, 'err trace) Pervasives.result list ->
  ('a list, 'err trace) Pervasives.resultval both_e : 
  ('a, 'err trace) Pervasives.result ->
  ('b, 'err trace) Pervasives.result ->
  ('a * 'b, 'err trace) Pervasives.result