def KCounter.merge
import bend-kit-crdt@0.2.0.0/crdt.bend as Crdtimport Base
255# The union of two ID-sorted states, with the maximum count where IDs are equal.
256def KCounter.merge(~K: Data, ~cmp: K -> K -> Cmp, +a: KCounter<K>, +b: KCounter<K>) -> KCounter<K>:
257 KCounter.merge.go(~K, ~cmp, a, b, KCounter.heads(~K, ~cmp, a, b))