Mutare.Decimal.DefaultDrop (mutare_decimal v0.2.1)

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.

To avoid duplicates with the numeric literal families, numeric literal places and thresholds are skipped, even when they differ from the default. Mutare's integer/float literal families already mutate these to zero, which is equivalent to dropping the argument: round/2 defaults to zero places, and a zero threshold makes compare/3 behave as compare/2. Dropping a dynamic refinement expression still produces a mutation, since the numeric literal families do not replace whole dynamic expressions. To avoid duplicating the round/3 mode drop, Mutare.Decimal.ModeSwap excludes :half_up as a swap target.

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.