package tezos-base

  1. Overview
  2. Docs
include module type of struct include Tezos_stdlib end
module Bits : sig ... end
module Bloomer : sig ... end
module Bounded_heap : sig ... end
module Circular_buffer : sig ... end
module Compare : sig ... end
module FallbackArray : sig ... end
module FunctionalArray : sig ... end
module Hash_queue : sig ... end
module Hex : sig ... end
module Lwt_dropbox : sig ... end
module Lwt_idle_waiter : sig ... end
module Lwt_pipe : sig ... end
module Lwt_utils : sig ... end
module Memory : sig ... end
module Tag : sig ... end
module TzBytes : sig ... end
module TzEndian : sig ... end
module TzFilename : sig ... end
module TzList : sig ... end
module TzString : sig ... end
module Utils : sig ... end
module Error_monad = Tezos_error_monad.Error_monad
module Data_encoding = Data_encoding
module Hashtbl = Tezos_error_monad.TzLwtreslib.Hashtbl

The following modules are part of TzLwtreslib. We just remove

module Map = Tezos_error_monad.TzLwtreslib.Map
module Option = Tezos_error_monad.TzLwtreslib.Option
module Result = Tezos_error_monad.TzLwtreslib.Result
module Seq = Tezos_error_monad.TzLwtreslib.Seq
module Seq_e = Tezos_error_monad.TzLwtreslib.Seq_e
module Seq_s = Tezos_error_monad.TzLwtreslib.Seq_s
module Seq_es = Tezos_error_monad.TzLwtreslib.Seq_es
module Set = Tezos_error_monad.TzLwtreslib.Set
module Unit = Tezos_error_monad.TzLwtreslib.Unit
module WithExceptions = Tezos_error_monad.TzLwtreslib.WithExceptions
module List : sig ... end
module String : sig ... end
module Bytes : sig ... end
module Time = Time
module Fitness = Fitness
module User_activated = User_activated
module Block_header = Block_header
module Genesis = Genesis
module Operation = Operation
module Protocol = Protocol
module Test_chain_status = Test_chain_status
module Block_locator = Block_locator
module Mempool = Mempool
module P2p_addr = P2p_addr
module P2p_identity = P2p_identity
module P2p_peer = P2p_peer
module P2p_point = P2p_point
module P2p_connection = P2p_connection
module P2p_stat = P2p_stat
module P2p_version = P2p_version
module P2p_rejection = P2p_rejection
module Distributed_db_version = Distributed_db_version
module Network_version = Network_version
module Block_hash = Tezos_crypto.Hashed.Block_hash
module Block_metadata_hash = Tezos_crypto.Hashed.Block_metadata_hash
module Context_hash = Tezos_crypto.Hashed.Context_hash
module Operation_hash = Tezos_crypto.Hashed.Operation_hash
module Operation_list_hash = Tezos_crypto.Hashed.Operation_list_hash
module Operation_list_list_hash = Tezos_crypto.Hashed.Operation_list_list_hash
module Operation_metadata_hash = Tezos_crypto.Hashed.Operation_metadata_hash
module Operation_metadata_list_hash = Tezos_crypto.Hashed.Operation_metadata_list_hash
module Operation_metadata_list_list_hash = Tezos_crypto.Hashed.Operation_metadata_list_list_hash
module Protocol_hash = Tezos_crypto.Hashed.Protocol_hash
module Signature = Tezos_crypto.Signature
include module type of Utils.Infix
val (--) : int -> int -> int list
include module type of Tezos_error_monad.Error_monad
type error_category = [
  1. | `Branch
  2. | `Permanent
  3. | `Temporary
]
type error = Tezos_error_monad.TzCore.error = ..
val string_of_category : error_category -> string
val error_encoding : error Data_encoding.t
val pp : Stdlib.Format.formatter -> error -> unit
val register_error_kind : error_category -> id:string -> title:string -> description:string -> ?pp:(Stdlib.Format.formatter -> 'err -> unit) -> 'err Data_encoding.t -> (error -> 'err option) -> ('err -> error) -> unit
val classify_error : error -> Tezos_error_monad.Error_classification.t
type error += private
  1. | Unclassified of string
type error += private
  1. | Unregistered_error of Data_encoding.json
val json_of_error : error -> Data_encoding.json
val error_of_json : Data_encoding.json -> error
type error_info = Tezos_error_monad__Error_monad.error_info = {
  1. category : error_category;
  2. id : string;
  3. title : string;
  4. description : string;
  5. schema : Data_encoding.json_schema;
}
val pp_info : Stdlib.Format.formatter -> error_info -> unit
val find_info_of_error : error -> error_info
val get_registered_errors : unit -> error_info list
module type Wrapped_error_monad = sig ... end
val register_wrapped_error_kind : (module Wrapped_error_monad) -> id:string -> title:string -> description:string -> unit
module TzTrace : sig ... end
type !'error trace = 'error TzTrace.trace
type tztrace = Tezos_error_monad.TzCore.error TzTrace.trace
type !'a tzresult = ('a, tztrace) Stdlib.result
module Lwt_syntax : sig ... end
module Result_syntax : sig ... end
module Lwt_result_syntax : sig ... end
val classify_trace : tztrace -> Tezos_error_monad.Error_classification.t
module Legacy_monad_globals : sig ... end
val pp_print_trace : Stdlib.Format.formatter -> tztrace -> unit
val pp_print_top_error_of_trace : Stdlib.Format.formatter -> tztrace -> unit
val trace_encoding : tztrace Data_encoding.t
val result_encoding : 'a Data_encoding.t -> 'a tzresult Data_encoding.t
val record_trace : 'err -> ('a, 'err TzTrace.trace) Stdlib.result -> ('a, 'err TzTrace.trace) Stdlib.result
val trace : 'err -> ('b, 'err TzTrace.trace) Stdlib.result Lwt.t -> ('b, 'err TzTrace.trace) Stdlib.result Lwt.t
val record_trace_eval : (unit -> 'err) -> ('a, 'err TzTrace.trace) Stdlib.result -> ('a, 'err TzTrace.trace) Stdlib.result
val trace_eval : (unit -> 'err) -> ('b, 'err TzTrace.trace) Stdlib.result Lwt.t -> ('b, 'err TzTrace.trace) Stdlib.result Lwt.t
val error_unless : bool -> 'err -> (unit, 'err TzTrace.trace) Stdlib.result
val error_when : bool -> 'err -> (unit, 'err TzTrace.trace) Stdlib.result
val fail_unless : bool -> 'err -> (unit, 'err TzTrace.trace) Stdlib.result Lwt.t
val fail_when : bool -> 'err -> (unit, 'err TzTrace.trace) Stdlib.result Lwt.t
val unless : bool -> (unit -> (unit, 'trace) Stdlib.result Lwt.t) -> (unit, 'trace) Stdlib.result Lwt.t
val when_ : bool -> (unit -> (unit, 'trace) Stdlib.result Lwt.t) -> (unit, 'trace) Stdlib.result Lwt.t
val dont_wait : (unit -> (unit, 'trace) Stdlib.result Lwt.t) -> ('trace -> unit) -> (exn -> unit) -> unit
val error_with : ('a, Stdlib.Format.formatter, unit, 'b tzresult) Stdlib.format4 -> 'a
val failwith : ('a, Stdlib.Format.formatter, unit, 'b tzresult Lwt.t) Stdlib.format4 -> 'a
val error_with_exn : exn -> 'a tzresult
val fail_with_exn : exn -> 'a tzresult Lwt.t
val error_of_exn : exn -> error
val error_of_fmt : ('a, Stdlib.Format.formatter, unit, error) Stdlib.format4 -> 'a
type error +=
  1. | Exn of exn
type error +=
  1. | Canceled
val protect : ?on_error:(error trace -> 'a tzresult Lwt.t) -> ?canceler:Lwt_canceler.t -> (unit -> 'a tzresult Lwt.t) -> 'a tzresult Lwt.t
val catch : ?catch_only:(exn -> bool) -> (unit -> 'a) -> 'a tzresult
val catch_e : ?catch_only:(exn -> bool) -> (unit -> 'a tzresult) -> 'a tzresult
val catch_f : ?catch_only:(exn -> bool) -> (unit -> 'a) -> (exn -> error) -> 'a tzresult
val catch_s : ?catch_only:(exn -> bool) -> (unit -> 'a Lwt.t) -> 'a tzresult Lwt.t
val catch_es : ?catch_only:(exn -> bool) -> (unit -> 'a tzresult Lwt.t) -> 'a tzresult Lwt.t
val protect_result : ?canceler:Lwt_canceler.t -> (unit -> 'a Lwt.t) -> ('a, exn) Stdlib.result Lwt.t
type error +=
  1. | Timeout
val with_timeout : ?canceler:Lwt_canceler.t -> unit Lwt.t -> (Lwt_canceler.t -> 'a tzresult Lwt.t) -> 'a tzresult Lwt.t
val errs_tag : error trace Tezos_stdlib.Tag.def
val cancel_with_exceptions : Lwt_canceler.t -> unit Lwt.t
val either_f : 'a tzresult Lwt.t -> (unit -> 'a tzresult Lwt.t) -> 'a tzresult Lwt.t
module Option_syntax = Tezos_lwt_result_stdlib.Lwtreslib.Bare.Monad.Option_syntax
module Lwt_option_syntax = Tezos_lwt_result_stdlib.Lwtreslib.Bare.Monad.Lwt_option_syntax
module Internal_event = Tezos_event_logging.Internal_event
module Filename : sig ... end
module Bounded = Bounded
module Empty : sig ... end

The main purpose of this module is to be used with parametric types such as ('a, Empty.t) result. Such type is actually isomorphic to 'a (see get_ok function). This is useful if a module signature expects a generic ('a,'b) result type, but for some instantiation, 'b is actually empty. Here is a small example how such module can be used:

OCaml

Innovation. Community. Security.