package octez-libs

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

The traced Result monad: for successes and traced failures

The Traced_result_syntax module is similar to the Result_syntax module with the following differences:

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

See Result_syntax.

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

fail e is (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 -> ('a -> ('b, 'e) Stdlib.result) -> ('b, 'e) Stdlib.result
val and* : ('a, 'e trace) Stdlib.result -> ('b, 'e trace) Stdlib.result -> ('a * 'b, 'e trace) Stdlib.result
val let+ : ('a, 'e) Stdlib.result -> ('a -> 'b) -> ('b, 'e) Stdlib.result
val and+ : ('a, 'e trace) Stdlib.result -> ('b, 'e trace) Stdlib.result -> ('a * 'b, 'e trace) Stdlib.result
val join : (unit, 'error trace) Stdlib.result list -> (unit, 'error trace) Stdlib.result
val all : ('a, 'error trace) Stdlib.result list -> ('a list, 'error trace) Stdlib.result
val both : ('a, 'error trace) Stdlib.result -> ('b, 'error trace) Stdlib.result -> ('a * 'b, 'error trace) Stdlib.result
OCaml

Innovation. Community. Security.