/** * Returns the resulting stream when the given partial function is defined * for the given effectful value, otherwise returns an empty stream. * * @tsplus static effect/core/stream/Stream.Ops whenCaseEffect */ export function whenCaseEffect( a: Effect, pf: (a: A) => Maybe> ): Stream { return Stream.fromEffect(a).flatMap((a) => pf(a).getOrElse(Stream.empty)) }