MCPcopy Index your code
hub / github.com/Effect-TS/effect / zipWithPrevious

Function zipWithPrevious

packages/effect/src/internal/stream.ts:8651–8660  ·  view source on GitHub ↗
(
  self: Stream.Stream<A, E, R>
)

Source from the content-addressed store, hash-verified

8649
8650/** @internal */
8651export const zipWithPrevious = <A, E, R>(
8652 self: Stream.Stream<A, E, R>
8653): Stream.Stream<[Option.Option<A>, A], E, R> =>
8654 pipe(
8655 self,
8656 mapAccum<Option.Option<A>, A, [Option.Option<A>, A]>(
8657 Option.none(),
8658 (prev, curr) => [Option.some(curr), [prev, curr]]
8659 )
8660 )
8661
8662/** @internal */
8663export const zipWithPreviousAndNext = <A, E, R>(

Callers 1

zipWithPreviousAndNextFunction · 0.85

Calls 1

pipeFunction · 0.70

Tested by

no test coverage detected