plebeia

Functional storage using Merkle Patricia tree
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library plebeia
Module Plebeia . Node . Mapper
type 'a mkview = {
bud : (node * 'a) option -> indexed -> hashed -> node * 'a;
extender : Segment.t -> (node * 'a) -> indexed -> hashed -> node * 'a;
internal : (node * 'a) -> (node * 'a) -> indexed -> hashed -> node * 'a;
leaf : Value.t -> indexed -> hashed -> node * 'a;
}
val default_mkview : unit mkview
val map : node:( t -> [< `Return of t * 'a | `Continue of view ] ) -> view:'a mkview -> t -> t * 'a

Mapping over a node with folding

When visiting a node: node is executed with the current node. The function can stop the further traversal by returning `Return _ or continue the traversal by returning `Continue _.

When leaving a node after traversing its sub nodes: When node returns `Continue _ and its subnodes are traversed, then view is executed. It is given a new view consists of the subnodes returned by the traversal and a list of result 'a.

type 'a state

Interleaved mapper state

val interleaved : node:( t -> [< `Return of t * 'a | `Continue of view ] ) -> view:'a mkview -> t -> ( 'a state -> [> `Left of 'a state | `Right of t * 'a ] ) * 'a state

Interleaved version of map. Good to use with Lwt to achieve concurrency