package tezos-protocol-alpha
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Carbonated_map/Make_builder/Make/index.html
Module Make_builder.MakeSource
Parameters
Signature
singleton k v returns a map with a single key k and value v pair.
val find :
context ->
key ->
'a t ->
('a option * context) Tezos_protocol_environment_alpha.Error_monad.tzresultfind ctxt k m looks up the value with key k in the given map m and also consumes the gas associated with the lookup. The complexity is logarithmic in the size of the map.
val update :
context ->
key ->
(context ->
'a option ->
('a option * context) Tezos_protocol_environment_alpha.Error_monad.tzresult) ->
'a t ->
('a t * context) Tezos_protocol_environment_alpha.Error_monad.tzresultupdate ctxt k f map updates or adds the value of the key k using f. The function accounts for the gas cost for finding the element. The updating function f should also account for its own gas cost. The complexity is logarithmic in the size of the map.
val to_list :
context ->
'a t ->
((key * 'a) list * context)
Tezos_protocol_environment_alpha.Error_monad.tzresultto_list m transforms a map m into a list. It also accounts for the gas cost for traversing the elements. The complexity is linear in the size of the map.
val of_list :
context ->
merge_overlap:
(context ->
'a ->
'a ->
('a * context) Tezos_protocol_environment_alpha.Error_monad.tzresult) ->
(key * 'a) list ->
('a t * context) Tezos_protocol_environment_alpha.Error_monad.tzresultof_list ctxt ~merge_overlaps m creates a map from a list of key-value pairs. In case there are overlapping keys, their values are combined using the merge_overlap function. The function accounts for gas for traversing the elements. merge_overlap should account for its own gas cost. The complexity is n * log n in the size of the list.
val merge :
context ->
merge_overlap:
(context ->
'a ->
'a ->
('a * context) Tezos_protocol_environment_alpha.Error_monad.tzresult) ->
'a t ->
'a t ->
('a t * context) Tezos_protocol_environment_alpha.Error_monad.tzresultmerge ctxt ~merge_overlap m1 m2 merges the maps m1 and m2. In case there are overlapping keys, their values are combined using the merge_overlap function. Gas costs for traversing all elements from both maps are accounted for. merge_overlap should account for its own gas cost. The complexity is n * log n, where n is size m1 + size m2.
val map_e :
context ->
(context ->
key ->
'a ->
('b * context) Tezos_protocol_environment_alpha.Error_monad.tzresult) ->
'a t ->
('b t * context) Tezos_protocol_environment_alpha.Error_monad.tzresultmap_e ctxt f m maps over all key-value pairs in the map m using the function f. It accounts for gas costs associated with traversing the elements. The mapping function f should also account for its own gas cost. The complexity is linear in the size of the map m.
val fold_e :
context ->
(context ->
'state ->
key ->
'value ->
('state * context) Tezos_protocol_environment_alpha.Error_monad.tzresult) ->
'state ->
'value t ->
('state * context) Tezos_protocol_environment_alpha.Error_monad.tzresultfold_e ctxt f z m folds over the key-value pairs of the given map m, accumulating values using f, with z as the initial state. The function f must account for its own gas cost. The complexity is linear in the size of the map m.
val fold_es :
context ->
(context ->
'state ->
key ->
'value ->
('state * context) Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t) ->
'state ->
'value t ->
('state * context) Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.tLwt-aware variant of fold_e.