LWWMap
A map from K to last-writer-wins values V: per-key LWWRegisters composed under union-merge of keys. Each set writes one key with a (timestamp, replicaId) tag; merge picks the per-key max tag.
Suited to settings, ready-toggles, and similar small key→latest-value state where surfacing concurrent edits (a la MVRegister) is unwanted.
Clock-skew warning. Wall-clock timestamps work only when clocks are well-synchronized across all replicas. NTP-class drift will cause surprising silent drops: a write with a lagging timestamp loses to an older write from a faster clock. For correctness under arbitrary clock skew, pair this map with a Hybrid Logical Clock above this layer.
Samples
val a = ReplicaId("A")
val b = ReplicaId("B")
val left = LWWMap.empty<String, Int>()
.set(a, timestamp = 1L, key = "score", value = 10)
val right = LWWMap.empty<String, Int>()
.set(b, timestamp = 2L, key = "score", value = 20)
val merged = left.piece(right)
check(merged["score"] == 20) // ts=2 wins for this keyContent copied to clipboard