final class NonEmptyLazyListOps[A] extends AnyVal with NonEmptyCollection[A, LazyList, NonEmptyLazyList]
- Alphabetic
- By Inheritance
- NonEmptyLazyListOps
- NonEmptyCollection
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new NonEmptyLazyListOps(value: data.NonEmptyLazyList[A])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def #::[AA >: A](a: AA): data.NonEmptyLazyList[AA]
Alias for prepend.
- final def ++[AA >: A](nell: data.NonEmptyLazyList[AA]): data.NonEmptyLazyList[AA]
Alias for concatNell
- final def ++:[AA >: A](c: data.NonEmptyLazyList[AA]): data.NonEmptyLazyList[AA]
Alias for
prependNell
- final def +:[AA >: A](a: AA): data.NonEmptyLazyList[AA]
Alias for prepend.
- final def :+[AA >: A](a: AA): data.NonEmptyLazyList[AA]
Alias for append.
- final def :++[AA >: A](c: LazyList[AA]): data.NonEmptyLazyList[AA]
Alias for
appendLazyList
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- 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
- final def appendLazyList[AA >: A](nell: LazyList[AA]): data.NonEmptyLazyList[AA]
Appends the given LazyList
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def collect[B](pf: PartialFunction[A, B]): LazyList[B]
Returns a new
LazyList
containing all elements where the result ofpf
is final defined.Returns a new
LazyList
containing all elements where the result ofpf
is final defined.- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- 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.Finds the first element of this
NonEmptyLazyList
for which the given partial function is defined, and applies the partial function to it.- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def concat[AA >: A](ll: LazyList[AA]): data.NonEmptyLazyList[AA]
concatenates this with
ll
- final def concatNell[AA >: A](nell: data.NonEmptyLazyList[AA]): data.NonEmptyLazyList[AA]
Concatenates this with
nell
- final def contains(a: A)(implicit A: Eq[A]): Boolean
Tests if some element is contained in this NonEmptyLazyList
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- final def foldRight[B](z: B)(f: (A, B) => B): B
Right-associative fold using f.
- 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
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def groupBy[B](f: (A) => B)(implicit B: Order[B]): SortedMap[B, data.NonEmptyLazyList[A]]
Groups elements inside this
NonEmptyLazyList
according to theOrder
of the keys produced by the given mapping function.Groups elements inside this
NonEmptyLazyList
according to theOrder
of the keys produced by the given mapping function.scala> import scala.collection.immutable.SortedMap scala> import cats.data.NonEmptyLazyList scala> import cats.syntax.all._ 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
- final def groupByNem[B](f: (A) => B)(implicit B: Order[B]): NonEmptyMap[B, data.NonEmptyLazyList[A]]
Groups elements inside this
NonEmptyLazyList
according to theOrder
of the keys produced by the given mapping function.Groups elements inside this
NonEmptyLazyList
according to theOrder
of the keys produced by the given mapping function.scala> import cats.data.{NonEmptyLazyList, NonEmptyMap} scala> import cats.syntax.all._ 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
- def grouped(size: Int): Iterator[data.NonEmptyLazyList[A]]
Partitions elements in fixed size
NonEmptyLazyList
s.Partitions elements in fixed size
NonEmptyLazyList
s.scala> import cats.data.NonEmptyLazyList scala> import cats.syntax.all._ 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
- final def head: A
Returns the first element
Returns the first element
- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def init: LazyList[A]
Returns all elements but the last
Returns all elements but the last
- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def iterator: Iterator[A]
- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def last: A
Returns the last element
Returns the last element
- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def length: Int
Returns the length of this NonEmptyLazyList
- final def map[B](f: (A) => B): data.NonEmptyLazyList[B]
- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def prepend[AA >: A](a: AA): data.NonEmptyLazyList[AA]
Returns a new NonEmptyLazyList consisting of
a
followed by thisReturns a new NonEmptyLazyList consisting of
a
followed by this- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def prependLazyList[AA >: A](c: LazyList[AA]): data.NonEmptyLazyList[AA]
Prepends the given LazyList
- final def prependNell[AA >: A](c: data.NonEmptyLazyList[AA]): data.NonEmptyLazyList[AA]
Prepends the given NonEmptyLazyList
- 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
- final def reduceLeft(f: (A, A) => A): A
Left-associative reduce using f.
- 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 functiong
. - final def reduceRight[AA >: A](f: (A, AA) => AA): AA
Right-associative reduce using f.
- 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 functiong
. - final def reverse: data.NonEmptyLazyList[A]
Reverses this
NonEmptyLazyList
Reverses this
NonEmptyLazyList
- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def reverseIterator: Iterator[A]
- final def show[AA >: A](implicit AA: Show[AA]): String
- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def size: Int
Returns the size of this NonEmptyLazyList
- final def sortBy[B](f: (A) => B)(implicit B: Order[B]): data.NonEmptyLazyList[A]
Sorts this
NonEmptyLazyList
according to anOrder
on transformedB
fromA
Sorts this
NonEmptyLazyList
according to anOrder
on transformedB
fromA
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
- final def sorted[AA >: A](implicit AA: Order[AA]): data.NonEmptyLazyList[AA]
Sorts this
NonEmptyList
according to anOrder
Sorts this
NonEmptyList
according to anOrder
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
- final def tail: LazyList[A]
Returns all but the first element
Returns all but the first element
- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def toLazyList: LazyList[A]
Converts this NonEmptyLazyList to a
LazyList
- 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.syntax.all._ 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
- 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
- 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
- final def toNonEmptyList: NonEmptyList[A]
Converts this NonEmptyLazyList to a
NonEmptyList
. - final def toNonEmptyVector: NonEmptyVector[A]
Converts this LazyList to a
NonEmptyVector
. - def toString(): String
- Definition Classes
- Any
- final def zipWith[B, C](b: data.NonEmptyLazyList[B])(f: (A, B) => C): data.NonEmptyLazyList[C]
Zips this
NonEmptyLazyList
with anotherNonEmptyLazyList
and applies a function for each pair of elementsZips this
NonEmptyLazyList
with anotherNonEmptyLazyList
and applies a function for each pair of elements- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
- final def zipWithIndex: data.NonEmptyLazyList[(A, Int)]
Zips each element of this
NonEmptyLazyList
with its indexZips each element of this
NonEmptyLazyList
with its index- Definition Classes
- NonEmptyLazyListOps → NonEmptyCollection
Deprecated Value Members
- 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