Functional storage using Merkle Patricia tree
Module type
Class type
Library plebeia
Module Plebeia . Diff

3 Tools

type t =
| Add of Node_type.node * Segment.Segs.t
| Del of Segment.Segs.t
| CleanBud of Segment.Segs.t
| ModLeaf of Node_type.node * Value.t * Segment.Segs.t

Segment fbased diff

val pp : Stdlib.Format.formatter -> t -> unit

Pretty printing

val reset_for_another_context : Context.t -> t -> t

Load all the node in the diff and foget Index information so tht the diff can be directly applicable to tree of the another context.

val reset_for_another_context' : src:Context.t -> dst:Context.t -> t -> t
val diff : Context.t -> Node_type.node -> Node_type.node -> t list

diff src dst gets the segment based diff between 2 nodes

val apply : Cursor.t -> t -> ( Cursor.t, Error.t ) Stdlib.result

Add (n,segs) just insert n to the cursor. If Cursor.t uses a different context from the one of diffs, indices in the n must be reset to Not_Indexed.

val apply_and_check : Context.t -> Node_type.node -> Node_type.node -> t list -> unit

Check the diff correctness