Packages

final class NonEmptySet[A] extends AnyRef

Self Type
NonEmptySet[A]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NonEmptySet
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def +(elem: A): NonEmptySet[A]

    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.

    elem

    the element to be added

    returns

    a new set that contains all elements of this set and that also contains elem.

  2. def ++(elems: Iterable[A]): NonEmptySet[A]

    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)
    elems

    the collection containing the elements to add.

    returns

    a new NonEmptySet with the given elements added, omitting duplicates.

  3. def add(elem: A): NonEmptySet[A]

    Adds the elem to this NonEmptySet.

    Adds the elem to this NonEmptySet. Alias for +.

  4. def equals(that: Any): Boolean
    Definition Classes
    NonEmptySet → AnyRef → Any
  5. def flatten[B](implicit ev: <:<[A, NonEmptySet[B]]): NonEmptySet[B]

    Flattens a NonEmptySet of NonEmptySet values into a single NonEmptySet.

  6. def hashCode(): Int
    Definition Classes
    NonEmptySet → AnyRef → Any
  7. def map[B](f: (A) => B): NonEmptySet[B]
  8. def peel: (A, Set[A])

    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.

    Annotations
    @inline()
  9. def peelNonEmpty: (A, Option[NonEmptySet[A]])

    Returns an element of this NonEmptySet and the remainder or None, if the remainder is empty.

  10. def remove(elem: A): Set[A]

    Removes the elem from this NonEmptySet.

    Removes the elem from this NonEmptySet. Alias for -.

  11. def removeNonEmpty(elem: A): Option[NonEmptySet[A]]

    removes the elem from NonEmptySet, returning Some(NonEmptySet) if there's anything left, otherwise None

  12. def tailNonEmpty: Option[NonEmptySet[A]]

    Returns the tail of this NonEmptySet if it exists or None otherwise.

  13. def toNonEmptyChunk: NonEmptyChunk[A]

    Converts this NonEmptySet to a NonEmptyChunk.

  14. def toNonEmptyList: NonEmptyList[A]

    Converts this NonEmptySet to a NonEmptyList.

  15. def toSet: Set[A]

    Converts this NonEmptySet to a Set.

  16. def toString(): String
    Definition Classes
    NonEmptySet → AnyRef → Any
  17. def union(that: Set[A]): NonEmptySet[A]

    Computes the union between of NonEmptySet and another set.

    Computes the union between of NonEmptySet and another set.

    that

    the set to form the union with.

    returns

    a new NonEmptySet consisting of all elements that are in this set or in the given set that.