Library
Module
Module type
Parameter
Class
Class type
The necessary monadic operators the storage monad is required to provide.
val let*? :
('a, Tezos_protocol_environment_013_PtJakart.Error_monad.error)
Tezos_protocol_environment_013_PtJakart.Pervasives.result ->
('a -> 'b m) ->
'b m
let*?
is for binding the value from Result-only expressions into the storage monad.
val fail : Tezos_protocol_environment_013_PtJakart.Error_monad.error -> 'a m
fail err
shortcuts the current computation by raising an error.
Said error can be handled with the catch
combinator.
val catch :
'a m ->
('a -> 'b m) ->
(Tezos_protocol_environment_013_PtJakart.Error_monad.error -> 'b m) ->
'b m
catch p k h
tries to executes the monadic computation p
. If p
terminates without an error, then its result is passed to the continuation k
. On the contrary, if an error err
is raised, it is passed to the error handler h
.
val return : 'a -> 'a m
return x
is the simplest computation inside the monad m
which simply computes x
and nothing else.
list_fold_left_m f
is a monadic version of List.fold_left
f
, wherein f
is not a pure computation, but a computation in the monad m
.
val fail_unless :
bool ->
Tezos_protocol_environment_013_PtJakart.Error_monad.error ->
unit m
fail_unless cond err
raises err
iff cond
is false
.
val fail_when :
bool ->
Tezos_protocol_environment_013_PtJakart.Error_monad.error ->
unit m
fail_when cond err
raises err
iff cond
is true
.