// ets_tracing: off import * as Tp from "../../../../Collections/Immutable/Tuple/index.js" import * as O from "../../../../Option/index.js" import type * as C from "../core.js" import * as Map from "./map.js" import * as ZipWithNext from "./zipWithNext.js" import * as ZipWithPrevious from "./zipWithPrevious.js" /** * Zips each element with both the previous and next element. */ export function zipWithPreviousAndNext( self: C.Stream ): C.Stream, A, O.Option]>> { return Map.map_( ZipWithNext.zipWithNext(ZipWithPrevious.zipWithPrevious(self)), ({ tuple: [ { tuple: [prev, curr] }, next ] }) => Tp.tuple(prev, curr, O.map_(next, Tp.get(1))) ) }