import * as tracing_1 from "../../Tracing";
const fileName_1 = "(@effect-ts/system): _src/Testing/TestAnnotation/index.ts";
import * as Chunk from "../../Collections/Immutable/Chunk";
import * as List from "../../Collections/Immutable/List";
import * as E from "../../Either";
import * as St from "../../Structural";
import { Int } from "../Int";
/**
 * A type of annotation.
 */

export class TestAnnotation {
  constructor(identifier, initial, combine) {
    this.identifier = identifier;
    this.initial = initial;
    this.combine = combine;
  }

  get [St.hashSym]() {
    return St.hash(this.identifier);
  }

  [St.equalsSym](that) {
    return that instanceof TestAnnotation && St.equals(this.identifier, that.identifier);
  }

}
export const fibers = /*#__PURE__*/new TestAnnotation("fibers", /*#__PURE__*/E.leftW(0), compose);

function compose(left, right) {
  if (left._tag === "Left" && right._tag === "Left") {
    return E.left(Int(left.left + right.left));
  } else if (left._tag === "Right" && right._tag === "Right") {
    return E.right(Chunk.concat_(left.right, right.right));
  } else if (left._tag === "Right" && right._tag === "Left") {
    return E.left(right.left);
  } else {
    return E.right(right.right);
  }
}

export const location = /*#__PURE__*/new TestAnnotation("location", /*#__PURE__*/List.empty(), List.concat_);
//# sourceMappingURL=index.js.map