id | title |
---|---|
Set |
Module Set |
Signature (function) Source
export const chain = <B>(bset: Setoid<B>) => <A>(x: Set<A>, f: (x: A) => Set<B>): Set<B> => { ... }
Added in v1.2.0
Signature (function) Source
export const compact = <A>(S: Setoid<A>): ((fa: Set<Option<A>>) => Set<A>) => { ... }
Added in v1.12.0
Use difference2v instead
Signature (function) Source
export const difference = <A>(S: Setoid<A>): ((x: Set<A>, y: Set<A>) => Set<A>) => { ... }
Added in v1.0.0
Form the set difference (x
- y
)
Signature (function) Source
export const difference2v = <A>(S: Setoid<A>): ((x: Set<A>, y: Set<A>) => Set<A>) => { ... }
Example
import { difference2v } from 'fp-ts/lib/Set'
import { setoidNumber } from 'fp-ts/lib/Setoid'
assert.deepStrictEqual(difference2v(setoidNumber)(new Set([1, 2]), new Set([1, 3])), new Set([2]))
Added in v1.12.0
Signature (function) Source
export const every = <A>(x: Set<A>, predicate: Predicate<A>): boolean => { ... }
Added in v1.0.0
Signature (function) Source
export function filter<A>(x: Set<A>, predicate: Predicate<A>): Set<A> { ... }
Added in v1.0.0
Signature (function) Source
export const filterMap = <B>(S: Setoid<B>): (<A>(fa: Set<A>, f: (a: A) => Option<B>) => Set<B>) => { ... }
Added in v1.12.0
Create a set from an array
Signature (function) Source
export const fromArray = <A>(S: Setoid<A>) => (as: Array<A>): Set<A> => { ... }
Added in v1.2.0
Signature (function) Source
export const getIntersectionSemigroup = <A>(S: Setoid<A>): Semigroup<Set<A>> => { ... }
Added in v1.0.0
Signature (function) Source
export const getSetoid = <A>(S: Setoid<A>): Setoid<Set<A>> => { ... }
Added in v1.0.0
Signature (function) Source
export const getUnionMonoid = <A>(S: Setoid<A>): Monoid<Set<A>> => { ... }
Added in v1.0.0
Insert a value into a set
Signature (function) Source
export const insert = <A>(S: Setoid<A>): ((a: A, x: Set<A>) => Set<A>) => { ... }
Added in v1.0.0
The set of elements which are in both the first and second set
Signature (function) Source
export const intersection = <A>(S: Setoid<A>): ((x: Set<A>, y: Set<A>) => Set<A>) => { ... }
Added in v1.0.0
Projects a Set through a function
Signature (function) Source
export const map = <B>(bset: Setoid<B>) => <A>(x: Set<A>, f: (x: A) => B): Set<B> => { ... }
Added in v1.2.0
Test if a value is a member of a set
Signature (function) Source
export const member = <A>(S: Setoid<A>) => (x: Set<A>) => (a: A): boolean => { ... }
Added in v1.0.0
Signature (function) Source
export function partition<A>(x: Set<A>, predicate: Predicate<A>): Separated<Set<A>, Set<A>> { ... }
Added in v1.2.0
Signature (function) Source
export const partitionMap = <L, R>(SL: Setoid<L>, SR: Setoid<R>) => <A>(
x: Set<A>,
f: (a: A) => Either<L, R>
): Separated<Set<L>, Set<R>> => { ... }
Added in v1.2.0
Signature (function) Source
export const reduce = <A>(O: Ord<A>): (<B>(fa: Set<A>, b: B, f: (b: B, a: A) => B) => B) => { ... }
Added in v1.0.0
Delete a value from a set
Signature (function) Source
export const remove = <A>(S: Setoid<A>) => (a: A, x: Set<A>): Set<A> => { ... }
Added in v1.0.0
Signature (function) Source
export const separate = <L, R>(SL: Setoid<L>, SR: Setoid<R>) => (fa: Set<Either<L, R>>): Separated<Set<L>, Set<R>> => { ... }
Added in v1.12.0
Create a set with one element
Signature (function) Source
export const singleton = <A>(a: A): Set<A> => { ... }
Added in v1.0.0
Signature (function) Source
export const some = <A>(x: Set<A>, predicate: Predicate<A>): boolean => { ... }
Added in v1.0.0
true
if and only if every element in the first set is an element of the second set
Signature (function) Source
export const subset = <A>(S: Setoid<A>) => (x: Set<A>, y: Set<A>): boolean => { ... }
Added in v1.0.0
Signature (function) Source
export const toArray = <A>(O: Ord<A>) => (x: Set<A>): Array<A> => { ... }
Added in v1.0.0
Form the union of two sets
Signature (function) Source
export const union = <A>(S: Setoid<A>): ((x: Set<A>, y: Set<A>) => Set<A>) => { ... }
Added in v1.0.0