Packages

c

cats.data

NonEmptyLazyListOps

final class NonEmptyLazyListOps[A] extends AnyVal with NonEmptyCollection[A, LazyList, NonEmptyLazyList]

Source
NonEmptyLazyList.scala
Linear Supertypes
NonEmptyCollection[A, LazyList, data.NonEmptyLazyList], AnyVal, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NonEmptyLazyListOps
  2. NonEmptyCollection
  3. AnyVal
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new NonEmptyLazyListOps(value: data.NonEmptyLazyList[A])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. final def #::[AA >: A](a: AA): data.NonEmptyLazyList[AA]

    Alias for prepend.

  4. final def ++[AA >: A](nell: data.NonEmptyLazyList[AA]): data.NonEmptyLazyList[AA]

    Alias for concatNell

  5. final def ++:[AA >: A](c: data.NonEmptyLazyList[AA]): data.NonEmptyLazyList[AA]

    Alias for prependNell

  6. final def +:[AA >: A](a: AA): data.NonEmptyLazyList[AA]

    Alias for prepend.

  7. final def :+[AA >: A](a: AA): data.NonEmptyLazyList[AA]

    Alias for append.

  8. final def :++[AA >: A](c: LazyList[AA]): data.NonEmptyLazyList[AA]

    Alias for appendLazyList

  9. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  10. final def append[AA >: A](a: AA): data.NonEmptyLazyList[AA]

    Returns a new NonEmptyLazyList consisting of this followed by a

    Returns a new NonEmptyLazyList consisting of this followed by a

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  11. final def appendLazyList[AA >: A](nell: LazyList[AA]): data.NonEmptyLazyList[AA]

    Appends the given LazyList

  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. final def collect[B](pf: PartialFunction[A, B]): LazyList[B]

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

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

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  14. final def collectFirst[B](pf: PartialFunction[A, B]): Option[B]

    Finds the first element of this NonEmptyLazyList for which the given partial function is defined, and applies the partial function to it.

  15. final def concat[AA >: A](ll: LazyList[AA]): data.NonEmptyLazyList[AA]

    concatenates this with ll

  16. final def concatNell[AA >: A](nell: data.NonEmptyLazyList[AA]): data.NonEmptyLazyList[AA]

    Concatenates this with nell

  17. final def contains(a: A)(implicit A: Eq[A]): Boolean

    Tests if some element is contained in this NonEmptyLazyList

  18. def distinct[AA >: A](implicit O: Order[AA]): data.NonEmptyLazyList[AA]

    Remove duplicates.

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

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  19. final def exists(f: (A) => Boolean): Boolean

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

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

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  20. final def filter(p: (A) => Boolean): LazyList[A]

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

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

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  21. final def filterNot(p: (A) => Boolean): LazyList[A]

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

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

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  22. final def find(f: (A) => Boolean): Option[A]

    Returns the first value that matches the given predicate.

    Returns the first value that matches the given predicate.

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  23. final def flatMap[B](f: (A) => data.NonEmptyLazyList[B]): data.NonEmptyLazyList[B]

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

  24. final def foldLeft[B](b: B)(f: (B, A) => B): B

    Left-associative fold using f.

    Left-associative fold using f.

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  25. final def foldRight[B](z: B)(f: (A, B) => B): B

    Right-associative fold using f.

  26. final def forall(p: (A) => Boolean): Boolean

    Tests whether a predicate holds for all elements

    Tests whether a predicate holds for all elements

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  27. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  28. final def groupBy[B](f: (A) => B)(implicit B: Order[B]): SortedMap[B, data.NonEmptyLazyList[A]]

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

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

    scala> import scala.collection.immutable.SortedMap
    scala> import cats.data.NonEmptyLazyList
    scala> import cats.implicits._
    scala> val nel = NonEmptyLazyList(12, -2, 3, -5)
    scala> val expectedResult = SortedMap(false -> NonEmptyLazyList(-2, -5), true -> NonEmptyLazyList(12, 3))
    scala> val result = nel.groupBy(_ >= 0)
    scala> result === expectedResult
    res0: Boolean = true
  29. final def groupByNem[B](f: (A) => B)(implicit B: Order[B]): NonEmptyMap[B, data.NonEmptyLazyList[A]]

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

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

    scala> import cats.data.{NonEmptyLazyList, NonEmptyMap}
    scala> import cats.implicits._
    scala> val nel = NonEmptyLazyList(12, -2, 3, -5)
    scala> val expectedResult = NonEmptyMap.of(false -> NonEmptyLazyList(-2, -5), true -> NonEmptyLazyList(12, 3))
    scala> val result = nel.groupByNem(_ >= 0)
    scala> result === expectedResult
    res0: Boolean = true
    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  30. def grouped(size: Int): Iterator[data.NonEmptyLazyList[A]]

    Partitions elements in fixed size NonEmptyLazyLists.

    Partitions elements in fixed size NonEmptyLazyLists.

    scala> import cats.data.NonEmptyLazyList
    scala> import cats.implicits._
    scala> val nel = NonEmptyLazyList.fromLazyListUnsafe(LazyList(12, -2, 3, -5))
    scala> val expectedResult = List(
         |   NonEmptyLazyList.fromLazyListUnsafe(LazyList(12, -2)),
         |   NonEmptyLazyList.fromLazyListUnsafe(LazyList(3, -5))
         | )
    scala> val result = nel.grouped(2)
    scala> result.toList === expectedResult
    res0: Boolean = true
    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  31. final def head: A

    Returns the first element

    Returns the first element

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  32. final def init: LazyList[A]

    Returns all elements but the last

    Returns all elements but the last

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  33. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  34. final def iterator: Iterator[A]
    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  35. final def last: A

    Returns the last element

    Returns the last element

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  36. final def length: Int

    Returns the length of this NonEmptyLazyList

  37. final def map[B](f: (A) => B): data.NonEmptyLazyList[B]
    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  38. final def prepend[AA >: A](a: AA): data.NonEmptyLazyList[AA]

    Returns a new NonEmptyLazyList consisting of a followed by this

    Returns a new NonEmptyLazyList consisting of a followed by this

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  39. final def prependLazyList[AA >: A](c: LazyList[AA]): data.NonEmptyLazyList[AA]

    Prepends the given LazyList

  40. final def prependNell[AA >: A](c: data.NonEmptyLazyList[AA]): data.NonEmptyLazyList[AA]

    Prepends the given NonEmptyLazyList

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

    Reduce using the Semigroup of A

    Reduce using the Semigroup of A

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  42. final def reduceLeft(f: (A, A) => A): A

    Left-associative reduce using f.

  43. final def reduceLeftTo[B](f: (A) => B)(g: (B, A) => B): B

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

  44. final def reduceRight[AA >: A](f: (A, AA) => AA): AA

    Right-associative reduce using f.

  45. final def reduceRightTo[B](f: (A) => B)(g: (A, B) => B): B

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

  46. final def reverse: data.NonEmptyLazyList[A]

    Reverses this NonEmptyLazyList

    Reverses this NonEmptyLazyList

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  47. final def reverseIterator: Iterator[A]
  48. final def show[AA >: A](implicit AA: Show[AA]): String
    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  49. final def size: Int

    Returns the size of this NonEmptyLazyList

  50. final def sortBy[B](f: (A) => B)(implicit B: Order[B]): data.NonEmptyLazyList[A]

    Sorts this NonEmptyLazyList according to an Order on transformed B from A

    Sorts this NonEmptyLazyList according to an Order on transformed B from A

    scala> import cats.data.NonEmptyLazyList
    scala> import cats.instances.int._
    scala> val nel = NonEmptyLazyList(('a', 4), ('z', 1), ('e', 22))
    scala> nel.sortBy(_._2).toLazyList.toList
    res0: List[(Char, Int)] = List((z,1), (a,4), (e,22))
    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  51. final def sorted[AA >: A](implicit AA: Order[AA]): data.NonEmptyLazyList[AA]

    Sorts this NonEmptyList according to an Order

    Sorts this NonEmptyList according to an Order

    scala> import cats.data.NonEmptyLazyList
    scala> import cats.instances.int._
    scala> val nel = NonEmptyLazyList(12, 4, 3, 9)
    scala> nel.sorted.toLazyList.toList
    res0: List[Int] = List(3, 4, 9, 12)
    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  52. final def tail: LazyList[A]

    Returns all but the first element

    Returns all but the first element

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  53. final def toLazyList: LazyList[A]

    Converts this NonEmptyLazyList to a LazyList

  54. final def toNem[T, U](implicit ev: <:<[A, (T, U)], order: Order[T]): NonEmptyMap[T, U]

    Creates new NonEmptyMap, similarly to List#toMap from scala standard library.

    Creates new NonEmptyMap, similarly to List#toMap from scala standard library.

    scala> import cats.data.{NonEmptyLazyList, NonEmptyMap}
    scala> import cats.implicits._
    scala> val nel = NonEmptyLazyList.fromLazyListPrepend((0, "a"), LazyList((1, "b"),(0, "c"), (2, "d")))
    scala> val expectedResult = NonEmptyMap.of(0 -> "c", 1 -> "b", 2 -> "d")
    scala> val result = nel.toNem
    scala> result === expectedResult
    res0: Boolean = true
    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  55. final def toNes[B >: A](implicit order: Order[B]): NonEmptySet[B]

    Creates new NonEmptySet, similarly to List#toSet from scala standard library.

    Creates new NonEmptySet, similarly to List#toSet from scala standard library.

    scala> import cats.data._
    scala> import cats.instances.int._
    scala> val nel = NonEmptyLazyList.fromLazyListPrepend(1, LazyList(2,2,3,4))
    scala> nel.toNes
    res0: cats.data.NonEmptySet[Int] = TreeSet(1, 2, 3, 4)
    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  56. final def toNev[B >: A]: NonEmptyVector[B]

    Creates new NonEmptyVector, similarly to List#toVector from scala standard library.

    Creates new NonEmptyVector, similarly to List#toVector from scala standard library.

    scala> import cats.data._
    scala> import cats.instances.int._
    scala> val nel = NonEmptyLazyList.fromLazyListPrepend(1, LazyList(2,3,4))
    scala> val expectedResult = NonEmptyVector.fromVectorUnsafe(Vector(1,2,3,4))
    scala> val result = nel.toNev
    scala> result === expectedResult
    res0: Boolean = true
  57. final def toNonEmptyList: NonEmptyList[A]

    Converts this NonEmptyLazyList to a NonEmptyList.

  58. final def toNonEmptyVector: NonEmptyVector[A]

    Converts this LazyList to a NonEmptyVector.

  59. def toString(): String
    Definition Classes
    Any
  60. final def zipWith[B, C](b: data.NonEmptyLazyList[B])(f: (A, B) => C): data.NonEmptyLazyList[C]

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

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

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection
  61. final def zipWithIndex: data.NonEmptyLazyList[(A, Int)]

    Zips each element of this NonEmptyLazyList with its index

    Zips each element of this NonEmptyLazyList with its index

    Definition Classes
    NonEmptyLazyListOps → NonEmptyCollection

Deprecated Value Members

  1. final def collectLazyList[B](pf: PartialFunction[A, B]): Option[B]

    Finds the first element of this NonEmptyLazyList for which the given partial function is defined, and applies the partial function to it.

    Finds the first element of this NonEmptyLazyList for which the given partial function is defined, and applies the partial function to it.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2.0-M1) Use collectFirst

Inherited from NonEmptyCollection[A, LazyList, data.NonEmptyLazyList]

Inherited from AnyVal

Inherited from Any

Ungrouped