// ets_tracing: off
import * as T from "../../../../Effect";
import * as E from "../../../../Either";
import * as MapEffect from "./mapEffect";
/**
 * Fails with given error 'e' if value is `Left`.
 */

export function rightOrFail_(self, e) {
  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) {
  return self => rightOrFail_(self, e);
}
//# sourceMappingURL=rightOrFail.js.map