ChunkLike

ChunkLike represents the capability for a Chunk to extend Scala's collection library. Because of changes to Scala's collection library in 2.13, separate versions of this trait are implemented for 2.11 / 2.12 and 2.13 / Dotty. This allows code in Chunk to be written without concern for the implementation details of Scala's collection library to the maximum extent possible.

Note that IndexedSeq is not a referentially transparent interface in that it exposes methods that are partial (e.g. apply), allocate mutable state (e.g. iterator), or are purely side effecting (e.g. foreach). Chunk extends IndexedSeq to provide interoperability with Scala's collection library but users should avoid these methods whenever possible.

Companion:
object
trait IndexedSeq[A]
trait IndexedSeqOps[A, Chunk, Chunk[A]]
trait IndexedSeq[A]
trait IndexedSeqOps[A, Chunk, Chunk[A]]
trait Seq[A]
trait SeqOps[A, Chunk, Chunk[A]]
trait Seq[A]
trait Equals
trait SeqOps[A, Chunk, Chunk[A]]
trait Int => A
trait Iterable[A]
trait Iterable[A]
trait IterableOps[A, Chunk, Chunk[A]]
trait IterableOnce[A]
class Object
trait Matchable
class Any
class Chunk[A]

Value members

Concrete methods

final override def appended[A1 >: A](a1: A1): Chunk[A1]
Definition Classes
override def collect[B](pf: PartialFunction[A, B]): Chunk[B]

Returns a filtered, mapped subset of the elements of this Chunk.

Returns a filtered, mapped subset of the elements of this Chunk.

Definition Classes
final override def flatMap[B](f: A => IterableOnce[B]): Chunk[B]

Returns the concatenation of mapping every element into a new chunk using the specified function.

Returns the concatenation of mapping every element into a new chunk using the specified function.

Definition Classes
final override def map[B](f: A => B): Chunk[B]

Returns a chunk with the elements mapped by the specified function.

Returns a chunk with the elements mapped by the specified function.

Definition Classes
final override def prepended[A1 >: A](a1: A1): Chunk[A1]
final override def zipWithIndex: Chunk[(A, Int)]

Zips this chunk with the index of every element.

Zips this chunk with the index of every element.

Definition Classes

Inherited methods

final def ++[B >: A](suffix: IterableOnce[B]): Chunk[B]
Inherited from:
IterableOps
final override def ++:[B >: A](prefix: IterableOnce[B]): Chunk[B]
Definition Classes
Inherited from:
SeqOps
final def +:[B >: A](elem: B): Chunk[B]
Inherited from:
SeqOps
final def :+[B >: A](elem: B): Chunk[B]
Inherited from:
SeqOps
final def :++[B >: A](suffix: IterableOnce[B]): Chunk[B]
Inherited from:
SeqOps
Inherited from:
IterableOnceOps
Inherited from:
PartialFunction
override def andThen[C](k: A => C): PartialFunction[Int, C]
Definition Classes
Inherited from:
PartialFunction
override def appendedAll[B >: A](suffix: IterableOnce[B]): Chunk[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
@throws(scala.this.throws.$lessinit$greater$default$1[scala.IndexOutOfBoundsException])
def apply(i: Int): A
Inherited from:
SeqOps
def applyOrElse[A1 <: Int, B1 >: A](x: A1, default: A1 => B1): B1
Inherited from:
PartialFunction
override def canEqual(that: Any): Boolean
Definition Classes
Inherited from:
IndexedSeq
def collectFirst[B](pf: PartialFunction[A, B]): Option[B]
Inherited from:
IterableOnceOps
Inherited from:
SeqOps
Inherited from:
PartialFunction
def compose[A](g: A => Int): A => A
Inherited from:
Function1
final override def concat[B >: A](suffix: IterableOnce[B]): Chunk[B]
Definition Classes
Inherited from:
SeqOps
def contains[A1 >: A](elem: A1): Boolean
Inherited from:
SeqOps
def containsSlice[B >: A](that: Seq[B]): Boolean
Inherited from:
SeqOps
def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Int
Inherited from:
IterableOnceOps
@deprecatedOverriding(message = "This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: A](xs: Array[B], start: Int): Int
Inherited from:
IterableOnceOps
@deprecatedOverriding(message = "This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: A](xs: Array[B]): Int
Inherited from:
IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (A, B) => Boolean): Boolean
Inherited from:
IterableOnceOps
def corresponds[B](that: Seq[B])(p: (A, B) => Boolean): Boolean
Inherited from:
SeqOps
def count(p: A => Boolean): Int
Inherited from:
IterableOnceOps
override def diff[B >: A](that: Seq[B]): Chunk[A]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
def distinct: Chunk[A]
Inherited from:
SeqOps
override def distinctBy[B](f: A => B): Chunk[A]
override def drop(n: Int): Chunk[A]
Definition Classes
Inherited from:
IndexedSeqOps
override def dropRight(n: Int): Chunk[A]
def dropWhile(p: A => Boolean): Chunk[A]
Inherited from:
IterableOps
override def empty: Chunk[A]
def endsWith[B >: A](that: Iterable[B]): Boolean
Inherited from:
SeqOps
override def equals(o: Any): Boolean
Definition Classes
Seq -> Equals -> Any
Inherited from:
Seq
def exists(p: A => Boolean): Boolean
Inherited from:
IterableOnceOps
override def filter(pred: A => Boolean): Chunk[A]
override def filterNot(pred: A => Boolean): Chunk[A]
def find(p: A => Boolean): Option[A]
Inherited from:
IterableOnceOps
def findLast(p: A => Boolean): Option[A]
Inherited from:
SeqOps
override def flatten[B](implicit toIterableOnce: A => IterableOnce[B]): Chunk[B]
def fold[A1 >: A](z: A1)(op: (A1, A1) => A1): A1
Inherited from:
IterableOnceOps
def foldLeft[B](z: B)(op: (B, A) => B): B
Inherited from:
IterableOnceOps
override def foldRight[B](z: B)(op: (A, B) => B): B
Definition Classes
Inherited from:
IndexedSeqOps
def forall(p: A => Boolean): Boolean
Inherited from:
IterableOnceOps
def foreach[U](f: A => U): Unit
Inherited from:
IterableOnceOps
protected def fromSpecific(coll: IterableOnce[A]): Chunk[A]
def groupBy[K](f: A => K): Map[K, Chunk[A]]
Inherited from:
IterableOps
def groupMap[K, B](key: A => K)(f: A => B): Map[K, Chunk[B]]
Inherited from:
IterableOps
def groupMapReduce[K, B](key: A => K)(f: A => B)(reduce: (B, B) => B): Map[K, B]
Inherited from:
IterableOps
def grouped(size: Int): Iterator[Chunk[A]]
Inherited from:
IterableOps
override def hashCode(): Int
Definition Classes
Seq -> Any
Inherited from:
Seq
override def head: A
Definition Classes
Inherited from:
IndexedSeqOps
override def headOption: Option[A]
Definition Classes
Inherited from:
IndexedSeqOps
@deprecatedOverriding(message = "Override indexOf(elem, from) instead - indexOf(elem) calls indexOf(elem, 0)", since = "2.13.0")
def indexOf[B >: A](elem: B): Int
Inherited from:
SeqOps
def indexOf[B >: A](elem: B, from: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override indexOfSlice(that, from) instead - indexOfSlice(that) calls indexOfSlice(that, 0)", since = "2.13.0")
def indexOfSlice[B >: A](that: Seq[B]): Int
Inherited from:
SeqOps
def indexOfSlice[B >: A](that: Seq[B], from: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override indexWhere(p, from) instead - indexWhere(p) calls indexWhere(p, 0)", since = "2.13.0")
def indexWhere(p: A => Boolean): Int
Inherited from:
SeqOps
def indexWhere(p: A => Boolean, from: Int): Int
Inherited from:
SeqOps
Inherited from:
SeqOps
def init: Chunk[A]
Inherited from:
IterableOps
Inherited from:
IterableOps
override def intersect[B >: A](that: Seq[B]): Chunk[A]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
Inherited from:
SeqOps
override def isEmpty: Boolean
Definition Classes
Inherited from:
SeqOps
Definition Classes
Inherited from:
IterableOps
Inherited from:
IndexedSeqOps
override def knownSize: Int
Definition Classes
Inherited from:
IndexedSeqOps
override def last: A
Definition Classes
Inherited from:
IndexedSeqOps
def lastIndexOf[B >: A](elem: B, end: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override lastIndexOfSlice(that, end) instead - lastIndexOfSlice(that) calls lastIndexOfSlice(that, Int.MaxValue)", since = "2.13.0")
def lastIndexOfSlice[B >: A](that: Seq[B]): Int
Inherited from:
SeqOps
def lastIndexOfSlice[B >: A](that: Seq[B], end: Int): Int
Inherited from:
SeqOps
@deprecatedOverriding(message = "Override lastIndexWhere(p, end) instead - lastIndexWhere(p) calls lastIndexWhere(p, Int.MaxValue)", since = "2.13.0")
def lastIndexWhere(p: A => Boolean): Int
Inherited from:
SeqOps
def lastIndexWhere(p: A => Boolean, end: Int): Int
Inherited from:
SeqOps
Inherited from:
IterableOps
def lazyZip[B](that: Iterable[B]): LazyZip2[A, B, ChunkLike[A]]
Inherited from:
Iterable
def length: Int
Inherited from:
SeqOps
final override def lengthCompare(that: Iterable[_]): Int
Definition Classes
Inherited from:
IndexedSeqOps
final override def lengthCompare(len: Int): Int
Definition Classes
Inherited from:
IndexedSeqOps
Inherited from:
SeqOps
def lift: Int => Option[A]
Inherited from:
PartialFunction
def max[B >: A](implicit ord: Ordering[B]): A
Inherited from:
IterableOnceOps
def maxBy[B](f: A => B)(implicit cmp: Ordering[B]): A
Inherited from:
IterableOnceOps
def maxByOption[B](f: A => B)(implicit cmp: Ordering[B]): Option[A]
Inherited from:
IterableOnceOps
def maxOption[B >: A](implicit ord: Ordering[B]): Option[A]
Inherited from:
IterableOnceOps
def min[B >: A](implicit ord: Ordering[B]): A
Inherited from:
IterableOnceOps
def minBy[B](f: A => B)(implicit cmp: Ordering[B]): A
Inherited from:
IterableOnceOps
def minByOption[B](f: A => B)(implicit cmp: Ordering[B]): Option[A]
Inherited from:
IterableOnceOps
def minOption[B >: A](implicit ord: Ordering[B]): Option[A]
Inherited from:
IterableOnceOps
final def mkString: String
Inherited from:
IterableOnceOps
final def mkString(sep: String): String
Inherited from:
IterableOnceOps
final def mkString(start: String, sep: String, end: String): String
Inherited from:
IterableOnceOps
protected def newSpecificBuilder: Builder[A, Chunk[A]]
@deprecatedOverriding(message = "nonEmpty is defined as !isEmpty; override isEmpty instead", since = "2.13.0")
Inherited from:
IterableOnceOps
def orElse[A1 <: Int, B1 >: A](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
Inherited from:
PartialFunction
override def padTo[B >: A](len: Int, elem: B): Chunk[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def partition(p: A => Boolean): (Chunk[A], Chunk[A])
override def partitionMap[A1, A2](f: A => Either[A1, A2]): (Chunk[A1], Chunk[A2])
override def patch[B >: A](from: Int, other: IterableOnce[B], replaced: Int): Chunk[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
Inherited from:
SeqOps
override def prependedAll[B >: A](prefix: IterableOnce[B]): Chunk[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
def product[B >: A](implicit num: Numeric[B]): B
Inherited from:
IterableOnceOps
def reduce[B >: A](op: (B, B) => B): B
Inherited from:
IterableOnceOps
def reduceLeft[B >: A](op: (B, A) => B): B
Inherited from:
IterableOnceOps
def reduceLeftOption[B >: A](op: (B, A) => B): Option[B]
Inherited from:
IterableOnceOps
def reduceOption[B >: A](op: (B, B) => B): Option[B]
Inherited from:
IterableOnceOps
def reduceRight[B >: A](op: (A, B) => B): B
Inherited from:
IterableOnceOps
def reduceRightOption[B >: A](op: (A, B) => B): Option[B]
Inherited from:
IterableOnceOps
override def reverse: Chunk[A]
Definition Classes
Inherited from:
IndexedSeqOps
override def reverseIterator: Iterator[A]
Definition Classes
Inherited from:
IndexedSeqOps
override protected def reversed: Iterable[A]
Definition Classes
Inherited from:
IndexedSeqOps
def runWith[U](action: A => U): Int => Boolean
Inherited from:
PartialFunction
override def sameElements[B >: A](o: IterableOnce[B]): Boolean
Definition Classes
Inherited from:
IndexedSeq
Inherited from:
SeqOps
def scan[B >: A](z: B)(op: (B, B) => B): Chunk[B]
Inherited from:
IterableOps
override def scanLeft[B](z: B)(op: (B, A) => B): Chunk[B]
def scanRight[B](z: B)(op: (A, B) => B): Chunk[B]
Inherited from:
IterableOps
override def search[B >: A](elem: B, from: Int, to: Int)(implicit ord: Ordering[B]): SearchResult
Definition Classes
Inherited from:
IndexedSeqOps
override def search[B >: A](elem: B)(implicit ord: Ordering[B]): SearchResult
Definition Classes
Inherited from:
IndexedSeqOps
def segmentLength(p: A => Boolean, from: Int): Int
Inherited from:
SeqOps
final def segmentLength(p: A => Boolean): Int
Inherited from:
SeqOps
final override def size: Int
Definition Classes
Inherited from:
SeqOps
final override def sizeCompare(that: Iterable[_]): Int
Definition Classes
Inherited from:
SeqOps
final override def sizeCompare(otherSize: Int): Int
Definition Classes
Inherited from:
SeqOps
Inherited from:
IterableOps
override def slice(from: Int, until: Int): Chunk[A]
Definition Classes
Inherited from:
IndexedSeqOps
def sliding(size: Int, step: Int): Iterator[Chunk[A]]
Inherited from:
IterableOps
def sliding(size: Int): Iterator[Chunk[A]]
Inherited from:
IterableOps
def sortBy[B](f: A => B)(implicit ord: Ordering[B]): Chunk[A]
Inherited from:
SeqOps
def sortWith(lt: (A, A) => Boolean): Chunk[A]
Inherited from:
SeqOps
override def sorted[B >: A](implicit ord: Ordering[B]): Chunk[A]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def span(p: A => Boolean): (Chunk[A], Chunk[A])
override def splitAt(n: Int): (Chunk[A], Chunk[A])
Definition Classes
Inherited from:
IterableOps
def startsWith[B >: A](that: IterableOnce[B], offset: Int): Boolean
Inherited from:
SeqOps
override def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S & EfficientSplit
Definition Classes
Inherited from:
IndexedSeqOps
def sum[B >: A](implicit num: Numeric[B]): B
Inherited from:
IterableOnceOps
def tail: Chunk[A]
Inherited from:
IterableOps
Inherited from:
IterableOps
override def take(n: Int): Chunk[A]
Definition Classes
Inherited from:
IndexedSeqOps
override def takeRight(n: Int): Chunk[A]
def takeWhile(p: A => Boolean): Chunk[A]
Inherited from:
IterableOps
override def tapEach[U](f: A => U): Chunk[A]
def to[C1](factory: Factory[A, C1]): C1
Inherited from:
IterableOnceOps
def toArray[B >: A : ClassTag]: Array[B]
Inherited from:
IterableOnceOps
final def toBuffer[B >: A]: Buffer[B]
Inherited from:
IterableOnceOps
final override def toIndexedSeq: IndexedSeq[A]
Definition Classes
Inherited from:
IndexedSeq
def toList: List[A]
Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: A <:< (K, V)): Map[K, V]
Inherited from:
IterableOnceOps
final override def toSeq: ChunkLike[A]
Definition Classes
Inherited from:
Seq
def toSet[B >: A]: Set[B]
Inherited from:
IterableOnceOps
override def toString(): String
Definition Classes
Seq -> Function1 -> Iterable -> Any
Inherited from:
Seq
Inherited from:
IterableOnceOps
def transpose[B](implicit asIterable: A => Iterable[B]): Chunk[Chunk[B]]
Inherited from:
IterableOps
def unapply(a: Int): Option[A]
Inherited from:
PartialFunction
override def unzip[A1, A2](implicit asPair: A => (A1, A2)): (Chunk[A1], Chunk[A2])
override def unzip3[A1, A2, A3](implicit asTriple: A => (A1, A2, A3)): (Chunk[A1], Chunk[A2], Chunk[A3])
override def updated[B >: A](index: Int, elem: B): Chunk[B]
Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def view: IndexedSeqView[A]
Definition Classes
Inherited from:
IndexedSeqOps
Inherited from:
IterableOps
override def zip[B](that: IterableOnce[B]): Chunk[(A, B)]
def zipAll[A1 >: A, B](that: Iterable[B], thisElem: A1, thatElem: B): Chunk[(A1, B)]
Inherited from:
IterableOps

Deprecated and Inherited methods

@inline @deprecated(message = "Use foldLeft instead of /:", since = "2.13.0")
final def /:[B](z: B)(op: (B, A) => B): B
Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
@inline @deprecated(message = "Use foldRight instead of :\\", since = "2.13.0")
final def :\[B](z: B)(op: (A, B) => B): B
Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
@deprecated(message = "`aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.", since = "2.13.0")
def aggregate[B](z: => B)(seqop: (B, A) => B, combop: (B, B) => B): B
Deprecated
[Since version 2.13.0] `aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.
Inherited from:
IterableOnceOps
@inline @deprecatedOverriding(message = "Use iterableFactory instead", since = "2.13.0") @deprecated(message = "Use iterableFactory instead", since = "2.13.0")
Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
@inline @deprecated(message = "Use `dest ++= coll` instead", since = "2.13.0")
final def copyToBuffer[B >: A](dest: Buffer[B]): Unit
Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps
@deprecated(message = "Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)", since = "2.13.0")
Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
@inline @deprecated(message = "Use segmentLength instead of prefixLength", since = "2.13.0")
final def prefixLength(p: A => Boolean): Int
Deprecated
[Since version 2.13.0] Use segmentLength instead of prefixLength
Inherited from:
SeqOps
@deprecated(message = "Use coll instead of repr in a collection implementation, use the collection value itself from the outside", since = "2.13.0")
final def repr: Chunk[A]
Deprecated
[Since version 2.13.0] Use coll instead of repr in a collection implementation, use the collection value itself from the outside
Inherited from:
IterableOps
@deprecated(message = "Use .reverseIterator.map(f).to(...) instead of .reverseMap(f)", since = "2.13.0")
def reverseMap[B](f: A => B): Chunk[B]
Deprecated
[Since version 2.13.0] Use .reverseIterator.map(f).to(...) instead of .reverseMap(f)
Inherited from:
SeqOps
@deprecated(message = "Iterable.seq always returns the iterable itself", since = "2.13.0")
def seq: ChunkLike[A]
Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
@deprecated(message = "toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections", since = "2.13.7")
final def toIterable: ChunkLike[A]
Deprecated
[Since version 2.13.7] toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
Iterable
@inline @deprecated(message = "Use .iterator instead of .toIterator", since = "2.13.0")
final def toIterator: Iterator[A]
Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
@inline @deprecated(message = "Use .to(LazyList) instead of .toStream", since = "2.13.0")
final def toStream: Stream[A]
Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps
@deprecated(message = "toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections", since = "2.13.0")
final def toTraversable: Iterable[A]
Deprecated
[Since version 2.13.0] toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
IterableOps
@inline @deprecated(message = "Use `concat` instead", since = "2.13.0")
final def union[B >: A](that: Seq[B]): Chunk[B]
Deprecated
[Since version 2.13.0] Use `concat` instead
Inherited from:
SeqOps
@deprecated(message = "Use .view.slice(from, until) instead of .view(from, until)", since = "2.13.0")
override def view(from: Int, until: Int): IndexedSeqView[A]
Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Definition Classes
Inherited from:
IndexedSeqOps

Concrete fields

Returns a SeqFactory that can construct Chunk values. The SeqFactory exposes a newBuilder method that is not referentially transparent because it allocates mutable state.

Returns a SeqFactory that can construct Chunk values. The SeqFactory exposes a newBuilder method that is not referentially transparent because it allocates mutable state.