import * as tsplus_module_1 from "@tsplus/stdlib/collections/List/empty";
import * as tsplus_module_2 from "@effect/core/io/Cause/definition";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/List/prepend";
import * as tsplus_module_4 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_5 from "@effect/core/io/Cause/operations/foldLeft";
import * as tsplus_module_6 from "@tsplus/stdlib/collections/List/reverse";
/**
 * Extracts a list of non-recoverable errors from the `Cause`.
 *
 * @tsplus getter ets/Cause defects
 */

export function defects(self) {
  return tsplus_module_6.reverse(tsplus_module_5.foldLeft_(self, tsplus_module_1.empty(), (causes, cause) => tsplus_module_2.isDieType(cause) ? tsplus_module_4.some(tsplus_module_3.prepend_(causes, cause.value)) : tsplus_module_4.none));
}
//# sourceMappingURL=defects.mjs.map