package tezos-protocol-012-Psithaca
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ad9e08819871c75ba6f4530b125f7d157799398e4d77a1e6bfea9d91ff37ff55
sha512=c5dc4d40cc09bc6980fbbdb5c2e105bf4252cf9cfcb2b49660b0ebe4dc789f6709ec3b3bf2f87d81580d3eed9521eeb1c960f24d9b14eb0285aaba1f84d10a9b
doc/tezos-protocol-012-Psithaca.raw/Tezos_raw_protocol_012_Psithaca/Gas_monad/index.html
Module Tezos_raw_protocol_012_Psithaca.Gas_monad
Source
This monad combines:
- a state monad where the state is the context
- two levels of error monad to distinguish gas exhaustion from other errors
It is useful for backtracking on type checking errors without backtracking the consumed gas.
Alias of ('a, 'trace) t
to avoid confusion when the module is open
Binding operator for the gas monad
Mapping operator for the gas monad, m >|$ f
is equivalent to m >>$ fun x -> return (f x)
val (>?$) :
('a, 'trace) t ->
('a ->
('b, 'trace) Tezos_protocol_environment_012_Psithaca.Pervasives.result) ->
('b, 'trace) t
Variant of ( >>$ )
to bind uncarbonated functions
val (>??$) :
('a, 'trace) t ->
(('a, 'trace) Tezos_protocol_environment_012_Psithaca.Pervasives.result ->
('b, 'trace) t) ->
('b, 'trace) t
Another variant of ( >>$ )
that lets recover from inner errors
val of_result :
('a, 'trace) Tezos_protocol_environment_012_Psithaca.Pervasives.result ->
('a, 'trace) t
gas-free embedding of tzresult values. of_result x
is equivalent to return () >?$ fun () -> x
A wrapper around Gas.consume. If that fails, the whole computation within the Gas_monad returns an error. See the Alpha_context.Gas module for details.
val run :
Alpha_context.context ->
('a, 'trace) t ->
(('a, 'trace) Tezos_protocol_environment_012_Psithaca.Pervasives.result
* Alpha_context.context)
Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult
Escaping the gas monad
val record_trace_eval :
(unit -> 'err) ->
('a, 'err Tezos_protocol_environment_012_Psithaca.Error_monad.trace) t ->
('a, 'err Tezos_protocol_environment_012_Psithaca.Error_monad.trace) t
re-export of Error_monad.record_trace_eval
. This function has no effect in the case of a gas-exhaustion error.