EffectTalk

Chunk vs Array in Effect pipelines

When to use Chunk: Stream results, Effect pipelines with collections, anywhere you need immutable collections that integrate with Effect.

Arrays work too, but Chunk is the idiomatic choice in Effect.

  • Use `Chunk.map(chunk, fn)` for transformation
  • Use `Chunk.reduce(chunk, init, fn)` for folding
  • Chunk integrates with Effect and Stream
Loading code editor...