package tezos-base

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

The Lwt traced Result monad: for concurrent successes and traced failures

The Lwt_traced_result_syntax module is similar to the Lwt_result_syntax module with the following difference:

  • fail wraps the error in a trace,
  • and* and and+ are provided.

See Lwt_result_syntax.

val return : 'a -> ('a, 'error) result Lwt.t
val return_unit : (unit, 'error) result Lwt.t
val return_none : ('a option, 'error) result Lwt.t
val return_some : 'a -> ('a option, 'error) result Lwt.t
val return_nil : ('a list, 'error) result Lwt.t
val return_true : (bool, 'error) result Lwt.t
val return_false : (bool, 'error) result Lwt.t
val fail : 'error -> ('a, 'error TzTrace.trace) result Lwt.t

fail e is Lwt.return (Error (Trace.make e)) where Trace is the Traced_sigs.Trace module that provides the trace type and functions.

val let* : ('a, 'e) result Lwt.t -> ('a -> ('b, 'e) result Lwt.t) -> ('b, 'e) result Lwt.t
val and* : ('a, 'e TzTrace.trace) result Lwt.t -> ('b, 'e TzTrace.trace) result Lwt.t -> ('a * 'b, 'e TzTrace.trace) result Lwt.t
val let+ : ('a, 'e) result Lwt.t -> ('a -> 'b) -> ('b, 'e) result Lwt.t
val and+ : ('a, 'e TzTrace.trace) result Lwt.t -> ('b, 'e TzTrace.trace) result Lwt.t -> ('a * 'b, 'e TzTrace.trace) result Lwt.t
val let*! : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t
val let*? : ('a, 'e) result -> ('a -> ('b, 'e) result Lwt.t) -> ('b, 'e) result Lwt.t
val join : (unit, 'error TzTrace.trace) result Lwt.t list -> (unit, 'error TzTrace.trace) result Lwt.t
val all : ('a, 'error TzTrace.trace) result Lwt.t list -> ('a list, 'error TzTrace.trace) result Lwt.t
val both : ('a, 'error TzTrace.trace) result Lwt.t -> ('b, 'error TzTrace.trace) result Lwt.t -> ('a * 'b, 'error TzTrace.trace) result Lwt.t
OCaml

Innovation. Community. Security.