// ets_tracing: off
import * as CK from "../../../../Collections/Immutable/Chunk";
import { pipe } from "../../../../Function";
import * as CH from "../../Channel";
import * as C from "../core";
/**
 * Maps over elements of the stream with the specified effectful function,
 * executing up to `n` invocations of `f` concurrently. Transformed elements
 * will be emitted in the original order.
 *
 * @note This combinator destroys the chunking structure. It's recommended to use rechunk afterwards.
 */

export function mapEffectPar(self, f, n) {
  return new C.Stream(CH.mapOut_(CH.mapOutEffectPar_(CH.concatMap_(self.channel, CH.writeChunk), n, f), CK.single));
}
//# sourceMappingURL=mapEffectPar.js.map