import type { Int } from "."; import type { Arg0, Arg1, Fn } from "../../HKT"; import type { GT, LT } from "../../typeclass/Ord"; import type { Abs } from "../Abs"; import type { IsPos } from "../IsPos"; import type { Add as AddNat } from "../Nat/Add"; import type { Compare as CompareNat } from "../Nat/Compare"; import type { Sub as SubNat } from "../Nat/Sub"; import type { _StrToNum } from "../internal/_StrToNum"; /** * Subtract two {@link Int}s. * * Sig: `(n: Int, m: Int) => Int` */ export type Sub = IsPos extends true ? IsPos extends true ? CompareNat extends LT ? _StrToNum<`-${SubNat}`> : SubNat : AddNat> : IsPos extends true ? _StrToNum<`-${AddNat, M>}`> : CompareNat, Abs> extends GT ? _StrToNum<`-${SubNat, Abs>}`> : SubNat, Abs>; /** * [Fn] Subtract two {@link Int}s. * * Sig: `(n: Int, m: Int) => Int` */ export default interface SubFn extends Fn<[Int, Int], Int> { def: () => Sub, Arg1>; }