/** * @tsplus static effect/core/stream/Stream.Aspects bind * @tsplus pipeable effect/core/stream/Stream bind */ export function bind( tag: Exclude, f: (_: K) => Stream ) { return (self: Stream): Stream => self.flatMap((k) => f(k).map((a): K & { [k in N]: A } => ({ ...k, [tag]: a } as any))) } /** * @tsplus static effect/core/stream/Stream.Aspects bindValue * @tsplus pipeable effect/core/stream/Streamj bindValue */ export function bindValue( tag: Exclude, f: (_: K) => A ) { return (self: Stream): Stream => self.map((k): K & { [k in N]: A } => ({ ...k, [tag]: f(k) } as any)) } /** * @tsplus static effect/core/stream/Stream.Ops Do */ export function Do(): Stream { return Stream.fromEffect(Effect.succeed({})) }