Tezos_raw_protocol_012_Psithaca.Gas_monadThis monad combines:
It is useful for backtracking on type checking errors without backtracking the consumed gas.
type ('a, 'trace) gas_monad = ('a, 'trace) tAlias of ('a, 'trace) t to avoid confusion when the module is open
val return : 'a -> ('a, 'trace) tmonadic return operator of the gas monad
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) tVariant of ( >>$ ) to bind uncarbonated functions
val (>??$) :
('a, 'trace) t ->
(('a, 'trace) Tezos_protocol_environment_012_Psithaca.Pervasives.result ->
('b, 'trace) t) ->
('b, 'trace) tAnother variant of ( >>$ ) that lets recover from inner errors
val of_result :
('a, 'trace) Tezos_protocol_environment_012_Psithaca.Pervasives.result ->
('a, 'trace) tgas-free embedding of tzresult values. of_result x is equivalent to return () >?$ fun () -> x
val consume_gas : Alpha_context.Gas.cost -> (unit, 'trace) tA 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.tzresultEscaping 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) tre-export of Error_monad.record_trace_eval. This function has no effect in the case of a gas-exhaustion error.