package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

octez-19.1.tar.gz
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053

doc/octez-libs.lwt-result-stdlib/Tezos_lwt_result_stdlib/Lwtreslib/Traced/index.html

Module Lwtreslib.TracedSource

Traced is a functor to generate advanced combined-monad replacements for parts of the Stdlib. The generated module is similar to Bare with the addition of traces: structured collections of errors.

For convenience, the monad includes primitives to error directly with a trace rather than a bare error.

All the _ep traversors return traces of errors rather than lists of errors. The _ep traversors preserve their best-effort semantic.

Additional functions in the Monad allow the construction of sequential traces: functions to enrich traces with new errors. E.g.,

let load_config file =
   Result.map_error
     (fun trace ->
        Trace.cons "cannot load configuration file" trace)
   @@ begin
     let open Lwt_result_syntax in
     let* file = open_file in
     let* lines = read_lines file in
     let* json = parse_config lines in
     make_dictionary json
   end

Example implementations of traces are provided in the traces/ directory.

Parameters

module Trace : TRACE

Signature

module Monad : TRACED_MONAD with type 'error trace = 'error Trace.trace
module Hashtbl : Traced_sigs.Hashtbl.S with type 'error trace := 'error Trace.trace
module List : Traced_sigs.List.S with type 'error trace := 'error Trace.trace
module Map : Traced_sigs.Map.S with type 'error trace := 'error Trace.trace
module Seq : Traced_sigs.Seq.S with type 'error trace := 'error Trace.trace
module Seq_s : Traced_sigs.Seq_s.S with type 'error trace := 'error Trace.trace
module Seq_es : Traced_sigs.Seq_es.S with type ('a, 'e) seq_e_t := ('a, 'e) Seq_e.t and type 'a seq_s_t := 'a Seq_s.t
module Set : Traced_sigs.Set.S with type 'error trace := 'error Trace.trace
OCaml

Innovation. Community. Security.