import { ElementOf, IsEmpty, List } from "../../list"; import { Satisfies, Unreachable } from "../../type"; import { $, HKT, _, I } from ".."; type _$Exists

, L extends List> = L extends readonly [...infer Init, infer Last] ? $ extends true ? true : _$Exists : $> extends true ? true : false; /** * checks whether there exists some element of list `L` that satisfies predicate `P`. * * an empty list is vacuously unsatisfied (i.e. returns false) * * @param P - HKT predicate to operate on each individual element of `L` * @param L - the list to search * * @since 0.0.2 */ export type $Exists

, L extends List> = IsEmpty extends true ? false : L extends readonly [infer H, ...infer T] ? $ extends true ? true : $Exists : L extends readonly [...any, any] ? _$Exists : L extends { 0?: any; } ? L extends readonly [_?: infer H, ...__: infer T] ? $ extends true ? true : $Exists : Unreachable : false; /** * checks whether there exists some element of the input list satisfies predicate `P` * * an empty list is vacuously unsatisfied (i.e. returns false) * * @since 0.0.2 */ export interface Exists

> extends HKT { [HKT.i]: Satisfies<_, List>>; [HKT.o]: $Exists>; } export {}; //# sourceMappingURL=exists.d.ts.map