import * as tsplus_module_1 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/flatMap";
export const filterOrElseWith_ = filterOrElseWith_1;

function filterOrElseWith_1(self, f, orElse, __tsplusTrace) {
  return tsplus_module_2.flatMap_(self, a => f(a) ? tsplus_module_1.succeedNow(a, __tsplusTrace) : orElse(a), __tsplusTrace);
}

export function filterOrElseWith(f, orElse, __tsplusTrace) {
  return self => filterOrElseWith_1(self, f, orElse, __tsplusTrace);
}
//# sourceMappingURL=filterOrElseWith.mjs.map