sealed trait Chunk[+A] extends AnyRef
A Chunk[A] represents a chunk of values of type A. Chunks are designed
are usually backed by arrays, but expose a purely functional, safe interface
to the underlying elements, and they become lazy on operations that would be
costly with arrays, such as repeated concatenation.
- Self Type
- Chunk[A]
- Alphabetic
- By Inheritance
- Chunk
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def +[A1 >: A](a: A1): Chunk[A1]
Appends an element to the chunk
- final def ++[A1 >: A](that: Chunk[A1]): Chunk[A1]
Returns the concatenation of this chunk with the specified chunk.
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def collect[B](pf: PartialFunction[A, B]): Chunk[B]
Returns a filtered, mapped subset of the elements of this chunk.
- def collectM[R, E, B](pf: PartialFunction[A, ZIO[R, E, B]]): ZIO[R, E, Chunk[B]]
Returns a filtered, mapped subset of the elements of this chunk based on a .
- def collectWhile[B](pf: PartialFunction[A, B]): Chunk[B]
Transforms all elements of the chunk for as long as the specified partial function is defined.
- def collectWhileM[R, E, B](pf: PartialFunction[A, ZIO[R, E, B]]): ZIO[R, E, Chunk[B]]
- final def drop(n: Int): Chunk[A]
Drops the first
nelements of the chunk. - def dropWhile(f: (A) => Boolean): Chunk[A]
Drops all elements so long as the predicate returns true.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(that: Any): Boolean
- Definition Classes
- Chunk → AnyRef → Any
- def filter(f: (A) => Boolean): Chunk[A]
Returns a filtered subset of this chunk.
- final def filterM[R, E](f: (A) => ZIO[R, E, Boolean]): ZIO[R, E, Chunk[A]]
Filters this chunk by the specified effectful predicate, retaining all elements for which the predicate evaluates to true.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def flatMap[B](f: (A) => Chunk[B]): Chunk[B]
Returns the concatenation of mapping every element into a new chunk using the specified function.
- def flatten[B](implicit ev: <:<[A, Chunk[B]]): Chunk[B]
Flattens a chunk of chunks into a single chunk by concatenating all chunks.
- def fold[S](s0: S)(f: (S, A) => S): S
Folds over the elements in this chunk from the left.
- final def foldM[R, E, S](s: S)(f: (S, A) => ZIO[R, E, S]): ZIO[R, E, S]
Effectfully folds over the elements in this chunk from the left.
- def foldRight[S](s0: S)(f: (A, S) => S): S
Folds over the elements in this chunk from the right.
- final def foldWhile[S](s0: S)(pred: (S) => Boolean)(f: (S, A) => S): S
Folds over the elements in this chunk from the left.
Folds over the elements in this chunk from the left. Stops the fold early when the condition is not fulfilled.
- final def foldWhileM[R, E, S](z: S)(pred: (S) => Boolean)(f: (S, A) => ZIO[R, E, S]): ZIO[R, E, S]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def hashCode(): Int
- Definition Classes
- Chunk → AnyRef → Any
- final def isEmpty: Boolean
Determines if the chunk is empty.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](f: (A) => B): Chunk[B]
Returns a chunk with the elements mapped by the specified function.
- final def mapAccum[S1, B](s1: S1)(f1: (S1, A) => (S1, B)): (S1, Chunk[B])
Statefully maps over the chunk, producing new elements of type
B. - final def mapAccumM[R, E, S1, B](s1: S1)(f1: (S1, A) => ZIO[R, E, (S1, B)]): ZIO[R, E, (S1, Chunk[B])]
Statefully and effectfully maps over the elements of this chunk to produce new elements.
- final def mapM[R, E, B](f: (A) => ZIO[R, E, B]): ZIO[R, E, Chunk[B]]
Effectfully maps the elements of this chunk.
- final def mapM_[R, E](f: (A) => ZIO[R, E, Any]): ZIO[R, E, Unit]
Effectfully maps the elements of this chunk purely for the effects.
- def materialize[A1 >: A]: Chunk[A1]
Materializes a chunk into a chunk backed by an array.
Materializes a chunk into a chunk backed by an array. This method can improve the performance of bulk operations.
- final def mkString: String
Generates a readable string representation of this chunk.
- final def mkString(sep: String): String
Generates a readable string representation of this chunk using the specified separator string.
- final def mkString(start: String, sep: String, end: String): String
Generates a readable string representation of this chunk using the specified start, separator, and end strings.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def nonEmpty: Boolean
Determines if the chunk is not empty.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def size: Int
The number of elements in the chunk.
- final def splitAt(n: Int): (Chunk[A], Chunk[A])
Returns two splits of this chunk at the specified index.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def take(n: Int): Chunk[A]
Takes the first
nelements of the chunk. - def takeWhile(f: (A) => Boolean): Chunk[A]
Takes all elements so long as the predicate returns true.
- def toArray[A1 >: A](implicit tag: ClassTag[A1]): Array[A1]
Converts the chunk into an array.
- def toList: List[A]
- def toSeq: Seq[A]
- def toString(): String
- Definition Classes
- Chunk → AnyRef → Any
- def toVector: Vector[A]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def zipAllWith[B, C](that: Chunk[B])(left: (A) => C, right: (B) => C)(both: (A, B) => C): Chunk[C]
- final def zipWith[B, C](that: Chunk[B])(f: (A, B) => C): Chunk[C]
Zips this chunk with the specified chunk using the specified combiner.
- final def zipWithIndex: Chunk[(A, Int)]
Zips this chunk with the index of every element.
- final def zipWithIndexFrom(indexOffset: Int): Chunk[(A, Int)]
Zips this chunk with the index of every element, starting from the initial index value.
Deprecated Value Members
- final def traverse[R, E, B](f: (A) => ZIO[R, E, B]): ZIO[R, E, Chunk[B]]
Effectfully traverses the elements of this chunk.
Effectfully traverses the elements of this chunk.
- Annotations
- @deprecated
- Deprecated
(Since version 1.0.0) use mapM
- final def traverse_[R, E](f: (A) => ZIO[R, E, Any]): ZIO[R, E, Unit]
Effectfully traverses the elements of this chunk purely for the effects.
Effectfully traverses the elements of this chunk purely for the effects.
- Annotations
- @deprecated
- Deprecated
(Since version 1.0.0) use mapM_