"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.replicateMUnit = exports.replicateMUnit_ = exports.replicate_ = exports.replicate = void 0;
// ets_tracing: off
const Array_1 = require("../Collections/Immutable/Array");
const excl_forEach_1 = require("./excl-forEach");
/**
 * Replicates the given effect `n` times.
 *
 * @ets_data_first replicate_
 */
function replicate(n, __trace) {
    return (self) => replicate_(self, n);
}
exports.replicate = replicate;
/**
 * Replicates the given effect `n` times.
 */
function replicate_(self, n) {
    return (0, Array_1.range)(0, n).map(() => self);
}
exports.replicate_ = replicate_;
/**
 * Performs this effect the specified number of times, discarding the
 * results.
 */
function replicateMUnit_(self, n) {
    return (0, excl_forEach_1.collectAllUnit)(replicate_(self, n));
}
exports.replicateMUnit_ = replicateMUnit_;
/**
 * Performs this effect the specified number of times, discarding the
 * results.
 */
function replicateMUnit(n) {
    return (self) => replicateMUnit_(self, n);
}
exports.replicateMUnit = replicateMUnit;
//# sourceMappingURL=replicate.js.map