"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.repeatN_ = exports.repeatN = void 0;
// ets_tracing: off
const core_1 = require("./core");
/**
 * Repeats this effect the specified number of times.
 *
 * @ets_data_first repeatN_
 */
function repeatN(n, __trace) {
    return (self) => repeatN_(self, n, __trace);
}
exports.repeatN = repeatN;
/**
 * Repeats this effect the specified number of times.
 */
function repeatN_(self, n, __trace) {
    return (0, core_1.chain_)(self, (a) => (n <= 0 ? (0, core_1.succeed)(a) : repeatN_(self, n - 1)), __trace);
}
exports.repeatN_ = repeatN_;
//# sourceMappingURL=repeatN.js.map