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

Function transformPull

packages/effect/src/Channel.ts:327–355  ·  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

325 * @since 4.0.0
326 */
327export const transformPull = <
328 OutElem,
329 OutErr,
330 OutDone,
331 InElem,
332 InErr,
333 InDone,
334 Env,
335 OutElem2,
336 OutErr2,
337 OutDone2,
338 Env2,
339 OutErrX,
340 EnvX
341>(
342 self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
343 f: (
344 pull: Pull.Pull<OutElem, OutErr, OutDone>,
345 scope: Scope.Scope
346 ) => Effect.Effect<Pull.Pull<OutElem2, OutErr2, OutDone2, Env2>, OutErrX, EnvX>
347): Channel<
348 OutElem2,
349 Pull.ExcludeDone<OutErr2> | OutErrX,
350 OutDone2,
351 InElem,
352 InErr,
353 InDone,
354 Env | Env2 | EnvX
355> => fromTransform((upstream, scope) => Effect.flatMap(toTransform(self)(upstream, scope), (pull) => f(pull, scope)))
356
357/**
358 * 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