// ets_tracing: off
import * as Tp from "../../../../Collections/Immutable/Tuple";
import * as O from "../../../../Option";
import * as Map from "./map";
import * as ZipWithNext from "./zipWithNext";
import * as ZipWithPrevious from "./zipWithPrevious";
/**
 * Zips each element with both the previous and next element.
 */

export function zipWithPreviousAndNext(self) {
  return Map.map_(ZipWithNext.zipWithNext(ZipWithPrevious.zipWithPrevious(self)), ({
    tuple: [{
      tuple: [prev, curr]
    }, next]
  }) => Tp.tuple(prev, curr, O.map_(next, Tp.get(1))));
}
//# sourceMappingURL=zipWithPreviousAndNext.js.map