package tezos-protocol-alpha

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

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-16.1.tar.gz
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f

doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Script_map/index.html

Module Tezos_raw_protocol_alpha.Script_mapSource

Functions to ease the manipulation of Michelson maps.

A map in Michelson is a type-homegeneous, partial function of keys to values, along with the functions that operate on the structure (through a first-class module).

Sourceval make : (module Script_typed_ir.Boxed_map with type key = 'key and type value = 'value) -> ('key, 'value) Script_typed_ir.map
Sourceval get_module : ('key, 'value) Script_typed_ir.map -> (module Script_typed_ir.Boxed_map with type key = 'key and type value = 'value)

empty cmp_ty creates a map module where keys have size Gas_comparable_input_size.size_of_comparable_value cmp_ty and are compared with Script_comparable.compare_comparable cmp_ty (used for sorting keys, which ensures a reasonable complexity of the map functions). The function returns an empty map packaged as a first-class map module.

Sourceval empty_from : ('a, 'b) Script_typed_ir.map -> ('a, 'c) Script_typed_ir.map

empty_from map creates an empty map module where the size of keys and the comparison function are those of map.

Sourceval fold : ('key -> 'value -> 'acc -> 'acc) -> ('key, 'value) Script_typed_ir.map -> 'acc -> 'acc
Sourceval update : 'a -> 'b option -> ('a, 'b) Script_typed_ir.map -> ('a, 'b) Script_typed_ir.map

update k (Some v) map associates v to k in map (overwriting the previous value, if any), and update k None map removes the potential association to k in map.

Sourceval mem : 'key -> ('key, 'value) Script_typed_ir.map -> bool
Sourceval get : 'key -> ('key, 'value) Script_typed_ir.map -> 'value option
OCaml

Innovation. Community. Security.