// ets_tracing: off import * as T from "../../../../Effect/index.js" import * as E from "../../../../Either/index.js" import type * as C from "../core.js" import * as MapEffect from "./mapEffect.js" /** * Fails with given error 'e' if value is `Left`. */ export function rightOrFail_( self: C.Stream>, e: () => E1 ): C.Stream { return MapEffect.mapEffect_( self, E.fold( () => T.fail(e()), (_) => T.succeed(_) ) ) } /** * Fails with given error 'e' if value is `Left`. * * @ets_data_first rightOrFail_ */ export function rightOrFail(e: () => E1) { return (self: C.Stream>) => rightOrFail_(self, e) }