Creates a new NonEmptySet
with an additional element, unless the element is
already present.
Creates a new NonEmptySet
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 NonEmptySet
by adding all elements contained in another collection to this NonEmptySet
, omitting duplicates.
Creates a new NonEmptySet
by adding all elements contained in another collection to this NonEmptySet
, omitting duplicates.
This method takes a collection of elements and adds all elements, omitting duplicates, into NonEmptySet
.
Example:
scala> val a = NonEmptySet(1, 2) ++ NonEmptySet(2, "a") a: zio.prelude.NonEmptySet[Any] = NonEmptySet(1, 2, a)
the collection containing the elements to add.
a new NonEmptySet
with the given elements added, omitting duplicates.
Adds the elem
to this NonEmptySet
.
Adds the elem
to this NonEmptySet
. Alias for +
.
Returns an element of this NonEmptySet
and the remainder, which is a (possibly empty) Set
.
Returns an element of this NonEmptySet
and the remainder, which is a (possibly empty) Set
.
Flattens a NonEmptySet
of NonEmptySet
values into a single
NonEmptySet
.
Removes the elem
from this NonEmptySet
.
Removes the elem
from this NonEmptySet
. Alias for -
.
Converts this NonEmptySet
to a NonEmptyChunk
.
Converts this NonEmptySet
to a NonEmptyList
.
Converts this NonEmptySet
to a Set
.
Computes the union between of NonEmptySet
and another set.
Computes the union between of NonEmptySet
and another set.
the set to form the union with.
a new NonEmptySet
consisting of all elements that are in this
set or in the given set that
.