import type { List } from "."; // @ts-ignore - Only used in doc comments import type { ExtendLeft } from "./ExtendLeft"; // @ts-ignore - Only used in doc comments import type ExtendLeftFn from "./ExtendLeft"; import type { Args, GenericFn, GenericResolver } from "../HKT"; import type { Broaden } from "../helpers"; /** * Extend a {@link List} by concatenating another {@link List} on the **right**. * * Sig: `(ys: List, xs: List) => List` * * @see {@link ExtendLeft} for the opposite. */ export type Extend = TS extends unknown[] ? [...TS, ...US] : readonly [...TS, ...US]; interface Resolver extends GenericResolver<[List, List], List> { on1_: ([ys]: Args) => [ [List>], List>, ]; on_1: ([, xs]: Args) => [ [List>], List>, ]; on11: ([ys, xs]: Args) => [[], List<(typeof xs)[number] | (typeof ys)[number]>]; } /** * [Fn] Extend a {@link List} by concatenating another {@link List} on the **right**. * * Sig: `(ys: List, xs: List) => List` * * @see {@link ExtendLeftFn} for the opposite. */ export default interface ExtendFn extends GenericFn { def: ([ys, xs]: Args) => Extend; }