Mutare.Mutators.MapSet (mutare v0.4.1)

Copy Markdown View Source

Swap a MapSet set-combination call for its complement:

  • MapSet.union ↔ MapSet.intersection

The two opposite ways to combine two sets — keep-everything-from-either vs keep-only-the-shared — so the swap tests whether the suite distinguishes union from intersection. 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.