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

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 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)
final inline def <=(right: A): Boolean

Convenience extensions for the above.

Convenience extensions for the above.

Attributes

final inline def merge(right: A): A

Convenience extensions for the above.

Convenience extensions for the above.

Attributes