/** * Given an `Associative` (a way to combine `V`'s, get an `Associative` to combine `>`'s * This preserves keys in both maps `V` * * @tsplus static HashMap.Ops getAssociative */ export function getAssociative(A: Associative): Associative> { return Associative((x, y) => y.reduceWithIndex(x, (z, key, vy) => z.has(key) ? z.update(key, (vx) => A.combine(vx, vy)) : z.set(key, vy)) ) }