Library
Module
Module type
Parameter
Class
Class type
module Field : sig ... end
This module contains what might be described as faux lenses. This includes support for composition, getting, setting, etc.
leaf ~field ~equal
is a terminal node in the spec tree.
When computing a diff, the fields are gotten using Field.get
and compared with equal
. If the values are not equal, the diff includes the new value.
child ~field ~spec
is an intermediate node in the spec tree.
When computing a diff, the diff for the children is recursively computed.
opt_child ~field ~spec
is an optional intermediate node in the spec tree.
When computing a diff, the diff for the children is recursively computed if the child is present.
Represents a difference between two records of the same type.
compute v0 v1 spec
returns a list of all the differences between v0
and v1
using spec
to traverse the values.
val apply : 'a -> 'a t -> 'a
apply v diff
returns v
with diff
applied
val apply_all : 'a -> 'a t list -> 'a
apply_all v diffs
returns v
with all diffs
applied