Mutare.Decimal.DefaultDrop (mutare_decimal v0.1.0)

Copy Markdown View Source

:decimal_default_drop — drops Decimal arguments that refine a default behavior.

The family removes explicit Decimal refinement arguments so the call falls back to the narrower/default operation:

Decimal.round(num, places)       # -> Decimal.round(num)
Decimal.round(num, places, mode) # -> Decimal.round(num, places)
Decimal.compare(left, right, threshold) # -> Decimal.compare(left, right)
Decimal.eq?(left, right, threshold)     # -> Decimal.eq?(left, right)

It skips literal arguments that are equivalent to the implicit behavior: zero places, half-up rounding, and literal zero thresholds.

Ownership split with the numeric literal families: a literal-number places or threshold is left alone entirely, not just when it equals the default. Core's integer/float literal families already perturb such a literal, and their zero mutant is this drop's semantic twin (round/2's default places is 0, and a zero threshold makes compare/3 behave as compare/2) — dropping the argument as well would mint the same mutant twice. The drop fires when the refinement is a dynamic expression those families cannot reach. The round/3 mode drop's twin on Mutare.Decimal.ModeSwap's side is handled there (it never swaps to :half_up).

Summary

Functions

The dropped-argument labels accepted by qualified mutare ignore directives.

Functions

variants()

@spec variants() :: [atom()]

The dropped-argument labels accepted by qualified mutare ignore directives.