package tezos-protocol-012-Psithaca

  1. Overview
  2. Docs
Tezos/Protocol: economic-protocol definition

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-17.3.tar.gz
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc

doc/tezos-protocol-012-Psithaca.raw/Tezos_raw_protocol_012_Psithaca/Gas_monad/index.html

Module Tezos_raw_protocol_012_Psithaca.Gas_monadSource

Sourcetype ('a, 'trace) t

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.

Sourcetype ('a, 'trace) gas_monad = ('a, 'trace) t

Alias of ('a, 'trace) t to avoid confusion when the module is open

Sourceval return : 'a -> ('a, 'trace) t

monadic return operator of the gas monad

Sourceval (>>$) : ('a, 'trace) t -> ('a -> ('b, 'trace) t) -> ('b, 'trace) t

Binding operator for the gas monad

Sourceval (>|$) : ('a, 'trace) t -> ('a -> 'b) -> ('b, 'trace) t

Mapping operator for the gas monad, m >|$ f is equivalent to m >>$ fun x -> return (f x)

Sourceval (>?$) : ('a, 'trace) t -> ('a -> ('b, 'trace) Tezos_protocol_environment_012_Psithaca.Pervasives.result) -> ('b, 'trace) t

Variant of ( >>$ ) to bind uncarbonated functions

Sourceval (>??$) : ('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

Sourceval 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

Sourceval consume_gas : Alpha_context.Gas.cost -> (unit, 'trace) t

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.

re-export of Error_monad.record_trace_eval. This function has no effect in the case of a gas-exhaustion error.

OCaml

Innovation. Community. Security.