/** * Filterable is a structure that allows one to remove or refine a data * structure. * * @module Filterable * @since 2.0.0 */ import "./_dnt.polyfills.js"; import type { $, Hold, Kind } from "./kind.js"; import type { Either } from "./either.js"; import type { Mappable } from "./mappable.js"; import type { Option } from "./option.js"; import type { Pair } from "./pair.js"; import type { Predicate } from "./predicate.js"; import type { Refinement } from "./refinement.js"; /** * A Filterable structure allows one to filter over the values contained in the * structure. This includes standard filter, filterMap, partition, and * partitionMap. * * @since 2.0.0 */ export interface Filterable extends Hold { readonly filter: { (refinement: Refinement): (ta: $) => $; (predicate: Predicate): (ta: $) => $; }; readonly filterMap: (fai: (a: A) => Option) => (ua: $) => $; readonly partition: { (refinement: Refinement): (ta: $) => Pair<$, $>; (predicate: Predicate): (ta: $) => Pair<$, $>; }; readonly partitionMap: (fai: (a: A) => Either) => (ua: $) => Pair<$, $>; } /** * @since 2.0.0 */ export declare function filter({ map }: Mappable, { filter }: Filterable): (predicate: Predicate) => (ua: $, J, K], [L], [M]>) => $, J, K], [L], [M]>; /** * @since 2.0.0 */ export declare function filterMap({ map }: Mappable, { filterMap }: Filterable): (predicate: (a: A) => Option) => (ua: $, J, K], [L], [M]>) => $, J, K], [L], [M]>; /** * @since 2.0.0 */ export declare function partition(M: Mappable, F: Filterable): (predicate: Refinement) => (ua: $, J, K], [L], [M]>) => Pair<$, J, K], [L], [M]>, $, J, K], [L], [M]>>; export declare function partition(M: Mappable, F: Filterable): (predicate: Predicate) => (ua: $, J, K], [L], [M]>) => Pair<$, J, K], [L], [M]>, $, J, K], [L], [M]>>; /** * @since 2.0.0 */ export declare function partitionMap(M: Mappable, F: Filterable): (fai: (a: A) => Either) => (ua: $, J, K], [L], [M]>) => Pair<$, J, K], [L], [M]>, $, J, K], [L], [M]>>;