SortedSet overview
Added in v2.0.0
Table of contents
- constructors
- elements
- equivalence
- filtering
- getters
- mapping
- models
- refinements
- sequencing
- symbol
- traversing
- utils
constructors
empty
Signature
export declare const empty: <A>(O: Order<A>) => SortedSet<A>
Added in v2.0.0
fromIterable
Creates a new SortedSet
from an iterable collection of values.
Signature
export declare const fromIterable: {
<B>(ord: Order<B>): <A extends B>(iterable: Iterable<A>) => SortedSet<A>
<A extends B, B>(iterable: Iterable<A>, ord: Order<B>): SortedSet<A>
}
Added in v2.0.0
make
Signature
export declare const make: <K>(
ord: Order<K>
) => <Entries extends ReadonlyArray<K>>(...entries: Entries) => SortedSet<Entries[number]>
Added in v2.0.0
elements
add
Signature
export declare const add: {
<A>(value: A): (self: SortedSet<A>) => SortedSet<A>
<A>(self: SortedSet<A>, value: A): SortedSet<A>
}
Added in v2.0.0
every
Check if a predicate holds true for every SortedSet
element.
Signature
export declare const every: {
<A>(predicate: Predicate<A>): (self: SortedSet<A>) => boolean
<A>(self: SortedSet<A>, predicate: Predicate<A>): boolean
}
Added in v2.0.0
has
Signature
export declare const has: { <A>(value: A): (self: SortedSet<A>) => boolean; <A>(self: SortedSet<A>, value: A): boolean }
Added in v2.0.0
isSubset
Signature
export declare const isSubset: {
<A>(that: SortedSet<A>): (self: SortedSet<A>) => boolean
<A>(self: SortedSet<A>, that: SortedSet<A>): boolean
}
Added in v2.0.0
remove
Signature
export declare const remove: {
<A>(value: A): (self: SortedSet<A>) => SortedSet<A>
<A>(self: SortedSet<A>, value: A): SortedSet<A>
}
Added in v2.0.0
some
Check if a predicate holds true for some SortedSet
element.
Signature
export declare const some: {
<A>(predicate: Predicate<A>): (self: SortedSet<A>) => boolean
<A>(self: SortedSet<A>, predicate: Predicate<A>): boolean
}
Added in v2.0.0
toggle
Signature
export declare const toggle: {
<A>(value: A): (self: SortedSet<A>) => SortedSet<A>
<A>(self: SortedSet<A>, value: A): SortedSet<A>
}
Added in v2.0.0
equivalence
getEquivalence
Signature
export declare const getEquivalence: <A>() => Equivalence.Equivalence<SortedSet<A>>
Added in v2.0.0
filtering
filter
Signature
export declare const filter: {
<A, B extends A>(predicate: Predicate<B>): (self: SortedSet<A>) => SortedSet<A>
<A>(self: SortedSet<A>, predicate: Predicate<A>): SortedSet<A>
}
Added in v2.0.0
partition
Signature
export declare const partition: {
<A>(predicate: (a: NoInfer<A>) => boolean): (self: SortedSet<A>) => [excluded: SortedSet<A>, satisfying: SortedSet<A>]
<A>(self: SortedSet<A>, predicate: (a: A) => boolean): [excluded: SortedSet<A>, satisfying: SortedSet<A>]
}
Added in v2.0.0
getters
size
Signature
export declare const size: <A>(self: SortedSet<A>) => number
Added in v2.0.0
values
Signature
export declare const values: <A>(self: SortedSet<A>) => IterableIterator<A>
Added in v2.0.0
mapping
map
Signature
export declare const map: {
<B, A>(O: Order<B>, f: (a: A) => B): (self: SortedSet<A>) => SortedSet<B>
<B, A>(self: SortedSet<A>, O: Order<B>, f: (a: A) => B): SortedSet<B>
}
Added in v2.0.0
models
SortedSet (interface)
Signature
export interface SortedSet<in out A> extends Iterable<A>, Equal.Equal, Pipeable, Inspectable {
readonly [TypeId]: {
readonly _A: Invariant<A>
}
/** @internal */
readonly keyTree: RBT.RedBlackTree<A, boolean>
}
Added in v2.0.0
refinements
isSortedSet
Signature
export declare const isSortedSet: { <A>(u: Iterable<A>): u is SortedSet<A>; (u: unknown): u is SortedSet<unknown> }
Added in v2.0.0
sequencing
flatMap
Signature
export declare const flatMap: {
<B, A>(O: Order<B>, f: (a: A) => Iterable<B>): (self: SortedSet<A>) => SortedSet<B>
<A, B>(self: SortedSet<A>, O: Order<B>, f: (a: A) => Iterable<B>): SortedSet<B>
}
Added in v2.0.0
symbol
TypeId (type alias)
Signature
export type TypeId = typeof TypeId
Added in v2.0.0
traversing
forEach
Signature
export declare const forEach: {
<A>(f: (a: A) => void): (self: SortedSet<A>) => void
<A>(self: SortedSet<A>, f: (a: A) => void): void
}
Added in v2.0.0
utils
difference
Signature
export declare const difference: {
<A, B extends A>(that: Iterable<B>): (self: SortedSet<A>) => SortedSet<A>
<A, B extends A>(self: SortedSet<A>, that: Iterable<B>): SortedSet<A>
}
Added in v2.0.0
intersection
Signature
export declare const intersection: {
<A>(that: Iterable<A>): (self: SortedSet<A>) => SortedSet<A>
<A>(self: SortedSet<A>, that: Iterable<A>): SortedSet<A>
}
Added in v2.0.0
union
Signature
export declare const union: {
<A>(that: Iterable<A>): (self: SortedSet<A>) => SortedSet<A>
<A>(self: SortedSet<A>, that: Iterable<A>): SortedSet<A>
}
Added in v2.0.0