import { pipe } from "../../Function";
import * as O from "../../Option";
import * as T from "../_internal/effect";
import * as M from "../_internal/managed";
import { Stream } from "./definitions";
/**
 * Effectfully transforms the chunks emitted by this stream.
 */

export function mapChunksM_(self, f) {
  return new Stream(M.map_(self.proc, e => T.chain_(e, x => T.mapError_(f(x), O.some))));
}
/**
 * Effectfully transforms the chunks emitted by this stream.
 */

export function mapChunksM(f) {
  return self => mapChunksM_(self, f);
}
//# sourceMappingURL=mapChunksM.js.map