/**
* Return a chunk of length `n` with element `i` initialized with `f(i)`.
*
* @tsplus static Chunk.Ops makeBy
*/
export function makeBy(n: number, f: (i: number) => A): Chunk {
const b = Chunk.builder()
for (let i = 0; i < n; i++) {
b.append(f(i))
}
return b.build()
}