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

Function zipWithPrevious

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

Source from the content-addressed store, hash-verified

8687
8688/** @internal */
8689export const zipWithPrevious = <A, E, R>(
8690 self: Stream.Stream<A, E, R>
8691): Stream.Stream<[Option.Option<A>, A], E, R> =>
8692 pipe(
8693 self,
8694 mapAccum<Option.Option<A>, A, [Option.Option<A>, A]>(
8695 Option.none(),
8696 (prev, curr) => [Option.some(curr), [prev, curr]]
8697 )
8698 )
8699
8700/** @internal */
8701export const zipWithPreviousAndNext = <A, E, R>(

Callers 1

zipWithPreviousAndNextFunction · 0.85

Calls 1

pipeFunction · 0.70

Tested by

no test coverage detected