ORMapEntry

@Serializable(with = ORMapEntrySerializer::class)
class ORMapEntry<S : Quilted<S>>(val contributions: Map<Dot, S> = emptyMap()) : DotStore<ORMapEntry<S>>

An entry of an ORMap: the key's presence tags, each carrying the value that was written under it. The key's observable value is the join of every tag's contribution; the tags are the observed-remove handle for the key.

Why the value hangs off the dots and not off the entry (#2086). The obvious shape — one tag set plus one value beside it — is not a join-semilattice. An entry has exactly one value slot, so a join that keeps two operands' contributions must blend them into that slot, and no later join can tell them apart again. Retire one of the two tags afterwards and the blend keeps the contribution the tag was carrying, so the result depends on the order the operands were joined in. That is not a bug in any one line: any entry-level value has it, because the value stops being a function of which dots are live. Attaching each write to the dot that made it restores the correspondence — a contribution survives exactly as long as its tag does — and the join becomes the same causal filter DotSet already uses, which is associative.

Invariant: a dot names one write. contributions maps a dot to the value written under it, and a dot is minted once, so wherever it appears it carries the same value. join still folds the two sides with Quilted.piece rather than picking one, so a violation degrades to a merge instead of a silent asymmetry between a ⊔ b and b ⊔ a.

Constructors

Link copied to clipboard
constructor(contributions: Map<Dot, S> = emptyMap())

Properties

Link copied to clipboard
Link copied to clipboard
open override val dots: Set<Dot>

Every dot currently live in this store.

Link copied to clipboard
open override val empty: ORMapEntry<S>

The structural empty. Used by DotMap.join when this entry appears only on one side.

Link copied to clipboard
open override val isBottom: Boolean

True when the store holds no dots.

Link copied to clipboard
val value: S?

The key's value: every live contribution, joined. null only when the entry is bottom, which DotMap.join drops — so a key that is present always has a value.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun join(other: ORMapEntry<S>, context: DotContext, otherContext: DotContext): ORMapEntry<S>

The causal join with other. A dot is kept when it is live in both stores, or live in one and not yet witnessed by the other side's context; it is dropped only when one side still has it while the other has it in otherContext but not in its store — the signature of a deliberate remove. context is this store's surrounding causal history; otherContext is the other's.

Link copied to clipboard
open override fun toString(): String