import * as tsplus_module_1 from "@tsplus/stdlib/collections/Chunk/size";
import * as tsplus_module_2 from "@effect/core/stream/Channel/operations/unit";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/Chunk/unsafeGet";
import * as tsplus_module_4 from "@effect/core/stream/Channel/operations/write";
import * as tsplus_module_5 from "@effect/core/stream/Channel/operations/zipRight";
/**
 * @tsplus static ets/Channel/Ops writeChunk
 */

export function writeChunk(outs) {
  return writer(0, tsplus_module_1.size(outs), outs);
}

function writer(idx, len, chunk) {
  return idx === len ? tsplus_module_2.unit : tsplus_module_5.zipRight_(tsplus_module_4.write(() => tsplus_module_3.unsafeGet_(chunk, idx)), () => writer(idx + 1, len, chunk));
}
//# sourceMappingURL=writeChunk.mjs.map