zio.blocks.chunk

Members list

Type members

Classlikes

case object BuildInfo

This object was generated by sbt-buildinfo.

This object was generated by sbt-buildinfo.

Attributes

Source
BuildInfo.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
BuildInfo.type
sealed abstract class Chunk[+A] extends IndexedSeq[A], IndexedSeqOps[A, Chunk, Chunk[A]], StrictOptimizedSeqOps[A, Chunk, Chunk[A]], IterableFactoryDefaults[A, Chunk], Serializable

A Chunk[A] represents a chunk of values of type A. Chunks 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.

A Chunk[A] represents a chunk of values of type A. Chunks 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.

The implementation of balanced concatenation is based on the one for Conc-Trees in "Conc-Trees for Functional and Parallel Programming" by Aleksandar Prokopec and Martin Odersky. http://aleksandar-prokopec.com/resources/docs/lcpc-conc-trees.pdf

NOTE: For performance reasons, Chunk does not box primitive types. As a result, it is not safe to construct chunks from heterogeneous primitive types.

Attributes

Companion
object
Source
Chunk.scala
Supertypes
trait Serializable
trait StrictOptimizedSeqOps[A, Chunk, Chunk[A]]
trait StrictOptimizedSeqOps[A, Chunk, Chunk[A]]
trait StrictOptimizedIterableOps[A, Chunk, Chunk[A]]
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 Pure
trait Equals
trait SeqOps[A, Chunk, Chunk[A]]
trait PartialFunction[Int, A]
trait Int => A
trait Iterable[A]
trait Iterable[A]
trait IterableFactoryDefaults[A, Chunk]
trait IterableOps[A, Chunk, Chunk[A]]
trait IterableOnceOps[A, Chunk, Chunk[A]]
trait IterableOnce[A]
class Object
trait Matchable
class Any
Show all
Self type
Chunk[A]
object Chunk

Attributes

Companion
class
Source
Chunk.scala
Supertypes
trait StrictOptimizedSeqFactory[Chunk]
trait SeqFactory[Chunk]
trait IterableFactory[Chunk]
trait Pure
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
Chunk.type
object ChunkBuilder

Attributes

Companion
class
Source
Chunk.scala
Supertypes
class Object
trait Matchable
class Any
Self type
sealed abstract class ChunkBuilder[A] extends Builder[A, Chunk[A]]

A ChunkBuilder[A] can build a Chunk[A] given elements of type A. ChunkBuilder is a mutable data structure that is implemented to efficiently build chunks of unboxed primitives and for compatibility with the Scala collection library.

A ChunkBuilder[A] can build a Chunk[A] given elements of type A. ChunkBuilder is a mutable data structure that is implemented to efficiently build chunks of unboxed primitives and for compatibility with the Scala collection library.

Attributes

Companion
object
Source
Chunk.scala
Supertypes
trait Builder[A, Chunk[A]]
trait Growable[A]
trait Clearable
class Object
trait Matchable
class Any
Show all
Known subtypes
class Boolean
class Byte
class Char
class Double
class Float
class Int
class Long
class Short
Show all
final class ChunkMap[K, +V] extends AbstractMap[K, V], MapOps[K, V, ChunkMap, ChunkMap[K, V]], StrictOptimizedMapOps[K, V, ChunkMap, ChunkMap[K, V]], Serializable

An order-preserving immutable map backed by Chunk. Keys and values are stored in parallel Chunks, maintaining insertion order.

An order-preserving immutable map backed by Chunk. Keys and values are stored in parallel Chunks, maintaining insertion order.

This map is optimized for small collections where ordering matters. For larger collections requiring frequent lookups, consider using indexed to create an optimized version with O(1) key lookup (at the cost of additional memory).

Key characteristics:

  • Preserves insertion order during iteration
  • O(n) key lookup by default
  • O(1) indexed access by position
  • Equality is order-independent (like standard Map)

Type parameters

K

The key type

V

The value type

Attributes

Companion
object
Source
ChunkMap.scala
Supertypes
trait Serializable
trait StrictOptimizedMapOps[K, V, ChunkMap, ChunkMap[K, V]]
trait StrictOptimizedMapOps[K, V, ChunkMap, ChunkMap[K, V]]
trait StrictOptimizedIterableOps[(K, V), Iterable, ChunkMap[K, V]]
class AbstractMap[K, V]
trait Map[K, V]
trait MapOps[K, V, ChunkMap, ChunkMap[K, V]]
trait Iterable[(K, V)]
class AbstractMap[K, V]
trait Map[K, V]
trait Pure
trait Equals
trait MapFactoryDefaults[K, V, Map, Iterable]
trait MapOps[K, V, ChunkMap, ChunkMap[K, V]]
trait PartialFunction[K, V]
trait K => V
class AbstractIterable[(K, V)]
trait Iterable[(K, V)]
trait IterableFactoryDefaults[(K, V), Iterable]
trait IterableOps[(K, V), Iterable, ChunkMap[K, V]]
trait IterableOnceOps[(K, V), Iterable, ChunkMap[K, V]]
trait IterableOnce[(K, V)]
class Object
trait Matchable
class Any
Show all
Self type
ChunkMap[K, V]
object ChunkMap extends MapFactory[ChunkMap]

Attributes

Companion
class
Source
ChunkMap.scala
Supertypes
trait MapFactory[ChunkMap]
trait Serializable
class Object
trait Matchable
class Any
Self type
ChunkMap.type
object NonEmptyChunk

Attributes

Companion
class
Source
Chunk.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class NonEmptyChunk[+A] extends Serializable

A NonEmptyChunk is a Chunk that is guaranteed to contain at least one element. As a result, operations which would not be safe when performed on Chunk, such as head or reduce, are safe when performed on NonEmptyChunk. Operations on NonEmptyChunk which could potentially return an empty chunk will return a Chunk instead.

A NonEmptyChunk is a Chunk that is guaranteed to contain at least one element. As a result, operations which would not be safe when performed on Chunk, such as head or reduce, are safe when performed on NonEmptyChunk. Operations on NonEmptyChunk which could potentially return an empty chunk will return a Chunk instead.

Attributes

Companion
object
Source
Chunk.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type