Module Mavryk_001_PtAtLas_test_helpers.Result_wrap_syntax

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 Mavryk_base.TzPervasives.Result_syntax
include module type of Mavryk_error_monad.TzLwtreslib.Monad.Result_syntax
val return : 'a -> ('a, 'e) Stdlib.result
val return_unit : (unit, 'e) Stdlib.result
val return_none : ('a option, 'e) Stdlib.result
val return_some : 'a -> ('a option, 'e) Stdlib.result
val return_nil : ('a list, 'e) Stdlib.result
val return_true : (bool, 'e) Stdlib.result
val return_false : (bool, 'e) Stdlib.result
val fail : 'e -> ('a, 'e) Stdlib.result
val let* : ('a, 'e) Stdlib.result -> ('a -> ('b, 'e) Stdlib.result) -> ('b, 'e) Stdlib.result
val let+ : ('a, 'e) Stdlib.result -> ('a -> 'b) -> ('b, 'e) Stdlib.result
val join : (unit, 'e) Stdlib.result list -> (unit, 'e list) Stdlib.result
val all : ('a, 'e) Stdlib.result list -> ('a list, 'e list) Stdlib.result
val both : ('a, 'e) Stdlib.result -> ('b, 'e) Stdlib.result -> ('a * 'b, 'e list) Stdlib.result
val tzfail : 'error -> ('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result
val and* : ('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result -> ('b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result -> ('a * 'b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result
val and+ : ('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result -> ('b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result -> ('a * 'b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result
val tzjoin : (unit, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result list -> (unit, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result
val tzall : ('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result list -> ('a list, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result
val tzboth : ('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result -> ('b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result -> ('a * 'b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.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.