// Generated by bynkc — do not edit by hand.
// commons commerce.money

import { Ok, Err, Some, None, type Result, type Option, type ValidationError } from "./runtime.js";

export type MoneyError =
    { readonly tag: "CurrencyMismatch" }
  | { readonly tag: "InsufficientFunds" }
  | { readonly tag: "Overflow" };

export const MoneyError = {
  CurrencyMismatch: { tag: "CurrencyMismatch" } as MoneyError,
  InsufficientFunds: { tag: "InsufficientFunds" } as MoneyError,
  Overflow: { tag: "Overflow" } as MoneyError,
};

export function describe(e: MoneyError): string {
  switch (e.tag) {
    case "CurrencyMismatch": {
      return "currencies do not match";
    }
    case "InsufficientFunds": {
      return "insufficient funds";
    }
    case "Overflow": {
      return "overflow";
    }
  }
  throw new Error("non-exhaustive match");
}

