"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.right = void 0;
// ets_tracing: off
const E = __importStar(require("../Either"));
const O = __importStar(require("../Option"));
const core_1 = require("./core");
const fail_1 = require("./fail");
const foldM_1 = require("./foldM");
/**
 * Returns a successful effect if the value is `Right`, or fails with the error `None`.
 */
function right(self, __trace) {
    return (0, foldM_1.foldM_)(self, (e) => (0, fail_1.fail)(O.some(e)), E.fold(() => (0, fail_1.fail)(O.none), core_1.succeed), __trace);
}
exports.right = right;
//# sourceMappingURL=right.js.map