Mavryk_alpha_test_helpers.Lwt_result_wrap_syntax
Extends the Lwt_result_syntax
with additional utilities for wrapping results produced by the protocol, i.e. Environment.Error_monad.tzresult
, to tzresult Lwt.t
values used in the tests.
The added utilities are binding operators. They use the same symbols as the ones from Lwt_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.Lwt_result_syntax
val tzfail :
'error ->
('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t
val and* :
('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t ->
('b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t ->
('a * 'b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t
val and+ :
('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t ->
('b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t ->
('a * 'b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t
val tzjoin :
(unit, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t
list ->
(unit, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t
val tzall :
('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t list ->
('a list, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t
val tzboth :
('a, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t ->
('b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t ->
('a * 'b, 'error Mavryk_base.TzPervasives.TzTrace.trace) Stdlib.result Lwt.t
val wrap :
'a Mavryk_protocol_alpha.Environment.Error_monad.tzresult Lwt.t ->
'a Mavryk_base.TzPervasives.tzresult Lwt.t
wrap res
maps the result type contained in res
to a tzresult value.
val let@ :
'a Mavryk_protocol_alpha.Environment.Error_monad.tzresult ->
('a Mavryk_base.TzPervasives.tzresult -> 'b) ->
'b
let@ x = m in f x
is equivalent to let x = Environment.wrap_tzresult m in f x
val let*@ :
'a Mavryk_protocol_alpha.Environment.Error_monad.tzresult Lwt.t ->
('a -> 'b Mavryk_base.TzPervasives.tzresult Lwt.t) ->
'b Mavryk_base.TzPervasives.tzresult Lwt.t
let*@ x = m in f x
is equivalent to let* x = wrap m in f x
.
Mnemonic: @
"wraps" a protocol error in a shell error.
val let*?@ :
'a Mavryk_protocol_alpha.Environment.Error_monad.tzresult ->
('a -> 'b Mavryk_base.TzPervasives.tzresult Lwt.t) ->
'b Mavryk_base.TzPervasives.tzresult Lwt.t
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.
val let*!@ :
'a Mavryk_protocol_alpha.Environment.Error_monad.tzresult Lwt.t ->
('a Mavryk_base.TzPervasives.tzresult -> 'b Lwt.t) ->
'b Lwt.t
let*!@ x = m in f x
is equivalent to let*! x = wrap m in f x
.
Mnemonic: @
"wraps" a protocol error in a shell error.
val let+@ :
'a Mavryk_protocol_alpha.Environment.Error_monad.tzresult Lwt.t ->
('a -> 'b) ->
'b Mavryk_base.TzPervasives.tzresult Lwt.t
let+@ x = m in f x
is equivalent to let+ x = wrap m in f x
.
Mnemonic: @
"wraps" a protocol error in a shell error.