import * as tsplus_module_1 from "@effect/core/io/Effect/operations/fail";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_3 from "@tsplus/stdlib/data/Maybe/fold";
import * as tsplus_module_4 from "@effect/core/stream/Stream/operations/mapEffect";
/**
 * Extracts the optional value, or fails with the given error 'e'.
 *
 * @tsplus fluent ets/Stream someOrFail
 */

export function someOrFail_(self, e, __tsplusTrace) {
  return tsplus_module_4.mapEffect_(self, option => tsplus_module_3.fold_(option, () => tsplus_module_1.fail(e, __tsplusTrace), tsplus_module_2.succeedNow), __tsplusTrace);
}
/**
 * Extracts the optional value, or fails with the given error 'e'.
 *
 * @tsplus static ets/Stream/Aspects someOrFail
 */

export const someOrFail = (e, __tsplusTrace) => self => someOrFail_(self, e, __tsplusTrace);
//# sourceMappingURL=someOrFail.mjs.map