plebeia

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

Folding over a node with folding

When entering 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 enter returns `Continue _ and its subnodes are traversed, then leave is executed.

type 'a state

Interleaved folder state

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

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