import * as tsplus_module_1 from "@tsplus/stdlib/structure/Hash";
import * as tsplus_module_2 from "@tsplus/stdlib/structure/Equals";
export const TExit = {
  $: {}
};
/**
 * @tsplus unify ets/TExit
 */

export function unifyTExit(self) {
  return self;
}
export class Fail {
  constructor(value) {
    this.value = value;
    this._tag = "Fail";
  }

  [tsplus_module_1.Hash.sym]() {
    return tsplus_module_1.hashUnknown(this.value);
  }

  [tsplus_module_2.Equals.sym](that) {
    return that instanceof Fail && tsplus_module_2.equals(this.value, that.value);
  }

}
export class Die {
  constructor(value) {
    this.value = value;
    this._tag = "Die";
  }

  [tsplus_module_1.Hash.sym]() {
    return tsplus_module_1.hashUnknown(this.value);
  }

  [tsplus_module_2.Equals.sym](that) {
    return that instanceof Die && tsplus_module_2.equals(this.value, that.value);
  }

}
export class Interrupt {
  constructor(fiberId) {
    this.fiberId = fiberId;
    this._tag = "Interrupt";
  }

  [tsplus_module_1.Hash.sym]() {
    return tsplus_module_1.hashUnknown(this.fiberId);
  }

  [tsplus_module_2.Equals.sym](that) {
    return that instanceof Interrupt && tsplus_module_2.equals(this.fiberId, that.fiberId);
  }

}
export class Succeed {
  constructor(value) {
    this.value = value;
    this._tag = "Succeed";
  }

  [tsplus_module_1.Hash.sym]() {
    return tsplus_module_1.hashUnknown(this.value);
  }

  [tsplus_module_2.Equals.sym](that) {
    return that instanceof Succeed && tsplus_module_2.equals(this.value, that.value);
  }

}

const _retryHash = /*#__PURE__*/tsplus_module_1.hashRandom();

export class Retry {
  constructor() {
    this._tag = "Retry";
  }

  [tsplus_module_1.Hash.sym]() {
    return tsplus_module_1.optimize(_retryHash);
  }

  [tsplus_module_2.Equals.sym](that) {
    return that instanceof Retry;
  }

}
/**
 * @tsplus static ets/TExit/Ops unit
 */

export const unit = /*#__PURE__*/new Succeed(undefined);
/**
 * @tsplus static ets/TExit/Ops succeed
 */

export function succeed(a) {
  return new Succeed(a);
}
/**
 * @tsplus static ets/TExit/Ops fail
 */

export function fail(e) {
  return new Fail(e);
}
/**
 * @tsplus static ets/TExit/Ops die
 */

export function die(e) {
  return new Die(e);
}
/**
 * @tsplus static ets/TExit/Ops interrupt
 */

export function interrupt(fiberId) {
  return new Interrupt(fiberId);
}
/**
 * @tsplus static ets/TExit/Ops retry
 */

export const retry = /*#__PURE__*/new Retry();
//# sourceMappingURL=definition.mjs.map