Stream

chunk_by/2

chunk_by(stream, fun)

Chunks stream by buffering elements for which fun returns the same value.

Elements are only emitted when fun returns a new value or the enumerable finishes.