Lattice

rdts.base.Lattice
See theLattice companion trait
object Lattice

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Lattice.type

Members list

Type members

Classlikes

object Derivation

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Derivation.type
trait OrdinalLattices[T]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class MirrorOrdinal[T]
object syntax

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
syntax.type

Value members

Concrete methods

def assertEquals[A]: Lattice[A]
def assertEqualsOrdering[A]: Ordering[A]
inline def derived[T <: Product : ProductOf]: Lattice[T]
def diff[A : Decompose](state: A, delta: A)(using A: Lattice[A], evidence$1: Decompose[A]): Option[A]
def fromOrdering[A : Ordering]: Lattice[A]
def latticeOrder[A](using A: Lattice[A]): PartialOrdering[A]
def merge[A](left: A, right: A)(using A: Lattice[A]): A
def normalize[A : Lattice](v: A): A

Some types have multiple structural representations for semantically the same value, e.g., they may contain redundant or replaced parts. This can lead to semantically equivalent values that are not structurally equal. Normalize tries to fix this.

Some types have multiple structural representations for semantically the same value, e.g., they may contain redundant or replaced parts. This can lead to semantically equivalent values that are not structurally equal. Normalize tries to fix this.

Attributes

inline def productLattice[T <: Product](using pm: ProductOf[T]): Lattice[T]
def subsumption[A](left: A, right: A)(using A: Lattice[A]): Boolean
inline def sumLattice[T](using sm: SumOf[T]): Lattice[T]

Sum Lattice merges considers later defined (those with larger ordinals) constructors as larger. Notably, this implies None < Some for Option and Left < Right for Either. For an enum E { case A, B, C } it will be A < B < C

Sum Lattice merges considers later defined (those with larger ordinals) constructors as larger. Notably, this implies None < Some for Option and Left < Right for Either. For an enum E { case A, B, C } it will be A < B < C

Attributes

Givens

Givens

given functionLattice[K, V : Lattice]: Lattice[K => V]
given iterableLattice[A, It <: (IterableOps)](using Lattice[A]): Lattice[It[A]]
given mapLattice[K, V : Lattice, Mp <: (MapOps)]: Lattice[Mp[K, V]]
given optionLattice[A : Lattice]: Lattice[Option[A]]
given setLattice[A]: setLattice[A]
given syntax: syntax
inline given tupleLattice[T <: Tuple](using pm: ProductOf[T]): Lattice[T]

This causes tuple lattices to be generally derivable implicitly, without making all products derivable implicitly.

This causes tuple lattices to be generally derivable implicitly, without making all products derivable implicitly.

Attributes