EffectTalk

Chunk.fromIterable and basic operations

Chunk is an immutable, high-performance collection used throughout Effect (e.g. Stream.runCollect returns a Chunk). Use Chunk.fromIterable to create from arrays or iterables.

Chunk is optimized for append/prepend and slicing—better than Array for many Effect use cases.

  • Use Chunk.fromIterable(array) to create a Chunk
  • Use Chunk.toArray(chunk) to convert back to array
  • Stream.runCollect returns Chunk<A>
Loading code editor...