MCPcopy Create free account
hub / github.com/Effect-TS/effect / transformPull

Function transformPull

packages/effect/src/Stream.ts:576–588  ·  view source on GitHub ↗
(
  self: Stream<A, E, R>,
  f: (pull: Pull.Pull<Arr.NonEmptyReadonlyArray<A>, E, void>, scope: Scope.Scope) => Effect.Effect<
    Pull.Pull<Arr.NonEmptyReadonlyArray<B>, E2, void, R2>,
    EX,
    RX
  >
)

Source from the content-addressed store, hash-verified

574 * @since 4.0.0
575 */
576export const transformPull = <A, E, R, B, E2, R2, EX, RX>(
577 self: Stream<A, E, R>,
578 f: (pull: Pull.Pull<Arr.NonEmptyReadonlyArray<A>, E, void>, scope: Scope.Scope) => Effect.Effect<
579 Pull.Pull<Arr.NonEmptyReadonlyArray<B>, E2, void, R2>,
580 EX,
581 RX
582 >
583): Stream<B, EX | Pull.ExcludeDone<E2>, R | R2 | RX> =>
584 fromChannel(
585 Channel.fromTransform((_, scope) =>
586 Effect.flatMap(Channel.toPullScoped(self.channel, scope), (pull) => f(pull as any, scope))
587 )
588 )
589
590/**
591 * Transforms a stream by effectfully transforming its pull effect.

Callers 1

Stream.tsFile · 0.70

Calls 2

fromChannelFunction · 0.70
fFunction · 0.50

Tested by

no test coverage detected