package octez-l2-libs

  1. Overview
  2. Docs
Octez layer2 libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/octez-l2-libs.layer2_store/Tezos_layer2_store/Delayed_write_monad/index.html

Module Tezos_layer2_store.Delayed_write_monadSource

Monad for values with delayed write effects

Sourcetype ('a, 'store) t

Type to encapsulate values with a callback that should write to disk. This allows to delay some writes to a location where we have write access to the context.

Sourceval no_write : 'a -> ('a, _) t

no_write v returns v together with a write function that does nothing.

Sourceval delay_write : 'a -> ('store -> unit Tezos_base.TzPervasives.tzresult Lwt.t) -> ('a, 'store) t

delay_write v write returns a delayed write version of v with the write function to be called later.

Sourceval map : ('a -> 'b) -> ('a, 'store) t -> ('b, 'store) t

map f dw returns the delayed write dw where f is applied to the encapsulated value.

Sourceval map_es : ('a -> ('b, 'c) result Lwt.t) -> ('a, 'store) t -> (('b, 'store) t, 'c) result Lwt.t

map_es is like map in the Lwt result monad.

Sourceval bind : ('a -> ('b, 'store) t) -> ('a, 'store) t -> ('b, 'store) t

bind f dw returns a delayed write value where f is applied to the encapsulated value and the write effects of f are added to the effects of dw.

Sourceval apply : 'store -> ('a, 'store) t -> 'a Tezos_base.TzPervasives.tzresult Lwt.t

apply node_ctxt dw applies the write effects on the context node_ctxt and returns the encapsulated value.

Sourceval ignore : ('a, _) t -> 'a

ignore dw ignores the write effects and returns the encapsulated value.

Sourcemodule Lwt_result_syntax : sig ... end
OCaml

Innovation. Community. Security.