Mutare.Mutators.MapSet (mutare v0.1.0)

Copy Markdown View Source

Swap a MapSet set-combination call for its complement:

  • MapSet.unionMapSet.intersection

The two opposite ways to combine two sets — keep-everything-from-either vs keep-only-the-shared — so swapping asks: does the suite actually pin down which combination this code performs, or would the union pass for the intersection (and vice versa)? Classic untested-edge territory when a test only exercises overlapping or disjoint inputs.

Only the commutative combinators live here (order doesn't matter, so the swap is a pure name change). The non-commutative MapSet calls — difference and subset?, where the argument order carries the meaning — are operand-order swaps, so they belong to Mutare.Mutators.OperandSwap, not here.

On by default. Matches aliased (alias MapSet, as: MS; MS.union(a, b)) and bare-imported calls too, while a shadowing alias MyApp.MapSet is left alone. The family atom is :map_set.