import type { Args, Fn } from "../HKT"; import type { List } from "../List"; import type { Nat } from "../Num"; import type { Compare } from "../Num/Compare"; import type { Inc } from "../Num/Int/Inc"; import type { EQ, GT } from "../typeclass/Ord"; /** * Generate a {@link List} of numbers from `From` to `To` (exclusive). * * Sig: `(from: Int, to: Int) => List` */ export type RangeOf = Compare extends GT | EQ ? readonly [] : readonly [From, ...RangeOf : never, To>]; /** * [Fn] Generate a {@link List} of numbers from `From` to `To` (exclusive). * * Sig: `(from: Int, to: Int) => List` */ export default interface RangeOfFn extends Fn<[Nat, Nat], List> { def: ([from, to]: Args) => RangeOf; }