import * as tsplus_module_1 from "@effect/core/stream/Channel/operations/fromEffect";
import * as tsplus_module_2 from "@effect/core/stream/Channel/operations/zipRight";
import * as tsplus_module_3 from "@effect/core/stream/Channel/operations/failCause";
import * as tsplus_module_4 from "@effect/core/stream/Channel/operations/unit";
import * as tsplus_module_5 from "@effect/core/stream/Channel/operations/readWithCause";
import { SinkInternal } from "@effect/core/stream/Sink/operations/_internal/SinkInternal";
/**
 * A sink that executes the provided effectful function for every chunk fed to
 * it.
 *
 * @tsplus static ets/Sink/Ops forEachChunk
 */

export function forEachChunk(f, __tsplusTrace) {
  const process = tsplus_module_5.readWithCause(chunk => tsplus_module_2.zipRight_(tsplus_module_1.fromEffect(() => f(chunk)), () => process), cause => tsplus_module_3.failCause(() => cause), () => tsplus_module_4.unit);
  return new SinkInternal(process);
}
//# sourceMappingURL=forEachChunk.mjs.map