Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file immutable_types.ml
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091(** This module contains all immutable CRDT types, as well as some type
properties that CRDT state must satisfy. *)(** Comparable types. All elements in a set must satisfy this property.
Same as the built-in [Set.OrderedType], this type includes a [t] and a
[compare : t -> t -> int] function. See [Pervasives.compare] *)moduletypeComparable=sigincludeSet.OrderedTypeend(** Mergeable types. All CRDTs satisfy this property. *)moduletypeMergeable=sig(** Type of mergeable elements. *)typet(** Create a new mergeable element. *)valmake:unit->t(** [merge a b] will merge the state of [a] and the one from [b] to create
a new mergeable element. *)valmerge:t->t->tend(** Vector Clock and increment-only counter types. Supports merging and
incrementing. The [elt] type must be supplied when including. *)moduletypeIVector=sigincludeMergeable(** Type of the contents of an [IVector] *)typeelt(** [make_in_range n] creates a new [IVector] of size ranging from [0] to [n].
being [n] greater than 0 and smaller than 2^30.
When merging two CRDTs of different sizes, the smaller one grows and pads
the remaining space with zeros. *)valmake_in_range:int->t(** [query t] returns the raw state of [t] *)valquery:t->elt(** [incr t] increments the position associated with the [numsite] of [t].
See {!module:I_IntVector} for more information on [numsites]. *)valincr:t->tend(** Increment / decrement counter type. Supports merging, incrementing and
decrementing.
The [elt] type (included from [IVector] must be supplied when including). *)moduletypeDCounter=sigincludeIVector(** [decr t] decrements the position associated with the [numsite] of [t].
See {!module:I_IntVector} for more information on [numsites]. *)valdecr:t->tend(** Grow-Only set type. Supports merging, adding and lookup operations. *)moduletypeGSet=sigincludeMergeable(** Type of the contents of [GSet] *)typeelt(** [add el t] adds [el] to [t]. *)valadd:elt->t->t(** [value t] gets the raw state of [t]. *)valvalue:t->eltlist(** [lookup el t] returns true if [el] is in [t]. *)vallookup:elt->t->boolend(** Add and remove set type. Supports merging, adding and lookup operations. *)moduletypeRSet=sigincludeGSet(** [remove el t] removes [el] from [t] only if [el] is in [t].
Returns [t] otherwise. *)valremove:elt->t->tend