import * as tsplus_module_1 from "@tsplus/stdlib/data/Maybe/getOrElse";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/mapError";
/**
 * Unwraps the optional error, defaulting to the provided value.
 *
 * @tsplus fluent ets/Effect flattenErrorMaybe
 */

export function flattenErrorMaybe_(self, def, __tsplusTrace) {
  return tsplus_module_2.mapError_(self, e => tsplus_module_1.getOrElse_(e, def), __tsplusTrace);
}
/**
 * Unwraps the optional error, defaulting to the provided value.
 *
 * @tsplus static ets/Effect/Aspects flattenErrorMaybe
 */

export const flattenErrorMaybe = (def, __tsplusTrace) => self => flattenErrorMaybe_(self, def, __tsplusTrace);
//# sourceMappingURL=flattenErrorMaybe.mjs.map