Packages

  • package root
    Definition Classes
    root
  • package cats

    The cats root package contains all the trait signatures of most Scala type classes.

    The cats root package contains all the trait signatures of most Scala type classes.

    Cats type classes are implemented using the approach from the Type classes as objects and implicits article.

    For each type class, cats provides three pieces: - Its signature: a trait that is polymorphic on a type parameter. Type class traits inherit from other type classes to indicate that any implementation of the lower type class (e.g. Applicative) can also serve as an instance for the higuer type class (e.g. Functor). - Type class 'instances, which are classes and objects that implement one or more type class signatures for some specific types. Type class instances for several data types from the Java or Scala standard libraries are declared in the subpackage cats.instances. - Syntax extensions, each of which provides the methods of the type class defines as extension methods (which in Scala 2 are encoded as implicit classes) for values of any type F; given that an instance of the type class for the receiver type (this) is in the implicit scope. Symtax extensions are declared in the cats.syntax package. - A set of laws, that are also generic on the type of the class, and are only defined on the operations of the type class. The purpose of these laws is to declare some algebraic relations (equations) between Scala expressions involving the operations of the type class, and test (but not verify) that implemented instances satisfy those equations. Laws are defined in the cats-laws package.

    Although most of cats type classes are declared in this package, some are declared in other packages: - type classes that operate on base types (kind *), and their implementations for standard library types, are contained in cats.kernel, which is a different SBT project. However, they are re-exported from this package. - type classes of kind F[_, _], such as cats.arrow.Profunctor" or cats.arrow.Arrow, which are relevant for Functional Reactive Programming or optics, are declared in the cats.arrow package. - Also, those type classes that abstract over (pure or impure) functional runtime effects are declared in the cats-effect library. - Some type classes for which no laws can be provided are left out of the main road, in a small and dirty alley. These are the alleycats.

    Definition Classes
    root
  • package data
    Definition Classes
    cats
  • AndThen
  • AppFunc
  • Binested
  • BinestedBifoldable
  • BinestedBitraverse
  • BinestedInstances
  • Chain
  • Cokleisli
  • Const
  • Cont
  • ContT
  • EitherK
  • EitherT
  • Func
  • IdT
  • IndexedReaderWriterStateT
  • IndexedState
  • IndexedStateT
  • Ior
  • IorT
  • Kleisli
  • Nested
  • NonEmptyChainOps
  • NonEmptyList
  • NonEmptyMapOps
  • NonEmptySetOps
  • NonEmptyVector
  • OneAnd
  • Op
  • OptionT
  • Reader
  • ReaderWriterState
  • ReaderWriterStateT
  • RepresentableStore
  • State
  • StateT
  • Store
  • Tuple2K
  • Validated
  • Writer
  • WriterT
  • ZipList
  • ZipStream
  • ZipVector
c

cats.data

NonEmptySetOps

sealed class NonEmptySetOps[A] extends AnyRef

Annotations
@suppressUnusedImportWarningForScalaVersionSpecific()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NonEmptySetOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NonEmptySetOps(value: NonEmptySet[A])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def &(as: NonEmptySet[A]): SortedSet[A]

    Alias for intersect

    Alias for intersect

    scala> import cats.data.NonEmptySet
    scala> import cats.implicits._
    scala> val nes = NonEmptySet.of(1, 2, 4, 5)
    scala> nes & NonEmptySet.of(1, 2, 7)
    res0: scala.collection.immutable.SortedSet[Int] = TreeSet(1, 2)
  4. def &~(as: NonEmptySet[A]): SortedSet[A]

    Alias for diff

    Alias for diff

    scala> import cats.data.NonEmptySet
    scala> import cats.implicits._
    scala> val nes = NonEmptySet.of(1, 2, 4, 5)
    scala> nes &~ NonEmptySet.of(1, 2, 7)
    res0: scala.collection.immutable.SortedSet[Int] = TreeSet(4, 5)
  5. def ++(as: NonEmptySet[A]): NonEmptySet[A]

    Alias for union

    Alias for union

    scala> import cats.data.NonEmptySet
    scala> import cats.implicits._
    scala> val nes = NonEmptySet.of(1, 2, 4, 5)
    scala> nes ++ NonEmptySet.of(1, 2, 7)
    res0: cats.data.NonEmptySet[Int] = TreeSet(1, 2, 4, 5, 7)
  6. def -(a: A): SortedSet[A]

    Removes a key from this set, returning a new SortedSet.

  7. def --(as: NonEmptySet[A]): SortedSet[A]

    Alias for diff

    Alias for diff

    scala> import cats.data.NonEmptySet
    scala> import cats.implicits._
    scala> val nes = NonEmptySet.of(1, 2, 4, 5)
    scala> nes -- NonEmptySet.of(1, 2, 7)
    res0: scala.collection.immutable.SortedSet[Int] = TreeSet(4, 5)
  8. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def ===(that: NonEmptySet[A]): Boolean

    Typesafe equality operator.

    Typesafe equality operator.

    This method is similar to == except that it only allows two NonEmptySet[A] values to be compared to each other, and uses equality provided by Eq[_] instances, rather than using the universal equality provided by .equals.

  10. def add(a: A): NonEmptySet[A]

    Adds an element to this set, returning a new NonEmptySet

  11. def apply(a: A): Boolean

    Alias for contains

    Alias for contains

    scala> import cats.data.NonEmptySet
    scala> import cats.implicits._
    scala> val nes = NonEmptySet.of(1, 2, 3, 4, 5)
    scala> nes(3)
    res0: Boolean = true
    scala> nes(7)
    res1: Boolean = false
  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  14. def collect[B](pf: PartialFunction[A, B])(implicit B: kernel.Order[B]): SortedSet[B]

    Returns a new SortedSet containing all elements where the result of pf is defined.

  15. def concatMap[B](f: (A) ⇒ NonEmptySet[B])(implicit B: kernel.Order[B]): NonEmptySet[B]

    Map a function over all the elements of this set and concatenate the resulting sets into one.

    Map a function over all the elements of this set and concatenate the resulting sets into one.

    scala> import cats.data.NonEmptySet
    scala> import cats.implicits._
    scala> val nes = NonEmptySet.of(1, 2, 3)
    scala> nes.concatMap(n => NonEmptySet.of(n, n * 4, n * 5))
    res0: cats.data.NonEmptySet[Int] = TreeSet(1, 2, 3, 4, 5, 8, 10, 12, 15)
  16. def contains(a: A): Boolean

    Tests if some element is contained in this set.

  17. def diff(as: NonEmptySet[A]): SortedSet[A]

    Computes the difference of this set and another set.

  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  20. def exists(f: (A) ⇒ Boolean): Boolean

    Tests whether a predicate holds for at least one element of this set.

  21. def filter(p: (A) ⇒ Boolean): SortedSet[A]

    Filters all elements of this set that do not satisfy the given predicate.

  22. def filterNot(p: (A) ⇒ Boolean): SortedSet[A]

    Filters all elements of this set that satisfy the given predicate.

  23. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def find(f: (A) ⇒ Boolean): Option[A]

    Returns the first value that matches the given predicate.

  25. def foldLeft[B](b: B)(f: (B, A) ⇒ B): B

    Left-associative fold using f.

  26. def foldRight[B](lb: Eval[B])(f: (A, Eval[B]) ⇒ Eval[B]): Eval[B]

    Right-associative fold using f.

  27. def forall(p: (A) ⇒ Boolean): Boolean

    Tests whether a predicate holds for all elements of this set.

  28. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. def groupBy[B](f: (A) ⇒ B)(implicit B: kernel.Order[B]): NonEmptyMap[B, NonEmptySet[A]]

    Groups elements inside this NonEmptySet according to the Order of the keys produced by the given mapping function.

  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def head: A

    Returns the first element of this set.

  32. def intersect(as: NonEmptySet[A]): SortedSet[A]

    Computes the intersection between this set and another set.

  33. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  34. def last: A

    Returns the last element of this set.

  35. def length: Int

    Returns the number of elements in this set.

  36. def map[B](f: (A) ⇒ B)(implicit B: kernel.Order[B]): NonEmptySet[B]

    Applies f to all the elements

  37. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  39. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. def reduce[AA >: A](implicit S: kernel.Semigroup[AA]): AA

    Reduce using the Semigroup of A

  41. def reduceLeft(f: (A, A) ⇒ A): A

    Left-associative reduce using f.

  42. def reduceLeftTo[B](f: (A) ⇒ B)(g: (B, A) ⇒ B): B

    Apply f to the "initial element" of this set and lazily combine it with every other value using the given function g.

  43. def reduceRight(f: (A, Eval[A]) ⇒ Eval[A]): Eval[A]

    Left-associative reduce using f.

  44. def reduceRightTo[B](f: (A) ⇒ B)(g: (A, Eval[B]) ⇒ Eval[B]): Eval[B]

    Apply f to the "initial element" of this set and lazily combine it with every other value using the given function g.

  45. def show(implicit A: Show[A]): String

    Typesafe stringification method.

    Typesafe stringification method.

    This method is similar to .toString except that it stringifies values according to Show[_] instances, rather than using the universal .toString method.

  46. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  47. def tail: SortedSet[A]

    Returns all but the first element of this set.

  48. def toNonEmptyList: NonEmptyList[A]

    Converts this set to a NonEmptyList.

    Converts this set to a NonEmptyList.

    scala> import cats.data.NonEmptySet
    scala> import cats.implicits._
    scala> val nes = NonEmptySet.of(1, 2, 3, 4, 5)
    scala> nes.toNonEmptyList
    res0: cats.data.NonEmptyList[Int] = NonEmptyList(1, 2, 3, 4, 5)
  49. def toSortedSet: SortedSet[A]

    Converts this set to a SortedSet

  50. def toString(): String
    Definition Classes
    AnyRef → Any
  51. def union(as: NonEmptySet[A]): NonEmptySet[A]

    Computes the union between this NES and another NES.

  52. val value: NonEmptySet[A]
  53. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  56. def zipWith[B, C](b: NonEmptySet[B])(f: (A, B) ⇒ C)(implicit C: kernel.Order[C]): NonEmptySet[C]

    Zips this NonEmptySet with another NonEmptySet and applies a function for each pair of elements.

    Zips this NonEmptySet with another NonEmptySet and applies a function for each pair of elements.

    scala> import cats.data.NonEmptySet
    scala> import cats.implicits._
    scala> val as = NonEmptySet.of(1, 2, 3)
    scala> val bs = NonEmptySet.of("A", "B", "C")
    scala> as.zipWith(bs)(_.toString + _)
    res0: cats.data.NonEmptySet[String] = TreeSet(1A, 2B, 3C)
  57. def zipWithIndex: NonEmptySet[(A, Int)]

    Zips this NonEmptySet with its index.

  58. def |(as: NonEmptySet[A]): NonEmptySet[A]

    Alias for union

    Alias for union

    scala> import cats.data.NonEmptySet
    scala> import cats.implicits._
    scala> val nes = NonEmptySet.of(1, 2, 4, 5)
    scala> nes | NonEmptySet.of(1, 2, 7)
    res0: cats.data.NonEmptySet[Int] = TreeSet(1, 2, 4, 5, 7)

Inherited from AnyRef

Inherited from Any

Ungrouped