import * as tsplus_module_1 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/mapAccum";
/**
 * Zips each element with the previous element. Initially accompanied by
 * `None`.
 *
 * @tsplus fluent ets/Stream zipWithPrevious
 */

export function zipWithPrevious(self, __tsplusTrace) {
  return tsplus_module_3.mapAccum_(self, () => tsplus_module_1.emptyOf(), (prev, next) => tsplus_module_2.make(tsplus_module_1.some(next), tsplus_module_2.make(prev, next)), __tsplusTrace);
}
//# sourceMappingURL=zipWithPrevious.mjs.map