import type AddFn from "./Add"; import type CompareFn from "./Compare"; import type IsNatFn from "./IsNat"; import type SubFn from "./Sub"; import type { PartialApply } from "../../HKT"; /** * Alias for `number` to represent natural numbers. */ export type Nat = number; /*********** * Methods * ***********/ /** * Methods for `Nat`. */ export namespace Nat { /** * [Fn] Compare two {@link Nat}s. * * Sig: `(n: Nat, m: Nat) => Ordering` */ export type Compare = CompareFn; /** * [Fn] Compare a {@link Nat} with another {@link Nat}. * * Sig: `[m: Nat](n: Nat) => Ordering` */ export type CompareWith = PartialApply; /** * [Fn] Compare a {@link Nat} with another {@link Nat}. * * Sig: `[n: Nat](m: Nat) => Ordering` */ export type CompareAgainst = PartialApply; /** * [Fn] Add two {@link Nat}s. * * Sig: `(n: Nat, m: Nat) => Nat` */ export type Add2 = AddFn; /** * [Fn] Add two {@link Nat}s. * * Sig: `[m: Nat](n: Nat) => Nat` */ export type Add = PartialApply; /** * [Fn] Subtract two {@link Nat}s. * * Sig: `(n: Nat, m: Nat) => Nat` * * **⚠️ Warning:** `n` must be greater than or equal to `m`. */ export type Sub2 = SubFn; /** * [Fn] Subtract two {@link Nat}s. * * Sig: `[m: Nat](n: Nat) => Nat` * * **⚠️ Warning:** `n` must be greater than or equal to `m`. */ export type Sub = PartialApply; } /****************** * Static members * ******************/ /** * [Fn] Check if a value is {@link Nat}. * * Sig: `(x: unknown) => boolean` */ export type Nat$$IsNat = IsNatFn;