Reverses the first two operands of non-commutative operators and calls.
Operators
-,/, and**<>++and--div,rem— integer division / remainder.
The operator is retained; only the operands are exchanged.
The following operators are excluded:
>,>=,<, and<=, becauseMutare.Mutators.Relationalalready produces the equivalent direction change- commutative operators such as
+,*, equality, and boolean operators in, because the swapped right operand may not be enumerable=and|>, whose operands have different roles
Calls
The first two arguments are exchanged in these calls:
before?/2,after?/2,compare/2, anddiff/2,3onDateTime,Date,Time, andNaiveDateTime, where those functions existVersion.compare/2MapSet.difference/2andMapSet.subset?/2
A trailing unit in diff/3 is retained and may be mutated separately by Mutare.Mutators.ModeSwap.
Aliased and imported calls are supported. An alias that resolves to another module does not match.
Piped calls
A pipe stage is the call it is sugar for, so its piped value is the first operand and the transpose moves it:
foo |> Kernel.++(bar) → bar |> Kernel.++(foo)This is how a pipe expresses an operator, so the explicit Kernel call forms (Kernel.++, Kernel.-, Kernel.<>, Kernel.div, …) are transposed like the operators they name, written directly or piped.
Skipped cases
Identical operands are not swapped. Unary minus has no second operand and is handled by Mutare.Mutators.Arithmetic.
Guard-safe operators and calls are also mutated in guards.