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:( 'b -> t -> [< `Return of 'a | `Continue of 'b list * view ] ) -> leave:'a leave -> 'b -> t -> 'a

Folding over a node with folding

When entering a node: enter 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 ('b, 'a) state

Interleaved folder state

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

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