:decimal_arithmetic — swaps Decimal arithmetic calls for same-arity siblings and reverses operands for non-commutative arithmetic calls.
The family changes only the function name and keeps the original arguments:
Decimal.add(a, b) # -> Decimal.sub(a, b) / Decimal.mult(a, b)
Decimal.sub(a, b) # -> Decimal.add(a, b)
Decimal.mult(a, b) # -> Decimal.div(a, b)
Decimal.div(a, b) # -> Decimal.mult(a, b) / Decimal.div_int(a, b)
Decimal.div_int(a, b) # -> Decimal.rem(a, b) / Decimal.div(a, b)
Decimal.rem(a, b) # -> Decimal.div_int(a, b)It also reverses operands for Decimal.sub/2, div/2, div_int/2, and rem/2 when both operands are visible and written differently:
Decimal.sub(a, b) # -> Decimal.sub(b, a)It is pipe-aware and resolves qualified, aliased, and imported Decimal calls through Mutare's call resolver. Operand reversal is skipped for piped calls because the first operand is not present in the call node.
Summary
Functions
The target-operation labels accepted by qualified mutare ignore directives.
Functions
@spec variants() :: [atom()]
The target-operation labels accepted by qualified mutare ignore directives.