import { Append, AppendOptional, Concat, ElementOf, IsEmpty, List, Prepend } from "../../list"; import { Satisfies, Unreachable } from "../../type"; import { $, HKT, _, I } from ".."; type __$Map, L extends List, Acc extends List = []> = L extends [...infer Init, infer Last] ? __$Map>> : Concat>>, Acc>; type _$Map, L extends List, Acc extends List = []> = IsEmpty extends true ? Acc : L extends readonly [infer H, ...infer T] ? _$Map>> : L extends readonly [...any, any] ? Concat> : L extends { 0?: any; } ? L extends readonly [_?: infer H, ...__: infer T] ? _$Map>> : Unreachable : Acc; /** * map the elements of list `L` by function `F`. * * @param P - HKT predicate to operate on each individual element of `L` * @param L - the list to filter * * @since 0.0.2 */ export type $Map, L extends List> = _$Map; /** * maps the elements of the input list by function `F` * * @since 0.0.2 */ export interface Map> extends HKT { [HKT.i]: Satisfies<_, List>>; [HKT.o]: $Map>; } export {}; //# sourceMappingURL=map.d.ts.map