Class

cats.data

NonEmptyChainOps

Related Doc: package data

Permalink

final class NonEmptyChainOps[A] extends AnyVal

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NonEmptyChainOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NonEmptyChainOps(value: NonEmptyChain[A])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ++[A2 >: A](c: NonEmptyChain[A2]): NonEmptyChain[A2]

    Permalink

    Alias for concat

  4. final def ++:[A2 >: A](c: Chain[A2]): NonEmptyChain[A2]

    Permalink

    Alias for prependChain

    Alias for prependChain

    scala> import cats.data.NonEmptyChain
    scala> val nec = NonEmptyChain(4, 5, 6)
    scala> Chain(1, 2, 3) ++: nec
    res0: cats.data.NonEmptyChain[Int] = Chain(1, 2, 3, 4, 5, 6)
  5. final def +:[A2 >: A](a: A2): NonEmptyChain[A2]

    Permalink

    Alias for prepend.

  6. final def :+[A2 >: A](a: A2): NonEmptyChain[A2]

    Permalink

    Alias for append.

  7. final def :++[A2 >: A](c: Chain[A2]): NonEmptyChain[A2]

    Permalink

    Alias for appendChain

    Alias for appendChain

    scala> import cats.data.NonEmptyChain
    scala> val nec = NonEmptyChain(1, 2, 4, 5)
    scala> nec :++ Chain(3, 6, 9)
    res0: cats.data.NonEmptyChain[Int] = Chain(1, 2, 4, 5, 3, 6, 9)
  8. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  9. final def append[A2 >: A](a: A2): NonEmptyChain[A2]

    Permalink

    Returns a new Chain consisting of this followed by a.

    Returns a new Chain consisting of this followed by a. O(1) runtime.

  10. final def appendChain[A2 >: A](c: Chain[A2]): NonEmptyChain[A2]

    Permalink

    Appends the given chain in O(1) runtime.

  11. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  12. final def collect[B](pf: PartialFunction[A, B]): Chain[B]

    Permalink

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

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

    scala> import cats.data.NonEmptyChain
    scala> import cats.implicits._
    scala> val nec = NonEmptyChain(4, 5, 6).map(n => if (n % 2 == 0) Some(n) else None)
    scala> nec.collect { case Some(n) => n }
    res0: cats.data.Chain[Int] = Chain(4, 6)
  13. final def concat[A2 >: A](c: NonEmptyChain[A2]): NonEmptyChain[A2]

    Permalink

    Concatenates this with c in O(1) runtime.

    Concatenates this with c in O(1) runtime.

    scala> import cats.data.NonEmptyChain
    scala> val nec = NonEmptyChain(1, 2, 4, 5)
    scala> nec ++ NonEmptyChain(7, 8)
    res0: cats.data.NonEmptyChain[Int] = Chain(1, 2, 4, 5, 7, 8)
  14. final def contains(a: A)(implicit A: kernel.Eq[A]): Boolean

    Permalink

    Tests if some element is contained in this chain.

    Tests if some element is contained in this chain.

    scala> import cats.data.NonEmptyChain
    scala> import cats.implicits._
    scala> val nec = NonEmptyChain(4, 5, 6)
    scala> nec.contains(5)
    res0: Boolean = true
  15. final def deleteFirst(f: (A) ⇒ Boolean): Option[(A, Chain[A])]

    Permalink

    Yields to Some(a, Chain[A]) with a removed where f holds for the first time, otherwise yields None, if a was not found Traverses only until a is found.

  16. final def distinct[AA >: A](implicit O: Order[AA]): NonEmptyChain[AA]

    Permalink

    Remove duplicates.

    Remove duplicates. Duplicates are checked using Order[_] instance.

  17. final def exists(f: (A) ⇒ Boolean): Boolean

    Permalink

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

  18. final def filter(p: (A) ⇒ Boolean): Chain[A]

    Permalink

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

  19. final def filterNot(p: (A) ⇒ Boolean): Chain[A]

    Permalink

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

  20. final def find(f: (A) ⇒ Boolean): Option[A]

    Permalink

    Returns the first value that matches the given predicate.

  21. final def flatMap[B](f: (A) ⇒ NonEmptyChain[B]): NonEmptyChain[B]

    Permalink

    Applies the supplied function to each element and returns a new NonEmptyChain from the concatenated results

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

    Permalink

    Left-associative fold using f.

  23. final def foldRight[B](z: B)(f: (A, B) ⇒ B): B

    Permalink

    Right-associative fold using f.

  24. final def forall(p: (A) ⇒ Boolean): Boolean

    Permalink

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

  25. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  26. final def groupBy[B](f: (A) ⇒ B)(implicit B: Order[B]): NonEmptyMap[B, NonEmptyChain[A]]

    Permalink

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

  27. final def head: A

    Permalink

    Returns the first element of this chain.

  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. final def iterator: Iterator[A]

    Permalink
  30. final def length: Long

    Permalink

    Returns the number of elements in this chain.

  31. final def prepend[A2 >: A](a: A2): NonEmptyChain[A2]

    Permalink

    Returns a new NonEmptyChain consisting of a followed by this.

    Returns a new NonEmptyChain consisting of a followed by this. O(1) runtime.

  32. final def prependChain[A2 >: A](c: Chain[A2]): NonEmptyChain[A2]

    Permalink

    Prepends the given chain in O(1) runtime.

  33. final def reduce[AA >: A](implicit S: kernel.Semigroup[AA]): AA

    Permalink

    Reduce using the Semigroup of A

  34. final def reduceLeft(f: (A, A) ⇒ A): A

    Permalink

    Left-associative reduce using f.

    Left-associative reduce using f.

    scala> import cats.data.NonEmptyChain
    scala> val nec = NonEmptyChain(4, 5, 6)
    scala> nec.reduceLeft(_ + _)
    res0: Int = 15
  35. final def reduceLeftTo[B](f: (A) ⇒ B)(g: (B, A) ⇒ B): B

    Permalink

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

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

    scala> import cats.data.NonEmptyChain
    scala> val nec = NonEmptyChain(4, 5, 6)
    scala> nec.reduceLeftTo(_.toString)((acc, cur) => acc + cur.toString)
    res0: String = 456
  36. final def reduceRight(f: (A, A) ⇒ A): A

    Permalink

    Right-associative reduce using f.

    Right-associative reduce using f.

    scala> import cats.data.NonEmptyChain
    scala> val nec = NonEmptyChain(4, 5, 6)
    scala> nec.reduceRight(_ + _)
    res0: Int = 15
  37. final def reduceRightTo[B](f: (A) ⇒ B)(g: (A, B) ⇒ B): B

    Permalink

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

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

    scala> import cats.data.NonEmptyChain
    scala> val nec = NonEmptyChain(4, 5, 6)
    scala> nec.reduceRightTo(_.toString)((cur, acc) => acc + cur.toString)
    res0: String = 654
  38. final def reverse: NonEmptyChain[A]

    Permalink

    Reverses this NonEmptyChain

  39. final def reverseIterator: Iterator[A]

    Permalink
  40. final def tail: Chain[A]

    Permalink

    Returns all but the first element of this chain.

  41. final def toChain: Chain[A]

    Permalink

    Converts this chain to a Chain

  42. final def toNonEmptyList: NonEmptyList[A]

    Permalink

    Converts this chain to a NonEmptyList.

    Converts this chain to a NonEmptyList.

    scala> import cats.data.NonEmptyChain
    scala> val nec = NonEmptyChain(1, 2, 3, 4, 5)
    scala> nec.toNonEmptyList
    res0: cats.data.NonEmptyList[Int] = NonEmptyList(1, 2, 3, 4, 5)
  43. final def toNonEmptyVector: NonEmptyVector[A]

    Permalink

    Converts this chain to a NonEmptyVector.

    Converts this chain to a NonEmptyVector.

    scala> import cats.data.NonEmptyChain
    scala> val nec = NonEmptyChain(1, 2, 3, 4, 5)
    scala> nec.toNonEmptyVector
    res0: cats.data.NonEmptyVector[Int] = NonEmptyVector(1, 2, 3, 4, 5)
  44. def toString(): String

    Permalink
    Definition Classes
    Any
  45. final def uncons: (A, Chain[A])

    Permalink

    Returns the head and tail of this NonEmptyChain.

    Returns the head and tail of this NonEmptyChain. Amortized O(1).

  46. final def zipWith[B, C](b: NonEmptyChain[B])(f: (A, B) ⇒ C): NonEmptyChain[C]

    Permalink

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

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

    scala> import cats.data.NonEmptyChain
    scala> val as = NonEmptyChain(1, 2, 3)
    scala> val bs = NonEmptyChain("A", "B", "C")
    scala> as.zipWith(bs)(_ + _)
    res0: cats.data.NonEmptyChain[String] = Chain(1A, 2B, 3C)

Inherited from AnyVal

Inherited from Any

Ungrouped