package tezos-lwt-result-stdlib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Hashtables with the signature S are exception-safe replacements for hashtables with the Stdlib.Hashtbl.S signature with Lwt- and result-aware traversal functions.

See Lwtreslib's introductory documentation for explanations regarding _e-, _s-, _es-, _p-, and _ep-suffixed functions and exception safety. See Stdlib.Hashtbl.S for explanations regarding OCaml's hashtables in general.

Note that this signature is within the Traced part of the library. As a result, the _ep traversor returns en 'error trace.

include Bare_functor_outputs.Hashtbl.S
type key
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a option
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val iter_s : (key -> 'a -> unit Lwt.t) -> 'a t -> unit Lwt.t
val iter_p : (key -> 'a -> unit Lwt.t) -> 'a t -> unit Lwt.t
val iter_e : (key -> 'a -> (unit, 'trace) result) -> 'a t -> (unit, 'trace) result
val iter_es : (key -> 'a -> (unit, 'trace) result Lwt.t) -> 'a t -> (unit, 'trace) result Lwt.t
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val try_map_inplace : (key -> 'a -> ('a, 'trace) result) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val fold_s : (key -> 'a -> 'b -> 'b Lwt.t) -> 'a t -> 'b -> 'b Lwt.t
val fold_e : (key -> 'a -> 'b -> ('b, 'trace) result) -> 'a t -> 'b -> ('b, 'trace) result
val fold_es : (key -> 'a -> 'b -> ('b, 'trace) result Lwt.t) -> 'a t -> 'b -> ('b, 'trace) result Lwt.t
val length : 'a t -> int
val stats : 'a t -> Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Seq.t
val to_seq_keys : _ t -> key Seq.t
val to_seq_values : 'a t -> 'a Seq.t
val add_seq : 'a t -> (key * 'a) Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Seq.t -> unit
val of_seq : (key * 'a) Seq.t -> 'a t
type 'error trace

'error trace is intended to be substituted by a type provided by a Trace module (with type 'error trace := 'error Trace.trace)

val iter_ep : (key -> 'a -> (unit, 'error trace) result Lwt.t) -> 'a t -> (unit, 'error trace) result Lwt.t