package octez-protocol-alpha-libs

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

Extends the Result_syntax with additional utilities for wrapping results produced by the protocol, i.e. Environment.Error_monad.tzresult, to tzresult values used in the tests.

The added utilities are binding operators. They use the same symbols as the ones from Result_syntax with an added @ character. This character symbolizes the ewrapping of the internal error monad type in a shell error.

include module type of Tezos_base.TzPervasives.Result_syntax
include module type of Tezos_error_monad.TzLwtreslib.Monad.Result_syntax
val return : 'a -> ('a, 'e) result
val return_unit : (unit, 'e) result
val return_none : ('a option, 'e) result
val return_some : 'a -> ('a option, 'e) result
val return_nil : ('a list, 'e) result
val return_true : (bool, 'e) result
val return_false : (bool, 'e) result
val fail : 'e -> ('a, 'e) result
val let* : ('a, 'e) result -> ('a -> ('b, 'e) result) -> ('b, 'e) result
val let+ : ('a, 'e) result -> ('a -> 'b) -> ('b, 'e) result
val join : (unit, 'e) result list -> (unit, 'e list) result
val all : ('a, 'e) result list -> ('a list, 'e list) result
val both : ('a, 'e) result -> ('b, 'e) result -> ('a * 'b, 'e list) result
val tzfail : 'error -> ('a, 'error Tezos_base.TzPervasives.TzTrace.trace) result

wrap res is equivalent to Environment.wrap_tzresult res

let@ x = m in f x is equivalent to let x = Environment.wrap_tzresult m in f x

let*@ x = m in f x is equivalent to let* x = Environment.wrap_tzresult m in f x. Mnemonic: @ "wraps" a protocol error in a shell error.

let+@ x = m in f x is equivalent to let+ x = Environment.wrap_tzresult m in f x. Mnemonic: @ "wraps" a protocol error in a shell error.

OCaml

Innovation. Community. Security.