Lattice

rdts.base.Lattice
See theLattice companion object
@FunctionalInterface
trait Lattice[A]

A lattice describes a set of values where we always can merge two values and get a “consistent” result. Technically, this is a join semilattice. See also Bottom.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class DecoratedLattice[A]
class ProductLattice[T]
class SumLattice[T]
object lattice
Show all

Members list

Value members

Abstract methods

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

By assumption: associative, commutative, idempotent.

By assumption: associative, commutative, idempotent.

Implementation note: If it matters, assume that left is the current state and right is an added delta. All code should assume that left is the larger state (and optimize for this). If left == right, prefer to return left.

Attributes

Concrete methods

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

Subsumption states that left <= right in the sense that everything information in left is already contained in right. Overriding implementations must make sure that they compute exactly the same results as the equation below.

Subsumption states that left <= right in the sense that everything information in left is already contained in right. Overriding implementations must make sure that they compute exactly the same results as the equation below.

Attributes

Extensions

Extensions

extension (left: A)
inline def inflates(right: A): Boolean

Merging left into right is strictly larger than right

Merging left into right is strictly larger than right

Attributes

inline def merge(right: A): A

Convenience extensions for the above.

Convenience extensions for the above.

Attributes

inline def subsumes(right: A): Boolean

Merging right into left has no effect

Merging right into left has no effect

Attributes