/** * @since 2.0.0 */ import { Separated } from './Compactable' import { Either } from './Either' import { Eq } from './Eq' import { Predicate, Refinement } from './function' import { Monoid } from './Monoid' import { Option } from './Option' import { Ord } from './Ord' import { Semigroup } from './Semigroup' import { Show } from './Show' /** * @category instances * @since 2.0.0 */ export declare const getShow: (S: Show) => Show> /** * @since 2.0.0 */ export declare const empty: Set /** * @category constructors * @since 2.0.0 */ export declare const toArray: (O: Ord) => (set: Set) => Array /** * @category instances * @since 2.0.0 */ export declare const getEq: (E: Eq) => Eq> /** * @since 2.0.0 */ export declare const some: (predicate: Predicate) => (set: Set) => boolean /** * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types * use the type constructor `F` to represent some computational context. * * @category combinators * @since 2.0.0 */ export declare const map: (E: Eq) => (f: (x: A) => B) => (set: Set) => Set /** * @since 2.0.0 */ export declare const every: (predicate: Predicate) => (set: Set) => boolean /** * Composes computations in sequence, using the return value of one computation to determine the next computation. * * @category combinators * @since 2.0.0 */ export declare const chain: (E: Eq) => (f: (x: A) => Set) => (set: Set) => Set /** * `true` if and only if every element in the first set is an element of the second set * * @since 2.0.0 */ export declare const subset: ( E: Eq ) => { (that: Set): (me: Set) => boolean (me: Set, that: Set): boolean } /** * @category combinators * @since 2.0.0 */ export declare function filter(refinement: Refinement): (set: Set) => Set export declare function filter(predicate: Predicate): (set: Set) => Set /** * @since 2.0.0 */ export declare function partition( refinement: Refinement ): (set: Set) => Separated, Set> export declare function partition(predicate: Predicate): (set: Set) => Separated, Set> /** * Test if a value is a member of a set * * @since 2.0.0 */ export declare const elem: ( E: Eq ) => { (a: A): (set: Set) => boolean (a: A, set: Set): boolean } /** * Form the union of two sets * * @category combinators * @since 2.0.0 */ export declare const union: ( E: Eq ) => { (that: Set): (me: Set) => Set (me: Set, that: Set): Set } /** * The set of elements which are in both the first and second set * * @category combinators * @since 2.0.0 */ export declare const intersection: ( E: Eq ) => { (that: Set): (me: Set) => Set (me: Set, that: Set): Set } /** * @since 2.0.0 */ export declare const partitionMap: ( EB: Eq, EC: Eq ) => (f: (a: A) => Either) => (set: Set) => Separated, Set> /** * Form the set difference (`x` - `y`) * * @example * import { difference } from 'fp-ts/Set' * import { eqNumber } from 'fp-ts/Eq' * import { pipe } from 'fp-ts/function' * * assert.deepStrictEqual(pipe(new Set([1, 2]), difference(eqNumber)(new Set([1, 3]))), new Set([2])) * * @category combinators * @since 2.0.0 */ export declare const difference: ( E: Eq ) => { (that: Set): (me: Set) => Set (me: Set, that: Set): Set } /** * @category instances * @since 2.0.0 */ export declare const getUnionMonoid: (E: Eq) => Monoid> /** * @category instances * @since 2.0.0 */ export declare const getIntersectionSemigroup: (E: Eq) => Semigroup> /** * @since 2.0.0 */ export declare const reduce: (O: Ord) => (b: B, f: (b: B, a: A) => B) => (fa: Set) => B /** * @since 2.0.0 */ export declare const foldMap: (O: Ord, M: Monoid) => (f: (a: A) => M) => (fa: Set) => M /** * Create a set with one element * * @category constructors * @since 2.0.0 */ export declare const singleton: (a: A) => Set /** * Insert a value into a set * * @category combinators * @since 2.0.0 */ export declare const insert: (E: Eq) => (a: A) => (set: Set) => Set /** * Delete a value from a set * * @category combinators * @since 2.0.0 */ export declare const remove: (E: Eq) => (a: A) => (set: Set) => Set /** * Checks an element is a member of a set; * If yes, removes the value from the set * If no, inserts the value to the set * * @category combinators * @since 2.5.0 */ export declare function toggle(E: Eq): (a: A) => (set: Set) => Set /** * Create a set from an array * * @category constructors * @since 2.0.0 */ export declare const fromArray: (E: Eq) => (as: Array) => Set /** * @category combinators * @since 2.0.0 */ export declare const compact: (E: Eq) => (fa: Set>) => Set /** * @since 2.0.0 */ export declare const separate: (EE: Eq, EA: Eq) => (fa: Set>) => Separated, Set> /** * @category combinators * @since 2.0.0 */ export declare const filterMap: (E: Eq) => (f: (a: A) => Option) => (fa: Set) => Set