{
  "id": "lending",
  "title": "Lending and loans",
  "summary": "Loans from quote to redemption: level repayments, amortisation schedules, APR, daily interest, overpayments, early settlement, affordability and LTV.",
  "synonyms": [
    "loans",
    "lending",
    "loan calculator",
    "mortgage",
    "mortgage calculator",
    "consumer credit",
    "personal loan",
    "car finance",
    "credit",
    "borrowing",
    "repayment calculator",
    "amortization",
    "loan servicing"
  ],
  "apps": [
    "loan calculator",
    "lending platform",
    "mortgage broker app",
    "loan management system",
    "consumer credit app",
    "car finance quote tool",
    "peer to peer lending app"
  ],
  "language": "rust",
  "includes": [
    "money-basics",
    "dates-basics",
    "validation-basics"
  ],
  "includedBy": [],
  "caveats": [
    "Not financial advice. APR and early settlement follow the UK Consumer Credit Act rules (FCA CONC); a regulated lender must have its compliance team confirm how the app uses them."
  ],
  "sections": [
    {
      "key": "quotes",
      "title": "Quotes and repayments",
      "purpose": "Price a loan: the regular repayment and what it costs in total.",
      "from": "lending",
      "members": [
        {
          "id": "lending.loan-payment",
          "tier": "core",
          "why": "The level (annuity) repayment for a principal, rate and term, rounded the way you choose.",
          "section": "quotes",
          "from": "lending",
          "version": "1.0.1",
          "summary": "Level repayment for a loan (annuity formula), computed exactly and rounded once, the way you choose.",
          "status": "unreviewed",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "loanPayment"
          ],
          "signatures": [
            "pub fn loan_payment(principal: &Money, annual_rate_basis_points: i64, term_months: i64, payments_per_year: i64, mode: &RoundingMode) -> Money"
          ],
          "reference": "fune!(lending.loan-payment@^1);  // then call loan_payment(…)",
          "url": "http://www.functionalweave.com/functions/lending.loan-payment"
        },
        {
          "id": "lending.apr",
          "tier": "core",
          "why": "The consumer-credit APR from drawdowns and repayments by the FCA CONC equation, for quotes and agreements.",
          "section": "quotes",
          "from": "lending",
          "version": "1.0.1",
          "summary": "Consumer-credit APR from drawdowns and repayments, by the FCA CONC App 1.2.6 equation, to one decimal place.",
          "status": "unreviewed",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "apr"
          ],
          "signatures": [
            "pub fn apr(advances: &[CreditFlow], repayments: &[CreditFlow], periods_per_year: i64) -> AprResult"
          ],
          "reference": "fune!(lending.apr@^1);  // then call apr(…)",
          "url": "http://www.functionalweave.com/functions/lending.apr"
        },
        {
          "id": "finance.compound-interest",
          "tier": "optional",
          "why": "Compound interest accrued period by period in minor units, for savings-style or interest-only illustrations.",
          "section": "quotes",
          "from": "lending",
          "version": "1.0.0",
          "summary": "Compound interest accrued period by period in minor units, the way a statement is built.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "compoundInterest"
          ],
          "signatures": [
            "pub fn compound_interest(principal: &Money, annual_rate_basis_points: i64, periods_per_year: i64, years: i64) -> CompoundInterestResult"
          ],
          "reference": "fune!(finance.compound-interest@^1);  // then call compound_interest(…)",
          "url": "http://www.functionalweave.com/functions/finance.compound-interest"
        }
      ],
      "gaps": []
    },
    {
      "key": "schedules",
      "title": "Schedules and interest",
      "purpose": "Lay out each period's interest, principal and balance, and accrue interest on a changing balance.",
      "from": "lending",
      "members": [
        {
          "id": "lending.amortisation-schedule",
          "tier": "core",
          "why": "Per-period interest, principal and balance for a level-payment loan, ending at exactly zero.",
          "section": "schedules",
          "from": "lending",
          "version": "1.0.1",
          "summary": "Repayment schedule for a level-payment loan: interest, principal and balance per period, ending at exactly zero.",
          "status": "unreviewed",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "amortisationSchedule"
          ],
          "signatures": [
            "pub fn amortisation_schedule(principal: &Money, annual_rate_basis_points: i64, term_months: i64, payments_per_year: i64, mode: &RoundingMode) -> AmortisationSchedule"
          ],
          "reference": "fune!(lending.amortisation-schedule@^1);  // then call amortisation_schedule(…)",
          "url": "http://www.functionalweave.com/functions/lending.amortisation-schedule"
        },
        {
          "id": "lending.daily-interest",
          "tier": "core",
          "why": "Interest accrued day by day on a changing balance under a day-count convention.",
          "section": "schedules",
          "from": "lending",
          "version": "1.0.1",
          "summary": "Interest accrued day by day on a changing balance under a day-count convention, summed exactly and rounded once.",
          "status": "unreviewed",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "dailyInterest"
          ],
          "signatures": [
            "pub fn daily_interest(balances: &[DatedBalance], from_iso: &str, to_iso: &str, annual_rate_basis_points: i64, convention: &DayCountConvention, mode: &RoundingMode) -> DailyInterest"
          ],
          "reference": "fune!(lending.daily-interest@^1);  // then call daily_interest(…)",
          "url": "http://www.functionalweave.com/functions/lending.daily-interest"
        },
        {
          "id": "dates.day-count-fraction",
          "tier": "optional",
          "why": "Year fraction by ACT/365F, ACT/360, 30/360 or ACT/ACT, for the interest convention.",
          "section": "schedules",
          "from": "lending",
          "version": "1.0.0",
          "summary": "Year fraction between two dates by ACT/365F, ACT/360, 30/360, 30E/360 or ACT/ACT ISDA, as an exact fraction.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "dayCountFraction"
          ],
          "signatures": [
            "pub fn day_count_fraction(start_iso: &str, end_iso: &str, convention: &str) -> YearFraction"
          ],
          "reference": "fune!(dates.day-count-fraction@^1);  // then call day_count_fraction(…)",
          "url": "http://www.functionalweave.com/functions/dates.day-count-fraction"
        },
        {
          "id": "finance.uk-bank-rate",
          "tier": "optional",
          "why": "Bank of England Bank Rate on a date, for tracker and variable-rate loans set over base.",
          "section": "schedules",
          "from": "lending",
          "version": "1.0.1",
          "summary": "Bank of England Bank Rate (base rate) in force on a date, from the Bank's official history since 2001.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "ukBankRate"
          ],
          "signatures": [
            "pub fn uk_bank_rate(on_date: &str) -> BankRate"
          ],
          "reference": "fune!(finance.uk-bank-rate@^1);  // then call uk_bank_rate(…)",
          "url": "http://www.functionalweave.com/functions/finance.uk-bank-rate"
        }
      ],
      "gaps": []
    },
    {
      "key": "changes",
      "title": "Overpayments and settlement",
      "purpose": "Answer what happens when a borrower pays more or pays off early.",
      "from": "lending",
      "members": [
        {
          "id": "lending.early-settlement",
          "tier": "core",
          "why": "Settlement figure and rebate on UK regulated consumer credit under the 2004 Early Settlement Regulations.",
          "section": "changes",
          "from": "lending",
          "version": "1.0.1",
          "summary": "Early settlement figure and rebate on UK regulated consumer credit, per the Early Settlement Regulations 2004.",
          "status": "unreviewed",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "earlySettlement"
          ],
          "signatures": [
            "pub fn early_settlement(advances: &[DatedAmount], repayments: &[DatedAmount], apr_basis_points: i64, notice_received_iso: &str, requested_settlement_iso: Option<&str>, deferral: &str) -> EarlySettlement"
          ],
          "reference": "fune!(lending.early-settlement@^1);  // then call early_settlement(…)",
          "url": "http://www.functionalweave.com/functions/lending.early-settlement"
        },
        {
          "id": "lending.overpayment-effect",
          "tier": "optional",
          "why": "What a one-off overpayment does: a shorter term at the same payment, or a lower payment.",
          "section": "changes",
          "from": "lending",
          "version": "1.0.1",
          "summary": "What a one-off overpayment does to a loan: a shorter term at the same payment, or a lower payment over the same term.",
          "status": "unreviewed",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "overpaymentEffect"
          ],
          "signatures": [
            "pub fn overpayment_effect(balance: &Money, annual_rate_basis_points: i64, remaining_term_months: i64, payments_per_year: i64, payment: &Money, overpayment: &Money, mode: &RoundingMode) -> OverpaymentEffect"
          ],
          "reference": "fune!(lending.overpayment-effect@^1);  // then call overpayment_effect(…)",
          "url": "http://www.functionalweave.com/functions/lending.overpayment-effect"
        }
      ],
      "gaps": []
    },
    {
      "key": "underwriting",
      "title": "Affordability and underwriting",
      "purpose": "Decide whether a borrower can afford the loan.",
      "from": "lending",
      "members": [
        {
          "id": "lending.affordability",
          "tier": "core",
          "why": "Debt-to-income and a stressed-rate affordability test for the new loan's monthly repayment.",
          "section": "underwriting",
          "from": "lending",
          "version": "1.0.1",
          "summary": "Debt-to-income and a stressed-rate affordability test for a proposed loan's monthly repayment.",
          "status": "unreviewed",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "affordability"
          ],
          "signatures": [
            "pub fn affordability(monthly_income: &Money, monthly_commitments: &Money, principal: &Money, annual_rate_basis_points: i64, stress_rate_basis_points: i64, term_months: i64, max_debt_to_income_basis_points: i64) -> AffordabilityResult"
          ],
          "reference": "fune!(lending.affordability@^1);  // then call affordability(…)",
          "url": "http://www.functionalweave.com/functions/lending.affordability"
        },
        {
          "id": "lending.ltv",
          "tier": "optional",
          "why": "Loan-to-value in basis points and its band from your band table, for secured lending.",
          "section": "underwriting",
          "from": "lending",
          "version": "1.0.1",
          "summary": "Loan-to-value ratio in basis points, and the band it falls in from a band table you supply.",
          "status": "unreviewed",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "loanToValue"
          ],
          "signatures": [
            "pub fn loan_to_value(loan: &Money, property_value: &Money, bands: &[LtvBand]) -> LtvResult"
          ],
          "reference": "fune!(lending.ltv@^1);  // then call loan_to_value(…)",
          "url": "http://www.functionalweave.com/functions/lending.ltv"
        },
        {
          "id": "property.mortgage-affordability",
          "tier": "optional",
          "why": "Mortgage income multiple and stress-tested repayment against income, for residential mortgages.",
          "section": "underwriting",
          "from": "lending",
          "version": "1.0.1",
          "summary": "Mortgage affordability: the loan-to-income multiple and a stress-tested repayment against income, both checked.",
          "status": "unreviewed",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "mortgageAffordability"
          ],
          "signatures": [
            "pub fn mortgage_affordability(annual_income: &Money, monthly_commitments: &Money, loan: &Money, annual_rate_basis_points: i64, stress_rate_basis_points: i64, term_months: i64, max_income_multiple_basis_points: i64, max_debt_to_income_basis_points: i64) -> MortgageAffordability"
          ],
          "reference": "fune!(property.mortgage-affordability@^1);  // then call mortgage_affordability(…)",
          "url": "http://www.functionalweave.com/functions/property.mortgage-affordability"
        }
      ],
      "gaps": [
        {
          "key": "credit-checks",
          "text": "Credit reference agency searches (Experian, Equifax, TransUnion) and scoring: network services and a credit policy caps does not have.",
          "section": "underwriting",
          "from": "lending"
        },
        {
          "key": "open-banking-income",
          "text": "Verifying income and outgoings from bank data (Open Banking, payslips): caps checks figures you already have.",
          "section": "underwriting",
          "from": "lending"
        }
      ]
    },
    {
      "key": "collections",
      "title": "Payments and collections",
      "purpose": "Take repayments by Direct Debit and validate the account they come from.",
      "from": "lending",
      "members": [
        {
          "id": "banking.bacs-processing-date",
          "tier": "optional",
          "why": "Bacs input and arrival dates for a Direct Debit collection, skipping weekends and bank holidays.",
          "section": "collections",
          "from": "lending",
          "version": "1.0.0",
          "summary": "Bacs three-day cycle: input, processing and entry (arrival) dates for a submission, skipping weekends and bank holidays.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "bacsProcessingDates"
          ],
          "signatures": [
            "pub fn bacs_processing_dates(submission_iso: &str, after_cutoff: bool) -> BacsCycle"
          ],
          "reference": "fune!(banking.bacs-processing-date@^1);  // then call bacs_processing_dates(…)",
          "url": "http://www.functionalweave.com/functions/banking.bacs-processing-date"
        },
        {
          "id": "subscriptions.dunning-schedule",
          "tier": "optional",
          "why": "Retry dates for a failed repayment from a retry policy.",
          "section": "collections",
          "from": "lending",
          "version": "1.0.0",
          "summary": "Retry dates for a failed subscription payment from a retry policy, in calendar or business days.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "dunningSchedule"
          ],
          "signatures": [
            "pub fn dunning_schedule(failed_on: &str, retry_offsets_days: &[i64], business_days: bool, holidays: &[String]) -> Vec<String>"
          ],
          "reference": "fune!(subscriptions.dunning-schedule@^1);  // then call dunning_schedule(…)",
          "url": "http://www.functionalweave.com/functions/subscriptions.dunning-schedule"
        }
      ],
      "gaps": [
        {
          "key": "arrears-handling",
          "text": "Arrears, forbearance and default notices (CCA notices of sums in arrears, default notices): the rules and letters are yours.",
          "section": "collections",
          "from": "lending"
        },
        {
          "key": "direct-debit-mandates",
          "text": "Setting up and submitting Direct Debit mandates and collections (Bacs files or a provider like GoCardless).",
          "section": "collections",
          "from": "lending"
        }
      ]
    },
    {
      "key": "amounts",
      "title": "Amounts",
      "purpose": "Hold money as currency-tagged integer minor units and do plain arithmetic on it safely.",
      "from": "money-basics",
      "members": [
        {
          "id": "money.amount",
          "tier": "core",
          "why": "The Money type ({ minor, currency }) every other money capability takes and returns.",
          "section": "amounts",
          "from": "money-basics",
          "version": "1.0.2",
          "summary": "A currency-tagged monetary amount held in integer minor units.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "money"
          ],
          "signatures": [
            "pub fn money(minor: i64, currency: &str) -> Money"
          ],
          "reference": "fune!(money.amount@^1);  // then call money(…)",
          "url": "http://www.functionalweave.com/functions/money.amount"
        },
        {
          "id": "money.add",
          "tier": "core",
          "why": "Adds and subtracts amounts, refusing to mix currencies by accident.",
          "section": "amounts",
          "from": "money-basics",
          "version": "1.0.1",
          "summary": "Add, subtract and negate monetary amounts, refusing to mix currencies.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "addMoney"
          ],
          "signatures": [
            "pub fn add_money(a: &Money, b: &Money) -> Money"
          ],
          "reference": "fune!(money.add@^1);  // then call add_money(…)",
          "url": "http://www.functionalweave.com/functions/money.add"
        },
        {
          "id": "money.sum",
          "tier": "core",
          "why": "Totals a list of amounts, with an explicit currency for an empty list.",
          "section": "amounts",
          "from": "money-basics",
          "version": "1.0.1",
          "summary": "Total a list of monetary amounts, with an explicit currency for the empty case.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "sumMoney"
          ],
          "signatures": [
            "pub fn sum_money(amounts: &[Money], currency: &str) -> Money"
          ],
          "reference": "fune!(money.sum@^1);  // then call sum_money(…)",
          "url": "http://www.functionalweave.com/functions/money.sum"
        },
        {
          "id": "money.compare",
          "tier": "core",
          "why": "Compares, mins, maxes and clamps amounts of one currency without unwrapping them.",
          "section": "amounts",
          "from": "money-basics",
          "version": "2.0.0",
          "summary": "Compare two amounts of one currency, refusing to compare across currencies; min, max and clamp too.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": true,
          "functions": [
            "compareMoney",
            "minMoney",
            "maxMoney",
            "clampMoney"
          ],
          "signatures": [
            "pub fn compare_money(a: &Money, b: &Money) -> i64",
            "pub fn min_money(a: &Money, b: &Money) -> Money",
            "pub fn max_money(a: &Money, b: &Money) -> Money",
            "pub fn clamp_money(amount: &Money, min: &Money, max: &Money) -> Money"
          ],
          "reference": "fune!(money.compare@^2);  // then call compare_money, min_money, max_money, clamp_money",
          "url": "http://www.functionalweave.com/functions/money.compare"
        }
      ],
      "gaps": []
    },
    {
      "key": "rates",
      "title": "Rates and rounding",
      "purpose": "Apply percentages and divide amounts with the rounding stated, never a float.",
      "from": "money-basics",
      "members": [
        {
          "id": "money.apply-rate",
          "tier": "core",
          "why": "Applies a basis-point rate (VAT, discount, commission) to an amount with explicit rounding.",
          "section": "rates",
          "from": "money-basics",
          "version": "1.0.1",
          "summary": "Apply a rate expressed in basis points to a monetary amount, with an explicit rounding mode.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "applyRate"
          ],
          "signatures": [
            "pub fn apply_rate(amount: &Money, basis_points: i64, mode: &RoundingMode) -> Money"
          ],
          "reference": "fune!(money.apply-rate@^1);  // then call apply_rate(…)",
          "url": "http://www.functionalweave.com/functions/money.apply-rate"
        },
        {
          "id": "math.round-div",
          "tier": "core",
          "why": "Integer division with a named rounding mode, for any money maths the others do not cover.",
          "section": "rates",
          "from": "money-basics",
          "version": "1.0.0",
          "summary": "Integer division with an explicit rounding mode, for money arithmetic that must not drift.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "roundDiv"
          ],
          "signatures": [
            "pub fn round_div(numerator: i64, denominator: i64, mode: &str) -> i64"
          ],
          "reference": "fune!(math.round-div@^1);  // then call round_div(…)",
          "url": "http://www.functionalweave.com/functions/math.round-div"
        },
        {
          "id": "math.basis-points",
          "tier": "optional",
          "why": "Converts \"12.5%\" to and from basis points exactly, for rates typed in by users.",
          "section": "rates",
          "from": "money-basics",
          "version": "2.0.0",
          "summary": "Convert a rate between percent, basis points and a plain ratio exactly, as decimal text or integer basis points.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": true,
          "functions": [
            "convertRate",
            "toBasisPoints",
            "fromBasisPoints"
          ],
          "signatures": [
            "pub fn convert_rate(value: &str, from_unit: &str, to_unit: &str) -> String",
            "pub fn to_basis_points(value: &str, unit: &str) -> i64",
            "pub fn from_basis_points(basis_points: i64, unit: &str) -> String"
          ],
          "reference": "fune!(math.basis-points@^2);  // then call convert_rate, to_basis_points, from_basis_points",
          "url": "http://www.functionalweave.com/functions/math.basis-points"
        },
        {
          "id": "math.percent-change",
          "tier": "optional",
          "why": "Percentage change between two figures in basis points, for \"up 4.2% on last month\".",
          "section": "rates",
          "from": "money-basics",
          "version": "1.0.0",
          "summary": "Percentage change from one value to another, in basis points, with an explicit rounding mode.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "percentChange"
          ],
          "signatures": [
            "pub fn percent_change(from_value: i64, to_value: i64, mode: &RoundingMode) -> Option<i64>"
          ],
          "reference": "fune!(math.percent-change@^1);  // then call percent_change(…)",
          "url": "http://www.functionalweave.com/functions/math.percent-change"
        },
        {
          "id": "math.rational",
          "tier": "optional",
          "why": "Exact fractions for rates that must not drift across many steps.",
          "section": "rates",
          "from": "money-basics",
          "version": "2.0.0",
          "summary": "Exact fraction arithmetic, always reduced, for rates and ratios that must not drift.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": true,
          "functions": [
            "calculateRational",
            "rational",
            "addRational",
            "subtractRational",
            "multiplyRational",
            "divideRational",
            "compareRational",
            "rationalToInteger"
          ],
          "signatures": [
            "pub fn calculate_rational(a: &Rational, op: &str, b: &Rational) -> Rational",
            "pub fn rational(numerator: i64, denominator: i64) -> Rational",
            "pub fn add_rational(a: &Rational, b: &Rational) -> Rational",
            "pub fn subtract_rational(a: &Rational, b: &Rational) -> Rational",
            "pub fn multiply_rational(a: &Rational, b: &Rational) -> Rational",
            "pub fn divide_rational(a: &Rational, b: &Rational) -> Rational",
            "pub fn compare_rational(a: &Rational, b: &Rational) -> i64",
            "pub fn rational_to_integer(r: &Rational, mode: &RoundingMode) -> i64"
          ],
          "reference": "fune!(math.rational@^2);  // then call calculate_rational, rational, add_rational, subtract_rational, multiply_rational, divide_rational, compare_rational, rational_to_integer",
          "url": "http://www.functionalweave.com/functions/math.rational"
        },
        {
          "id": "math.round-div-big",
          "tier": "optional",
          "why": "Rounded division on numbers past 2^53, for very large totals.",
          "section": "rates",
          "from": "money-basics",
          "version": "1.0.0",
          "summary": "Divide two integers of any size with an explicit rounding mode, on decimal strings, for exact money sums past 2^53.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "roundDivBig"
          ],
          "signatures": [
            "pub fn round_div_big(numerator: &str, denominator: &str, mode: &RoundingMode) -> String"
          ],
          "reference": "fune!(math.round-div-big@^1);  // then call round_div_big(…)",
          "url": "http://www.functionalweave.com/functions/math.round-div-big"
        }
      ],
      "gaps": []
    },
    {
      "key": "splitting",
      "title": "Splitting",
      "purpose": "Divide an amount between people, periods or lines so the parts add back to the whole.",
      "from": "money-basics",
      "members": [
        {
          "id": "money.allocate",
          "tier": "core",
          "why": "Splits an amount by ratios (60/40, by quantity) without losing or inventing a penny.",
          "section": "splitting",
          "from": "money-basics",
          "version": "1.0.1",
          "summary": "Split an amount across ratios without losing or inventing a single minor unit.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "allocate"
          ],
          "signatures": [
            "pub fn allocate(amount: &Money, ratios: &[i64]) -> Vec<Money>"
          ],
          "reference": "fune!(money.allocate@^1);  // then call allocate(…)",
          "url": "http://www.functionalweave.com/functions/money.allocate"
        },
        {
          "id": "money.split-even",
          "tier": "optional",
          "why": "Splits an amount into n near-equal parts that sum exactly, for instalments or shares.",
          "section": "splitting",
          "from": "money-basics",
          "version": "1.0.0",
          "summary": "Split an amount into n near-equal parts that add back up to exactly the whole.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "splitEven"
          ],
          "signatures": [
            "pub fn split_even(amount: &Money, parts: i64) -> Vec<Money>"
          ],
          "reference": "fune!(money.split-even@^1);  // then call split_even(…)",
          "url": "http://www.functionalweave.com/functions/money.split-even"
        }
      ],
      "gaps": []
    },
    {
      "key": "display",
      "title": "Display and input",
      "purpose": "Show amounts to people and read what they type.",
      "from": "money-basics",
      "members": [
        {
          "id": "money.format",
          "tier": "core",
          "why": "Renders an amount as text with the currency's real number of decimal places.",
          "section": "display",
          "from": "money-basics",
          "version": "1.0.0",
          "summary": "Render a monetary amount as text, using the currency's real minor-unit precision.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "formatMoney"
          ],
          "signatures": [
            "pub fn format_money(amount: &Money) -> String"
          ],
          "reference": "fune!(money.format@^1);  // then call format_money(…)",
          "url": "http://www.functionalweave.com/functions/money.format"
        },
        {
          "id": "money.parse",
          "tier": "optional",
          "why": "Reads \"£1,234.50\" or \"1.234,50 €\" typed by a user into minor units, strictly.",
          "section": "display",
          "from": "money-basics",
          "version": "1.0.0",
          "summary": "Parse \"£1,234.50\" or \"1.234,50 €\" into integer minor units, strictly: no guessing, no rounding.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "parseMoney"
          ],
          "signatures": [
            "pub fn parse_money(text: &str, currency: &str, style: &str) -> Money"
          ],
          "reference": "fune!(money.parse@^1);  // then call parse_money(…)",
          "url": "http://www.functionalweave.com/functions/money.parse"
        },
        {
          "id": "money.currency-digits",
          "tier": "optional",
          "why": "How many decimal places each ISO 4217 currency has, for input boxes and validation.",
          "section": "display",
          "from": "money-basics",
          "version": "1.0.0",
          "summary": "How many decimal places a currency's minor unit has, from the ISO 4217 list.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "currencyDigits"
          ],
          "signatures": [
            "pub fn currency_digits(currency: &str) -> i64"
          ],
          "reference": "fune!(money.currency-digits@^1);  // then call currency_digits(…)",
          "url": "http://www.functionalweave.com/functions/money.currency-digits"
        }
      ],
      "gaps": []
    },
    {
      "key": "currencies",
      "title": "Other currencies",
      "purpose": "Convert between currencies at a rate you hold.",
      "from": "money-basics",
      "members": [
        {
          "id": "money.convert",
          "tier": "optional",
          "why": "Converts an amount at a supplied exact rate with explicit rounding.",
          "section": "currencies",
          "from": "money-basics",
          "version": "1.0.0",
          "summary": "Convert an amount to another currency at a supplied exact rate, with an explicit rounding mode.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "convertMoney"
          ],
          "signatures": [
            "pub fn convert_money(amount: &Money, rate: &ExchangeRate, mode: &RoundingMode) -> Money"
          ],
          "reference": "fune!(money.convert@^1);  // then call convert_money(…)",
          "url": "http://www.functionalweave.com/functions/money.convert"
        }
      ],
      "gaps": []
    },
    {
      "key": "date-arithmetic",
      "title": "Calendar arithmetic",
      "purpose": "Move and measure ISO dates exactly, with no date library and no clock reads.",
      "from": "dates-basics",
      "members": [
        {
          "id": "dates.add-days",
          "tier": "core",
          "why": "Shifts a date by whole days, for due dates and windows.",
          "section": "date-arithmetic",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Shift an ISO date by a whole number of days, forwards or backwards, with exact calendar arithmetic.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "addDays"
          ],
          "signatures": [
            "pub fn add_days(iso: &str, days: i64) -> String"
          ],
          "reference": "fune!(dates.add-days@^1);  // then call add_days(…)",
          "url": "http://www.functionalweave.com/functions/dates.add-days"
        },
        {
          "id": "dates.add-months",
          "tier": "core",
          "why": "Adds months clamping to month end, so 31 January plus a month is the end of February.",
          "section": "date-arithmetic",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Add calendar months to an ISO date, clamping to the month end: 31 Jan + 1 month is 28 or 29 Feb.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "addMonths"
          ],
          "signatures": [
            "pub fn add_months(iso: &str, months: i64) -> String"
          ],
          "reference": "fune!(dates.add-months@^1);  // then call add_months(…)",
          "url": "http://www.functionalweave.com/functions/dates.add-months"
        },
        {
          "id": "dates.days-between",
          "tier": "core",
          "why": "Signed calendar days between two dates, for ages of invoices and stays.",
          "section": "date-arithmetic",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Calendar days from one ISO date to another, signed: negative when the second date is earlier.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "daysBetween"
          ],
          "signatures": [
            "pub fn days_between(start_iso: &str, end_iso: &str) -> i64"
          ],
          "reference": "fune!(dates.days-between@^1);  // then call days_between(…)",
          "url": "http://www.functionalweave.com/functions/dates.days-between"
        },
        {
          "id": "dates.month-boundaries",
          "tier": "core",
          "why": "First and last day of a date's month, for monthly periods and statements.",
          "section": "date-arithmetic",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "The first day, last day and length of the calendar month containing a date.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "monthBoundaries"
          ],
          "signatures": [
            "pub fn month_boundaries(iso: &str) -> MonthBoundaries"
          ],
          "reference": "fune!(dates.month-boundaries@^1);  // then call month_boundaries(…)",
          "url": "http://www.functionalweave.com/functions/dates.month-boundaries"
        },
        {
          "id": "dates.day-of-week",
          "tier": "core",
          "why": "ISO weekday of a date, for weekend rules and opening hours.",
          "section": "date-arithmetic",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "The ISO 8601 day of the week for a date: 1 is Monday through 7 is Sunday.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "dayOfWeek"
          ],
          "signatures": [
            "pub fn day_of_week(iso: &str) -> i64"
          ],
          "reference": "fune!(dates.day-of-week@^1);  // then call day_of_week(…)",
          "url": "http://www.functionalweave.com/functions/dates.day-of-week"
        },
        {
          "id": "dates.is-leap-year",
          "tier": "optional",
          "why": "Whether a year is a leap year, for 365/366-day calculations.",
          "section": "date-arithmetic",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Whether a year is a Gregorian leap year: every 4th, except centuries, except every 400th.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "isLeapYear"
          ],
          "signatures": [
            "pub fn is_leap_year(year: i64) -> bool"
          ],
          "reference": "fune!(dates.is-leap-year@^1);  // then call is_leap_year(…)",
          "url": "http://www.functionalweave.com/functions/dates.is-leap-year"
        },
        {
          "id": "dates.overlap",
          "tier": "optional",
          "why": "Days two date ranges share, for prorating and clash checks.",
          "section": "date-arithmetic",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Days two date ranges have in common, with the end of each range stated as inclusive or exclusive.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "overlapDays"
          ],
          "signatures": [
            "pub fn overlap_days(a_start: &str, a_end: &str, b_start: &str, b_end: &str, end_inclusive: bool) -> i64"
          ],
          "reference": "fune!(dates.overlap@^1);  // then call overlap_days(…)",
          "url": "http://www.functionalweave.com/functions/dates.overlap"
        },
        {
          "id": "dates.age",
          "tier": "optional",
          "why": "Age in whole years on a date, handling 29 February birthdays.",
          "section": "date-arithmetic",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Age in whole years on a given date, with 29 February birthdays ageing on 1 March in other years.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "age"
          ],
          "signatures": [
            "pub fn age(birth_date: &str, on_date: &str) -> i64"
          ],
          "reference": "fune!(dates.age@^1);  // then call age(…)",
          "url": "http://www.functionalweave.com/functions/dates.age"
        }
      ],
      "gaps": []
    },
    {
      "key": "reporting-periods",
      "title": "Periods and reporting dates",
      "purpose": "Put dates into the periods reports are grouped by.",
      "from": "dates-basics",
      "members": [
        {
          "id": "dates.quarter",
          "tier": "core",
          "why": "Calendar and fiscal quarter of a date for any year-start month.",
          "section": "reporting-periods",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Calendar quarter and fiscal quarter of a date, with the fiscal year and quarter date ranges, for any start month.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "quarter"
          ],
          "signatures": [
            "pub fn quarter(iso: &str, fiscal_year_start_month: i64) -> Quarter"
          ],
          "reference": "fune!(dates.quarter@^1);  // then call quarter(…)",
          "url": "http://www.functionalweave.com/functions/dates.quarter"
        },
        {
          "id": "dates.week-number",
          "tier": "optional",
          "why": "ISO week number and week-year, for weekly reports.",
          "section": "reporting-periods",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "ISO 8601 week number and week-numbering year of a date: weeks start Monday, week 1 holds the first Thursday.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "weekNumber"
          ],
          "signatures": [
            "pub fn week_number(iso: &str) -> IsoWeek"
          ],
          "reference": "fune!(dates.week-number@^1);  // then call week_number(…)",
          "url": "http://www.functionalweave.com/functions/dates.week-number"
        }
      ],
      "gaps": []
    },
    {
      "key": "working-days",
      "title": "Working days and holidays",
      "purpose": "Skip weekends and public holidays when counting or adding days.",
      "from": "dates-basics",
      "members": [
        {
          "id": "dates.bank-holidays",
          "tier": "core",
          "why": "UK bank holidays for a region and year, as gov.uk publishes them.",
          "section": "working-days",
          "from": "dates-basics",
          "version": "1.0.1",
          "summary": "UK bank and public holidays for a region and year, as published by gov.uk, including one-off holidays.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "bankHolidays"
          ],
          "signatures": [
            "pub fn bank_holidays(region: &str, year: i64) -> Vec<BankHoliday>"
          ],
          "reference": "fune!(dates.bank-holidays@^1);  // then call bank_holidays(…)",
          "url": "http://www.functionalweave.com/functions/dates.bank-holidays"
        },
        {
          "id": "dates.add-business-days",
          "tier": "core",
          "why": "Moves a date by working days, skipping weekends and a holiday list.",
          "section": "working-days",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Move a date forward or back by working days, skipping weekends and a caller-supplied holiday list.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "addBusinessDays"
          ],
          "signatures": [
            "pub fn add_business_days(iso: &str, days: i64, holidays: &[String]) -> String"
          ],
          "reference": "fune!(dates.add-business-days@^1);  // then call add_business_days(…)",
          "url": "http://www.functionalweave.com/functions/dates.add-business-days"
        },
        {
          "id": "dates.business-days-between",
          "tier": "core",
          "why": "Working days between two dates, for SLAs and notice periods.",
          "section": "working-days",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Working days between two dates, excluding weekends and a caller-supplied holiday list.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "businessDaysBetween"
          ],
          "signatures": [
            "pub fn business_days_between(start_iso: &str, end_iso: &str, holidays: &[String]) -> i64"
          ],
          "reference": "fune!(dates.business-days-between@^1);  // then call business_days_between(…)",
          "url": "http://www.functionalweave.com/functions/dates.business-days-between"
        }
      ],
      "gaps": []
    },
    {
      "key": "repeating-dates",
      "title": "Repeating schedules",
      "purpose": "Generate the dates of something that repeats.",
      "from": "dates-basics",
      "members": [
        {
          "id": "dates.recurrence",
          "tier": "optional",
          "why": "The next n dates of a rule: monthly on the 31st, last Friday, every two weeks.",
          "section": "repeating-dates",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "The next n dates of a repeating rule: monthly on a day, last weekday of the month, every k days or weeks, yearly.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "recurrence"
          ],
          "signatures": [
            "pub fn recurrence(rule: &RecurrenceRule, start_iso: &str, count: i64) -> Vec<String>"
          ],
          "reference": "fune!(dates.recurrence@^1);  // then call recurrence(…)",
          "url": "http://www.functionalweave.com/functions/dates.recurrence"
        }
      ],
      "gaps": []
    },
    {
      "key": "times",
      "title": "Times and durations",
      "purpose": "Work with times of day, durations and timestamps.",
      "from": "dates-basics",
      "members": [
        {
          "id": "time.duration",
          "tier": "optional",
          "why": "Parses and adds durations like 1h30m in whole minutes, and formats the total.",
          "section": "times",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Parse durations written as 1h30m, 90m or 01:30, add them up in whole minutes, and format the total.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "duration"
          ],
          "signatures": [
            "pub fn duration(parts: &[String]) -> Duration"
          ],
          "reference": "fune!(time.duration@^1);  // then call duration(…)",
          "url": "http://www.functionalweave.com/functions/time.duration"
        },
        {
          "id": "time.minutes-between",
          "tier": "optional",
          "why": "Minutes between two local date-times, across midnight.",
          "section": "times",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Minutes from one local date and time to another, correct across midnight; wall-clock time, no time zones.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "minutesBetween"
          ],
          "signatures": [
            "pub fn minutes_between(start_date: &str, start_time: &str, end_date: &str, end_time: &str) -> i64"
          ],
          "reference": "fune!(time.minutes-between@^1);  // then call minutes_between(…)",
          "url": "http://www.functionalweave.com/functions/time.minutes-between"
        },
        {
          "id": "time.round-to-increment",
          "tier": "optional",
          "why": "Rounds minutes to a billing increment such as 6 or 15.",
          "section": "times",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Round a duration in minutes to a billing increment such as 6 or 15 minutes, up, down or to nearest.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "roundToIncrement"
          ],
          "signatures": [
            "pub fn round_to_increment(minutes: i64, increment: i64, mode: &RoundingMode) -> i64"
          ],
          "reference": "fune!(time.round-to-increment@^1);  // then call round_to_increment(…)",
          "url": "http://www.functionalweave.com/functions/time.round-to-increment"
        },
        {
          "id": "time.iso-to-unix",
          "tier": "optional",
          "why": "RFC 3339 timestamps to Unix seconds.",
          "section": "times",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "An RFC 3339 timestamp with a Z or offset, such as 2026-09-26T13:00:00+01:00, to Unix time in whole seconds.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "isoToUnix"
          ],
          "signatures": [
            "pub fn iso_to_unix(timestamp: &str) -> i64"
          ],
          "reference": "fune!(time.iso-to-unix@^1);  // then call iso_to_unix(…)",
          "url": "http://www.functionalweave.com/functions/time.iso-to-unix"
        },
        {
          "id": "time.unix-to-iso",
          "tier": "optional",
          "why": "Unix seconds to an ISO 8601 UTC timestamp.",
          "section": "times",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Unix time in seconds to an ISO 8601 UTC timestamp such as 2026-09-26T12:00:00Z, for years 0001 to 9999.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "unixToIso"
          ],
          "signatures": [
            "pub fn unix_to_iso(seconds: i64) -> String"
          ],
          "reference": "fune!(time.unix-to-iso@^1);  // then call unix_to_iso(…)",
          "url": "http://www.functionalweave.com/functions/time.unix-to-iso"
        },
        {
          "id": "time.countdown",
          "tier": "optional",
          "why": "Seconds left until a moment and a 4:05 style timer text.",
          "section": "times",
          "from": "dates-basics",
          "version": "1.0.0",
          "summary": "Seconds left until a Unix time, whether it has passed, and a timer text like 4:05, for tokens or retry waits.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "countdown"
          ],
          "signatures": [
            "pub fn countdown(until: i64, now: i64) -> Countdown"
          ],
          "reference": "fune!(time.countdown@^1);  // then call countdown(…)",
          "url": "http://www.functionalweave.com/functions/time.countdown"
        }
      ],
      "gaps": []
    },
    {
      "key": "contact",
      "title": "Contact details",
      "purpose": "Check and normalise a person's contact details before storing them.",
      "from": "validation-basics",
      "members": [
        {
          "id": "validation.email",
          "tier": "core",
          "why": "Is an email address plausible, by a documented subset of RFC 5322.",
          "section": "contact",
          "from": "validation-basics",
          "version": "1.0.0",
          "summary": "Is this a plausible email address? A documented, pragmatic subset of RFC 5322, not the full grammar.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "isEmail"
          ],
          "signatures": [
            "pub fn is_email(value: &str) -> bool"
          ],
          "reference": "fune!(validation.email@^1);  // then call is_email(…)",
          "url": "http://www.functionalweave.com/functions/validation.email"
        },
        {
          "id": "validation.phone-e164",
          "tier": "core",
          "why": "Normalises a phone number to +44… E.164 for a default country.",
          "section": "contact",
          "from": "validation-basics",
          "version": "2.0.0",
          "summary": "Normalise a phone number to E.164 (+447700900123) using a default country's trunk and dialling prefixes.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "validatePhoneE164"
          ],
          "signatures": [
            "pub fn validate_phone_e164(value: &str, default_country: &str) -> PhoneE164"
          ],
          "reference": "fune!(validation.phone-e164@^2);  // then call validate_phone_e164(…)",
          "url": "http://www.functionalweave.com/functions/validation.phone-e164"
        },
        {
          "id": "validation.uk-postcode",
          "tier": "core",
          "why": "Validates a UK postcode and puts it in canonical form.",
          "section": "contact",
          "from": "validation-basics",
          "version": "2.0.0",
          "summary": "Validate a UK postcode and normalise it to canonical upper case with one space before the inward code.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "validateUkPostcode"
          ],
          "signatures": [
            "pub fn validate_uk_postcode(value: &str) -> UkPostcode"
          ],
          "reference": "fune!(validation.uk-postcode@^2);  // then call validate_uk_postcode(…)",
          "url": "http://www.functionalweave.com/functions/validation.uk-postcode"
        },
        {
          "id": "text.normalise-name",
          "tier": "optional",
          "why": "Tidies a typed name: spacing and title case with Mc, O' and hyphen rules.",
          "section": "contact",
          "from": "validation-basics",
          "version": "1.0.0",
          "summary": "Tidy a personal name: trim, collapse whitespace and title-case, with Mc, Mac, O', hyphen and van/de rules.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "normaliseName"
          ],
          "signatures": [
            "pub fn normalise_name(value: &str) -> String"
          ],
          "reference": "fune!(text.normalise-name@^1);  // then call normalise_name(…)",
          "url": "http://www.functionalweave.com/functions/text.normalise-name"
        },
        {
          "id": "auth.normalise-email",
          "tier": "optional",
          "why": "Lower-cases an email's domain for storage and lookup.",
          "section": "contact",
          "from": "validation-basics",
          "version": "1.0.0",
          "summary": "Trim an email address and lower-case its domain for storage and lookup, or null if it is not a plausible address.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "normaliseEmail"
          ],
          "signatures": [
            "pub fn normalise_email(value: &str) -> Option<String>"
          ],
          "reference": "fune!(auth.normalise-email@^1);  // then call normalise_email(…)",
          "url": "http://www.functionalweave.com/functions/auth.normalise-email"
        }
      ],
      "gaps": []
    },
    {
      "key": "bank",
      "title": "Bank details",
      "purpose": "Check payee and customer bank details before money moves.",
      "from": "validation-basics",
      "members": [
        {
          "id": "validation.iban",
          "tier": "core",
          "why": "Checks an IBAN's mod-97 checksum and its country's length.",
          "section": "bank",
          "from": "validation-basics",
          "version": "1.0.0",
          "summary": "Check an IBAN against the ISO 13616 mod-97-10 checksum and the registered length for its country.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "isIban"
          ],
          "signatures": [
            "pub fn is_iban(value: &str) -> bool"
          ],
          "reference": "fune!(validation.iban@^1);  // then call is_iban(…)",
          "url": "http://www.functionalweave.com/functions/validation.iban"
        },
        {
          "id": "validation.bic",
          "tier": "optional",
          "why": "Checks a SWIFT/BIC code's format and splits it.",
          "section": "bank",
          "from": "validation-basics",
          "version": "1.0.0",
          "summary": "Check the format of a SWIFT/BIC code (8 or 11 characters) and split it into its parts.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "validateBic"
          ],
          "signatures": [
            "pub fn validate_bic(value: &str) -> BicCheck"
          ],
          "reference": "fune!(validation.bic@^1);  // then call validate_bic(…)",
          "url": "http://www.functionalweave.com/functions/validation.bic"
        },
        {
          "id": "validation.uk-sort-code-account",
          "tier": "optional",
          "why": "Checks a UK sort code and account number by the Vocalink modulus rules, against a table you supply.",
          "section": "bank",
          "from": "validation-basics",
          "version": "3.0.0",
          "summary": "Check a UK sort code and account number with the Vocalink/Pay.UK modulus rules, against a table you supply.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "validateUkSortCodeAccount"
          ],
          "signatures": [
            "pub fn validate_uk_sort_code_account(sort_code: &str, account_number: &str, table: &UkModulusTable) -> UkSortCodeAccount"
          ],
          "reference": "fune!(validation.uk-sort-code-account@^3);  // then call validate_uk_sort_code_account(…)",
          "url": "http://www.functionalweave.com/functions/validation.uk-sort-code-account"
        },
        {
          "id": "validation.uk-modulus-table",
          "tier": "optional",
          "why": "Parses Vocalink's VALACDOS and SCSUBTAB files into that table.",
          "section": "bank",
          "from": "validation-basics",
          "version": "1.0.0",
          "summary": "Parse Vocalink's VALACDOS.txt and SCSUBTAB.txt into the table UK sort code modulus checking needs.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "parseUkModulusTable"
          ],
          "signatures": [
            "pub fn parse_uk_modulus_table(valacdos: &str, scsubtab: &str) -> UkModulusTable"
          ],
          "reference": "fune!(validation.uk-modulus-table@^1);  // then call parse_uk_modulus_table(…)",
          "url": "http://www.functionalweave.com/functions/validation.uk-modulus-table"
        }
      ],
      "gaps": []
    },
    {
      "key": "check-digits",
      "title": "Identifiers and check digits",
      "purpose": "Catch mistyped reference numbers by their check digits.",
      "from": "validation-basics",
      "members": [
        {
          "id": "validation.luhn",
          "tier": "optional",
          "why": "Luhn mod-10 check, for card numbers and many reference numbers.",
          "section": "check-digits",
          "from": "validation-basics",
          "version": "1.0.0",
          "summary": "Check a digit string against the Luhn mod-10 checksum used by payment cards and many identifiers.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "isLuhn"
          ],
          "signatures": [
            "pub fn is_luhn(value: &str) -> bool"
          ],
          "reference": "fune!(validation.luhn@^1);  // then call is_luhn(…)",
          "url": "http://www.functionalweave.com/functions/validation.luhn"
        },
        {
          "id": "validation.uk-company-number",
          "tier": "optional",
          "why": "Checks a Companies House number's format and prefix.",
          "section": "check-digits",
          "from": "validation-basics",
          "version": "2.0.1",
          "summary": "Check a Companies House company number's format and prefix (SC, NI, OC, LP...) and zero-pad it to eight characters.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "validateUkCompanyNumber"
          ],
          "signatures": [
            "pub fn validate_uk_company_number(value: &str) -> UkCompanyNumber"
          ],
          "reference": "fune!(validation.uk-company-number@^2);  // then call validate_uk_company_number(…)",
          "url": "http://www.functionalweave.com/functions/validation.uk-company-number"
        },
        {
          "id": "validation.lei",
          "tier": "optional",
          "why": "Checks a Legal Entity Identifier's check digits.",
          "section": "check-digits",
          "from": "validation-basics",
          "version": "1.0.0",
          "summary": "Check a 20-character Legal Entity Identifier against its ISO 17442 / ISO 7064 MOD 97-10 check digits.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "validateLei"
          ],
          "signatures": [
            "pub fn validate_lei(value: &str) -> LeiCheck"
          ],
          "reference": "fune!(validation.lei@^1);  // then call validate_lei(…)",
          "url": "http://www.functionalweave.com/functions/validation.lei"
        },
        {
          "id": "validation.gtin",
          "tier": "optional",
          "why": "Checks an EAN/UPC/GTIN barcode number.",
          "section": "check-digits",
          "from": "validation-basics",
          "version": "1.1.0",
          "summary": "Check an EAN-8, UPC-A, EAN-13 or GTIN-14 barcode number against the GS1 mod-10 check digit.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "validateGtin"
          ],
          "signatures": [
            "pub fn validate_gtin(value: &str) -> GtinCheck"
          ],
          "reference": "fune!(validation.gtin@^1);  // then call validate_gtin(…)",
          "url": "http://www.functionalweave.com/functions/validation.gtin"
        }
      ],
      "gaps": []
    },
    {
      "key": "masking",
      "title": "Displaying sensitive values",
      "purpose": "Show stored identifiers without exposing them.",
      "from": "validation-basics",
      "members": [
        {
          "id": "text.mask",
          "tier": "optional",
          "why": "Masks all but the last digits of a card, account or phone number.",
          "section": "masking",
          "from": "validation-basics",
          "version": "1.0.0",
          "summary": "Mask all but the last n characters of a card, account or phone number, optionally keeping separators.",
          "status": "stable",
          "license": "NOASSERTION",
          "languages": [
            "typescript",
            "python",
            "rust"
          ],
          "available": true,
          "group": false,
          "functions": [
            "mask"
          ],
          "signatures": [
            "pub fn mask(value: &str, visible: i64, mask_char: &str, keep_separators: bool) -> String"
          ],
          "reference": "fune!(text.mask@^1);  // then call mask(…)",
          "url": "http://www.functionalweave.com/functions/text.mask"
        }
      ],
      "gaps": []
    }
  ],
  "gaps": [
    {
      "key": "credit-checks",
      "text": "Credit reference agency searches (Experian, Equifax, TransUnion) and scoring: network services and a credit policy caps does not have.",
      "section": "underwriting",
      "from": "lending"
    },
    {
      "key": "open-banking-income",
      "text": "Verifying income and outgoings from bank data (Open Banking, payslips): caps checks figures you already have.",
      "section": "underwriting",
      "from": "lending"
    },
    {
      "key": "arrears-handling",
      "text": "Arrears, forbearance and default notices (CCA notices of sums in arrears, default notices): the rules and letters are yours.",
      "section": "collections",
      "from": "lending"
    },
    {
      "key": "direct-debit-mandates",
      "text": "Setting up and submitting Direct Debit mandates and collections (Bacs files or a provider like GoCardless).",
      "section": "collections",
      "from": "lending"
    },
    {
      "key": "agreement-documents",
      "text": "Pre-contract information (SECCI) and credit agreement documents: caps computes the figures, not the regulated documents.",
      "section": null,
      "from": "lending"
    },
    {
      "key": "fx-rate-source",
      "text": "Where exchange rates come from: money.convert takes a rate you supply; fetching and storing daily rates (ECB, a provider's API) is yours.",
      "section": null,
      "from": "money-basics"
    },
    {
      "key": "money-storage",
      "text": "Storing amounts: the database columns (integer minor units plus a currency code) and their migrations are yours.",
      "section": null,
      "from": "money-basics"
    },
    {
      "key": "time-zones",
      "text": "Time zones and daylight saving: caps works in ISO dates, UTC and wall-clock times; converting with the IANA tz rules is yours.",
      "section": null,
      "from": "dates-basics"
    },
    {
      "key": "locale-formatting",
      "text": "Showing dates in a user's language and format (\"3 octobre 2026\"): caps returns ISO dates, not localised text.",
      "section": null,
      "from": "dates-basics"
    },
    {
      "key": "non-uk-holidays",
      "text": "Public holidays outside the UK: dates.bank-holidays is UK only; pass another country's list to the working-day functions yourself.",
      "section": null,
      "from": "dates-basics"
    },
    {
      "key": "address-lookup",
      "text": "Turning a postcode into a list of addresses (Royal Mail PAF or a lookup API) is network work and not in caps.",
      "section": null,
      "from": "validation-basics"
    },
    {
      "key": "email-deliverability",
      "text": "Whether a mailbox exists (MX lookups, a confirmation email): validation.email checks the syntax only.",
      "section": null,
      "from": "validation-basics"
    },
    {
      "key": "vocalink-data",
      "text": "The Vocalink modulus tables themselves: download them from Pay.UK under its terms; caps parses them but does not ship them.",
      "section": null,
      "from": "validation-basics"
    }
  ],
  "counts": {
    "members": 64,
    "core": 27,
    "optional": 37,
    "unreviewed": 9,
    "deprecated": [],
    "unavailable": [],
    "missing": [],
    "gaps": 13
  },
  "warnings": [
    "6 core capabilities are unreviewed - they pass their tests but await an expert's sign-off; tell the user before relying on them, and never use one silently for tax, payroll, legal, clinical or other regulated rules: lending.loan-payment, lending.apr, lending.amortisation-schedule, lending.daily-interest, lending.early-settlement, lending.affordability",
    "3 optional capabilities are unreviewed too: lending.overpayment-effect, lending.ltv, property.mortgage-affordability",
    "Not financial advice. APR and early settlement follow the UK Consumer Credit Act rules (FCA CONC); a regulated lender must have its compliance team confirm how the app uses them."
  ],
  "url": "http://www.functionalweave.com/suites/lending",
  "owner": null
}
