import * as tsplus_module_1 from "@effect/core/stream/Stream/operations/empty";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/getOrElse";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/fromEffect";
import * as tsplus_module_4 from "@effect/core/stream/Stream/operations/flatMap";
/**
 * Returns the resulting stream when the given partial function is defined
 * for the given effectful value, otherwise returns an empty stream.
 *
 * @tsplus static ets/Stream/Ops whenCaseEffect
 */

export function whenCaseEffect(a, pf, __tsplusTrace) {
  return tsplus_module_4.flatMap_(tsplus_module_3.fromEffect(() => a(), __tsplusTrace), a => tsplus_module_2.getOrElse_(pf(a), () => tsplus_module_1.empty), __tsplusTrace);
}
//# sourceMappingURL=whenCaseEffect.mjs.map