"use strict"
// tracing: off
Object.defineProperty(exports, "__esModule", { value: true })
exports.parallelErrors = void 0
const Cause_1 = require("../Cause")
const core_1 = require("./core")
const fail_1 = require("./fail")
/**
 * Exposes all parallel errors in a single call
 */
function parallelErrors(self, __trace) {
  return core_1.foldCauseM_(
    self,
    (cause) => {
      const f = Cause_1.failures(cause)
      if (f.length === 0) {
        return core_1.halt(cause)
      } else {
        return fail_1.fail(f)
      }
    },
    core_1.succeed,
    __trace
  )
}
exports.parallelErrors = parallelErrors
//# sourceMappingURL=parallelErrors.js.map
