import * as tsplus_module_1 from "@tsplus/stdlib/collections/List/empty";
import * as tsplus_module_2 from "@tsplus/stdlib/collections/List/prepend";
import * as tsplus_module_3 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_4 from "@effect/core/io/Cause/operations/foldLeft";
import * as tsplus_module_5 from "@tsplus/stdlib/collections/List/reverse";
import { realCause } from "@effect/core/io/Cause/definition";
/**
 * Grabs a list of execution traces from the cause.
 *
 * @tsplus getter ets/Cause traces
 */

export function traces(self) {
  return tsplus_module_5.reverse(tsplus_module_4.foldLeft_(self, tsplus_module_1.empty(), (acc, curr) => {
    void 0;

    switch (curr._tag) {
      case "Die":
        return tsplus_module_3.some(tsplus_module_2.prepend_(acc, curr.trace));

      case "Fail":
        return tsplus_module_3.some(tsplus_module_2.prepend_(acc, curr.trace));

      case "Interrupt":
        return tsplus_module_3.some(tsplus_module_2.prepend_(acc, curr.trace));

      default:
        return tsplus_module_3.some(acc);
    }
  }));
}
//# sourceMappingURL=traces.mjs.map