package octez-l2-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a
doc/octez-l2-libs.layer2_store/Tezos_layer2_store/Delayed_write_monad/index.html
Module Tezos_layer2_store.Delayed_write_monad
Source
Monad for values with delayed write effects
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.
no_write v
returns v
together with a write function that does nothing.
val 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.
map f dw
returns the delayed write dw
where f
is applied to the encapsulated value.
val 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.
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
.
apply node_ctxt dw
applies the write effects on the context node_ctxt
and returns the encapsulated value.
ignore dw
ignores the write effects and returns the encapsulated value.