Variables
Const add
add: { <A>(value: A, set: ReadonlySet<A>): ReadonlySet<A>; <A>(value: A): (set: ReadonlySet<A>) => ReadonlySet<A> } = curry(__add)
Type declaration
-
- <A>(value: A, set: ReadonlySet<A>): ReadonlySet<A>
- <A>(value: A): (set: ReadonlySet<A>) => ReadonlySet<A>
-
Type parameters
Parameters
-
value: A
-
set: ReadonlySet<A>
Returns ReadonlySet<A>
-
Type parameters
Parameters
Returns (set: ReadonlySet<A>) => ReadonlySet<A>
-
- (set: ReadonlySet<A>): ReadonlySet<A>
-
Parameters
Returns ReadonlySet<A>
Const ap
ap
: { <A, B>
(fn
: ReadonlySet<Arity1<A, B>>, value
: ReadonlySet<A>): ReadonlySet<B>; <A, B>
(fn
: ReadonlySet<Arity1<A, B>>): (value
: ReadonlySet<A>) => ReadonlySet<B> } = curry(<A, B>(fn: ReadonlySet<Arity1<A, B>>, value: ReadonlySet<A>): ReadonlySet<B> =>chain((f) => map(f, value), fn),)
Type declaration
-
- <A, B>(fn: ReadonlySet<Arity1<A, B>>, value: ReadonlySet<A>): ReadonlySet<B>
- <A, B>(fn: ReadonlySet<Arity1<A, B>>): (value: ReadonlySet<A>) => ReadonlySet<B>
-
Type parameters
Parameters
-
fn: ReadonlySet<Arity1<A, B>>
-
value: ReadonlySet<A>
Returns ReadonlySet<B>
-
Type parameters
Parameters
Returns (value: ReadonlySet<A>) => ReadonlySet<B>
-
- (value: ReadonlySet<A>): ReadonlySet<B>
-
Parameters
Returns ReadonlySet<B>
Const chain
chain
: { <A, B>
(fn
: Arity1<A, ReadonlySet<B>>, set
: ReadonlySet<A>): ReadonlySet<B>; <A, B>
(fn
: Arity1<A, ReadonlySet<B>>): (set
: ReadonlySet<A>) => ReadonlySet<B> } = curry(<A, B>(fn: Arity1<A, ReadonlySet<B>>, set: ReadonlySet<A>): ReadonlySet<B> => {const bs = new Set<B>()set.forEach((a) => fn(a).forEach((b) => bs.add(b)))return bs},)
Type declaration
-
- <A, B>(fn: Arity1<A, ReadonlySet<B>>, set: ReadonlySet<A>): ReadonlySet<B>
- <A, B>(fn: Arity1<A, ReadonlySet<B>>): (set: ReadonlySet<A>) => ReadonlySet<B>
-
Type parameters
Parameters
-
fn: Arity1<A, ReadonlySet<B>>
-
set: ReadonlySet<A>
Returns ReadonlySet<B>
-
Type parameters
Parameters
Returns (set: ReadonlySet<A>) => ReadonlySet<B>
-
- (set: ReadonlySet<A>): ReadonlySet<B>
-
Parameters
Returns ReadonlySet<B>
Const concat
concat: { <A>(a: ReadonlySet<A>, b: ReadonlySet<A>): ReadonlySet<A>; <A>(a: ReadonlySet<A>): (b: ReadonlySet<A>) => ReadonlySet<A> } = curry(<A>(a: ReadonlySet<A>, b: ReadonlySet<A>): ReadonlySet<A> => {const set = new Set()a.forEach((x) => set.add(x))b.forEach((x) => set.add(x))return set as ReadonlySet<A>},)
Type declaration
-
- <A>(a: ReadonlySet<A>, b: ReadonlySet<A>): ReadonlySet<A>
- <A>(a: ReadonlySet<A>): (b: ReadonlySet<A>) => ReadonlySet<A>
-
Type parameters
Parameters
-
a: ReadonlySet<A>
-
b: ReadonlySet<A>
Returns ReadonlySet<A>
-
Type parameters
Parameters
Returns (b: ReadonlySet<A>) => ReadonlySet<A>
-
- (b: ReadonlySet<A>): ReadonlySet<A>
-
Parameters
Returns ReadonlySet<A>
Const difference
difference: { <A>(a: ReadonlySet<A>, differenceOf: ReadonlySet<A>): ReadonlySet<A>; <A>(a: ReadonlySet<A>): (differenceOf: ReadonlySet<A>) => ReadonlySet<A> } = curry(<A>(a: ReadonlySet<A>, differenceOf: ReadonlySet<A>): ReadonlySet<A> =>withMutations((x) => x.forEach((y) => a.has(y) && x.delete(y)), differenceOf),)
Type declaration
-
- <A>(a: ReadonlySet<A>, differenceOf: ReadonlySet<A>): ReadonlySet<A>
- <A>(a: ReadonlySet<A>): (differenceOf: ReadonlySet<A>) => ReadonlySet<A>
-
Type parameters
Parameters
-
a: ReadonlySet<A>
-
differenceOf: ReadonlySet<A>
Returns ReadonlySet<A>
-
Type parameters
Parameters
Returns (differenceOf: ReadonlySet<A>) => ReadonlySet<A>
-
- (differenceOf: ReadonlySet<A>): ReadonlySet<A>
-
Parameters
-
differenceOf: ReadonlySet<A>
Returns ReadonlySet<A>
Const filter
filter
: { <A>
(predicate
: Predicate<A>, set
: ReadonlySet<A>): ReadonlySet<A>; <A>
(predicate
: Predicate<A>): (set
: ReadonlySet<A>) => ReadonlySet<A> } = curry(__filter)
Type declaration
-
- <A>(predicate: Predicate<A>, set: ReadonlySet<A>): ReadonlySet<A>
- <A>(predicate: Predicate<A>): (set: ReadonlySet<A>) => ReadonlySet<A>
-
Type parameters
Parameters
Returns ReadonlySet<A>
-
Type parameters
Parameters
Returns (set: ReadonlySet<A>) => ReadonlySet<A>
-
- (set: ReadonlySet<A>): ReadonlySet<A>
-
Parameters
Returns ReadonlySet<A>
Const forEach
for
Each: { <A>(fn: Arity1<A>, set: ReadonlySet<A>): ReadonlySet<A>; <A>(fn: Arity1<A>): (set: ReadonlySet<A>) => ReadonlySet<A> } = curry(__forEach)
Type declaration
-
- <A>(fn: Arity1<A>, set: ReadonlySet<A>): ReadonlySet<A>
- <A>(fn: Arity1<A>): (set: ReadonlySet<A>) => ReadonlySet<A>
-
Type parameters
Parameters
Returns ReadonlySet<A>
-
Type parameters
Parameters
Returns (set: ReadonlySet<A>) => ReadonlySet<A>
-
- (set: ReadonlySet<A>): ReadonlySet<A>
-
Parameters
Returns ReadonlySet<A>
Const has
has: { <A>(value: A, set: ReadonlySet<A>): boolean; <A>(value: A): (set: ReadonlySet<A>) => boolean } = curry(__has)
Type declaration
-
- <A>(value: A, set: ReadonlySet<A>): boolean
- <A>(value: A): (set: ReadonlySet<A>) => boolean
-
Type parameters
Parameters
-
value: A
-
set: ReadonlySet<A>
Returns boolean
-
Type parameters
Parameters
Returns (set: ReadonlySet<A>) => boolean
-
- (set: ReadonlySet<A>): boolean
-
Parameters
Returns boolean
Const intersection
intersection: { <A>(a: ReadonlySet<A>, b: ReadonlySet<A>): ReadonlySet<A>; <A>(a: ReadonlySet<A>): (b: ReadonlySet<A>) => ReadonlySet<A> } = curry(<A>(a: ReadonlySet<A>, b: ReadonlySet<A>): ReadonlySet<A> =>withMutations((x) => x.forEach((y) => !b.has(y) && x.delete(y)), a),)
Type declaration
-
- <A>(a: ReadonlySet<A>, b: ReadonlySet<A>): ReadonlySet<A>
- <A>(a: ReadonlySet<A>): (b: ReadonlySet<A>) => ReadonlySet<A>
-
Type parameters
Parameters
-
a: ReadonlySet<A>
-
b: ReadonlySet<A>
Returns ReadonlySet<A>
-
Type parameters
Parameters
Returns (b: ReadonlySet<A>) => ReadonlySet<A>
-
- (b: ReadonlySet<A>): ReadonlySet<A>
-
Parameters
Returns ReadonlySet<A>
Const map
map
: { <A, B>
(fn
: Arity1<A, B>, set
: ReadonlySet<A>): ReadonlySet<B>; <A, B>
(fn
: Arity1<A, B>): (set
: ReadonlySet<A>) => ReadonlySet<B> } = curry(<A, B>(fn: Arity1<A, B>, set: ReadonlySet<A>): ReadonlySet<B> => {const bs = new Set<B>()set.forEach((a) => bs.add(fn(a)))return bs},)
Type declaration
-
- <A, B>(fn: Arity1<A, B>, set: ReadonlySet<A>): ReadonlySet<B>
- <A, B>(fn: Arity1<A, B>): (set: ReadonlySet<A>) => ReadonlySet<B>
-
Type parameters
Parameters
Returns ReadonlySet<B>
-
Type parameters
Parameters
Returns (set: ReadonlySet<A>) => ReadonlySet<B>
-
- (set: ReadonlySet<A>): ReadonlySet<B>
-
Parameters
Returns ReadonlySet<B>
Const remove
remove: { <A>(value: A, set: ReadonlySet<A>): ReadonlySet<A>; <A>(value: A): (set: ReadonlySet<A>) => ReadonlySet<A> } = curry(__remove)
Type declaration
-
- <A>(value: A, set: ReadonlySet<A>): ReadonlySet<A>
- <A>(value: A): (set: ReadonlySet<A>) => ReadonlySet<A>
-
Type parameters
Parameters
-
value: A
-
set: ReadonlySet<A>
Returns ReadonlySet<A>
-
Type parameters
Parameters
Returns (set: ReadonlySet<A>) => ReadonlySet<A>
-
- (set: ReadonlySet<A>): ReadonlySet<A>
-
Parameters
Returns ReadonlySet<A>
Const subset
subset: { <A>(a: ReadonlySet<A>, b: ReadonlySet<A>): boolean; <A>(a: ReadonlySet<A>): (b: ReadonlySet<A>) => boolean } = curry(__subset)
Type declaration
-
- <A>(a: ReadonlySet<A>, b: ReadonlySet<A>): boolean
- <A>(a: ReadonlySet<A>): (b: ReadonlySet<A>) => boolean
-
Type parameters
Parameters
-
a: ReadonlySet<A>
-
b: ReadonlySet<A>
Returns boolean
-
Type parameters
Parameters
Returns (b: ReadonlySet<A>) => boolean
-
- (b: ReadonlySet<A>): boolean
-
Parameters
Returns boolean
Const subsetOf
subsetOf: { <A>(a: ReadonlySet<A>, b: ReadonlySet<A>): boolean; <A>(a: ReadonlySet<A>): (b: ReadonlySet<A>) => boolean } = curry(__subsetOf)
Type declaration
-
- <A>(a: ReadonlySet<A>, b: ReadonlySet<A>): boolean
- <A>(a: ReadonlySet<A>): (b: ReadonlySet<A>) => boolean
-
Type parameters
Parameters
-
a: ReadonlySet<A>
-
b: ReadonlySet<A>
Returns boolean
-
Type parameters
Parameters
Returns (b: ReadonlySet<A>) => boolean
-
- (b: ReadonlySet<A>): boolean
-
Parameters
Returns boolean
Const withMutations
with
Mutations: { <A>(fn: (set: Set<A>) => void, set: ReadonlySet<A>): ReadonlySet<A>; <A>(fn: (set: Set<A>) => void): (set: ReadonlySet<A>) => ReadonlySet<A> } = curry(__withMutations)
Type declaration
-
- <A>(fn: (set: Set<A>) => void, set: ReadonlySet<A>): ReadonlySet<A>
- <A>(fn: (set: Set<A>) => void): (set: ReadonlySet<A>) => ReadonlySet<A>
-
Type parameters
Parameters
-
fn: (set: Set<A>) => void
-
set: ReadonlySet<A>
Returns ReadonlySet<A>
-
Type parameters
Parameters
-
fn: (set: Set<A>) => void
Returns (set: ReadonlySet<A>) => ReadonlySet<A>
-
- (set: ReadonlySet<A>): ReadonlySet<A>
-
Parameters
Returns ReadonlySet<A>
@typed/set