module type DATA =sig
..end
'a data
).
Given an implementation of DATA
, an incremental version of the
container can be produced (via Make
).
type 'a
data
type 'a
patch
val merge : 'a patch ->
'a data -> 'a data
merge p d
is a new container
produced by applying p
on d
. d
does not change.val map_patch : ('a -> 'b) -> 'a patch -> 'b patch
val map_data : ('a -> 'b) -> 'a data -> 'b data
map f d
applies f
on all the elements of d
, producing a
new container in an applicative wayval empty : 'a data
val equal : ('a -> 'a -> bool) ->
'a data -> 'a data -> bool
'a
to an equality
operator over 'a data
val diff : eq:('a -> 'a -> bool) ->
'a data ->
'a data -> 'a patch
diff ?eq d1 d2
produces a patch describing the differences
between d1
and d2
.
The optional ?eq
argument is used for comparing the atoms
inside d1
and d2
. (The default value for eq
is (=)
.)