import type { List } from "."; import type { Args, GenericFn, GenericResolver } from "../HKT"; import type { Nat } from "../Num"; import type { GTE } from "../Num/GTE"; import type { None, Option, Some } from "../Option"; /** * Get the element at a specific index in a {@link List}. * * Sig: `(i: Nat, xs: List) => Option` */ export type At = GTE extends true ? None : Some; interface Resolver extends GenericResolver<[Nat, List], Option> { on1_: ([i]: Args) => [[List], Option]; on_1: ([, xs]: Args) => [[Nat], Option<(typeof xs)[number]>]; on11: ([i, xs]: Args) => [[], Option<(typeof xs)[number]>]; } /** * Get the element at a specific index in a {@link List}. * * Sig: `(i: Nat, xs: List) => Option` */ export default interface AtFn extends GenericFn { def: ([i, xs]: Args) => At; }