Lattice

kofre.base.Lattice
See theLattice companion object
trait Lattice[A]

Well, its technically a semilattice, but that is just more to type.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Concise view

Value members

Abstract methods

def merge(left: A, right: A): A

By assumption: associative, commutative, idempotent.

By assumption: associative, commutative, idempotent.

For use with Delta CRDTs, this function should be optimized for the case that left >> right, i.e., that left is the current state and right the delta

Attributes

Concrete methods

def decompose(a: A): Iterable[A]

Decompose a state into potentially smaller parts. The only requirement is that merging the decomposed results produces the original state. Requires a bottom to enable automatic decomposition of Product types Note that the goal here is small individual storage size at reasonable computational cost. Minimalism of returned results is not guaranteed. It is also not guaranteed that the result does not overlap.

Decompose a state into potentially smaller parts. The only requirement is that merging the decomposed results produces the original state. Requires a bottom to enable automatic decomposition of Product types Note that the goal here is small individual storage size at reasonable computational cost. Minimalism of returned results is not guaranteed. It is also not guaranteed that the result does not overlap.

Attributes

def diff(state: A, delta: A): Option[A]

computes delta without state

computes delta without state

Attributes

def lteq(left: A, right: A): Boolean

Lattice order is derived from merge, but should be overridden for efficiency

Lattice order is derived from merge, but should be overridden for efficiency

Attributes

Extensions

Extensions

extension (left: A)
def <=(right: A): Boolean

Lattice order is derived from merge, but should be overridden for efficiency.

Lattice order is derived from merge, but should be overridden for efficiency.

Attributes

def decomposed: Iterable[A]
def merge(right: A): A