"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.retry = exports.die = exports.fail = exports.succeed = exports.unit = exports.Retry = exports.RetryTypeId = exports.Succeed = exports.SucceedTypeId = exports.Die = exports.DieTypeId = exports.Fail = exports.FailTypeId = void 0;
// ets_tracing: off
require("../../../Operator");
const St = __importStar(require("../../../Structural"));
exports.FailTypeId = Symbol();
class Fail {
    constructor(value) {
        this.value = value;
        this._typeId = exports.FailTypeId;
    }
    get [St.hashSym]() {
        return St.hash(this.value);
    }
    [St.equalsSym](that) {
        return that instanceof Fail && St.equals(this.value, that.value);
    }
}
exports.Fail = Fail;
exports.DieTypeId = Symbol();
class Die {
    constructor(value) {
        this.value = value;
        this._typeId = exports.DieTypeId;
    }
    get [St.hashSym]() {
        return St.hash(this.value);
    }
    [St.equalsSym](that) {
        return that instanceof Die && St.equals(this.value, that.value);
    }
}
exports.Die = Die;
exports.SucceedTypeId = Symbol();
class Succeed {
    constructor(value) {
        this.value = value;
        this._typeId = exports.SucceedTypeId;
    }
    get [St.hashSym]() {
        return St.hash(this.value);
    }
    [St.equalsSym](that) {
        return that instanceof Succeed && St.equals(this.value, that.value);
    }
}
exports.Succeed = Succeed;
exports.RetryTypeId = Symbol();
const _retryHash = St.randomInt();
class Retry {
    constructor() {
        this._typeId = exports.RetryTypeId;
    }
    get [St.hashSym]() {
        return St.opt(_retryHash);
    }
    [St.equalsSym](that) {
        return that instanceof Retry;
    }
}
exports.Retry = Retry;
exports.unit = new Succeed(undefined);
function succeed(a) {
    return new Succeed(a);
}
exports.succeed = succeed;
function fail(e) {
    return new Fail(e);
}
exports.fail = fail;
function die(e) {
    return new Die(e);
}
exports.die = die;
exports.retry = new Retry();
//# sourceMappingURL=index.js.map