Functional Weave
Code in Python

money.compare@2.0.0

impl/python/max_money.py

240 bytes · the Python implementation · view raw

Imports name this capability’s declared dependencies, which fune builds next to it in your project; each one links to its page.

from .money_amount import Money  ← from money.amount ^1.0.0 · built alongside by fune
from .money_compare_compare_money import compare_money  ← compareMoney, another function of this group · built into the same file, even by a slim install


def max_money(a: Money, b: Money) -> Money:
    """The larger amount; the first when they are equal."""
    return b if compare_money(b, a) > 0 else a