Creates a new NonEmptySortedSet
with an additional element, unless the element is
already present.
Creates a new NonEmptySortedSet
with an additional element, unless the element is
already present.
the element to be added
a new set that contains all elements of this set and that also
contains elem
.
Creates a new NonEmptySortedSet
by adding all elements contained in another collection to this NonEmptySortedSet
, omitting duplicates.
Creates a new NonEmptySortedSet
by adding all elements contained in another collection to this NonEmptySortedSet
, omitting duplicates.
This method takes a collection of elements and adds all elements, omitting duplicates, into NonEmptySortedSet
.
Example:
scala> val a = NonEmptySortedSet(1, 2) ++ NonEmptySortedSet(2, "a") a: zio.prelude.NonEmptySortedSet[Any] = NonEmptySortedSet(1, 2, a)
the collection containing the elements to add.
a new NonEmptySortedSet
with the given elements added, omitting duplicates.
Adds the elem
to this NonEmptySortedSet
.
Adds the elem
to this NonEmptySortedSet
. Alias for +
.
Returns an element of this NonEmptySortedSet
and the remainder, which is a (possibly empty) SortedSet
.
Returns an element of this NonEmptySortedSet
and the remainder, which is a (possibly empty) SortedSet
.
Returns an element of this NonEmptySortedSet
and the remainder or None
, if the remainder is empty.
Removes the elem
from this NonEmptySortedSet
.
Removes the elem
from this NonEmptySortedSet
. Alias for -
.
removes the elem from NonEmptySortedSet
, returning Some(NonEmptySortedSet) if there's anything
left, otherwise None
Returns the tail of this NonEmptySortedSet
if it exists or None
otherwise.
Converts this NonEmptySortedSet
to a NonEmptyChunk
.
Converts this NonEmptySortedSet
to a NonEmptyList
.
Converts this NonEmptySortedSet
to a SortedSet
.
Computes the union between of NonEmptySortedSet
and another set.
Computes the union between of NonEmptySortedSet
and another set.
the set to form the union with.
a new NonEmptySortedSet
consisting of all elements that are in this
set or in the given set that
.