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) Stdlib.result Lwt.t
val return_unit : (unit, 'error) Stdlib.result Lwt.t
val return_none : ('a option, 'error) Stdlib.result Lwt.t
val return_some : 'a -> ('a option, 'error) Stdlib.result Lwt.t
val return_nil : ('a list, 'error) Stdlib.result Lwt.t
val return_true : (bool, 'error) Stdlib.result Lwt.t
val return_false : (bool, 'error) Stdlib.result Lwt.t
val fail : 'error -> ('a, 'error TzTrace.trace) Stdlib.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) Stdlib.result Lwt.t -> ('a -> ('b, 'e) Stdlib.result Lwt.t) -> ('b, 'e) Stdlib.result Lwt.t
val and* : ('a, 'e TzTrace.trace) Stdlib.result Lwt.t -> ('b, 'e TzTrace.trace) Stdlib.result Lwt.t -> ('a * 'b, 'e TzTrace.trace) Stdlib.result Lwt.t
val let+ : ('a, 'e) Stdlib.result Lwt.t -> ('a -> 'b) -> ('b, 'e) Stdlib.result Lwt.t
val and+ : ('a, 'e TzTrace.trace) Stdlib.result Lwt.t -> ('b, 'e TzTrace.trace) Stdlib.result Lwt.t -> ('a * 'b, 'e TzTrace.trace) Stdlib.result Lwt.t
val let*! : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t
val let*? : ('a, 'e) Stdlib.result -> ('a -> ('b, 'e) Stdlib.result Lwt.t) -> ('b, 'e) Stdlib.result Lwt.t
val join : (unit, 'error TzTrace.trace) Stdlib.result Lwt.t list -> (unit, 'error TzTrace.trace) Stdlib.result Lwt.t
val all : ('a, 'error TzTrace.trace) Stdlib.result Lwt.t list -> ('a list, 'error TzTrace.trace) Stdlib.result Lwt.t
val both : ('a, 'error TzTrace.trace) Stdlib.result Lwt.t -> ('b, 'error TzTrace.trace) Stdlib.result Lwt.t -> ('a * 'b, 'error TzTrace.trace) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.