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

Function transformPull

packages/effect/src/Channel.ts:356–384  ·  view source on GitHub ↗
(
  self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
  f: (
    pull: Pull.Pull<OutElem, OutErr, OutDone>,
    scope: Scope.Scope
  ) => Effect.Effect<Pull.Pull<OutElem2, OutErr2, OutDone2, Env2>, OutErrX, EnvX>
)

Source from the content-addressed store, hash-verified

354 * @since 4.0.0
355 */
356export const transformPull = <
357 OutElem,
358 OutErr,
359 OutDone,
360 InElem,
361 InErr,
362 InDone,
363 Env,
364 OutElem2,
365 OutErr2,
366 OutDone2,
367 Env2,
368 OutErrX,
369 EnvX
370>(
371 self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
372 f: (
373 pull: Pull.Pull<OutElem, OutErr, OutDone>,
374 scope: Scope.Scope
375 ) => Effect.Effect<Pull.Pull<OutElem2, OutErr2, OutDone2, Env2>, OutErrX, EnvX>
376): Channel<
377 OutElem2,
378 Pull.ExcludeDone<OutErr2> | OutErrX,
379 OutDone2,
380 InElem,
381 InErr,
382 InDone,
383 Env | Env2 | EnvX
384> => fromTransform((upstream, scope) => Effect.flatMap(toTransform(self)(upstream, scope), (pull) => f(pull, scope)))
385
386/**
387 * Creates a `Channel` from an `Effect` that produces a `Pull`.

Callers 3

Channel.tsFile · 0.70
flattenArrayFunction · 0.70
drainFunction · 0.70

Calls 3

toTransformFunction · 0.85
fromTransformFunction · 0.70
fFunction · 0.50

Tested by

no test coverage detected