const fileName_1 = "(@effect/core) _src/stream/SortedByKey/operations/zipAllSortedByKey.ts";
import * as tsplus_module_1 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_2 from "@effect/core/stream/SortedByKey/operations/zipAllSortedByKeyWith";
/**
 * Zips this stream that is sorted by distinct keys and the specified stream
 * that is sorted by distinct keys to produce a new stream that is sorted by
 * distinct keys. Combines values associated with each key into a tuple,
 * using the specified values `defaultLeft` and `defaultRight` to fill in
 * missing values.
 *
 * This allows zipping potentially unbounded streams of data by key in
 * constant space but the caller is responsible for ensuring that the
 * streams are sorted by distinct keys.
 *
 * @tsplus fluent ets/SortedByKey zipAllSortedByKey
 * @tsplus fluent ets/Stream zipAllSortedByKey
 */

export function zipAllSortedByKey_(self, ord) {
  return (that, defaultLeft, defaultRight, __tsplusTrace) => tsplus_module_2.zipAllSortedByKeyWith_(self, ord)(that, a => tsplus_module_1.make(a, defaultRight()), b => tsplus_module_1.make(defaultLeft(), b), (a, b) => tsplus_module_1.make(a, b), fileName_1 + ":25:36");
}
/**
 * Zips this stream that is sorted by distinct keys and the specified stream
 * that is sorted by distinct keys to produce a new stream that is sorted by
 * distinct keys. Combines values associated with each key into a tuple,
 * using the specified values `defaultLeft` and `defaultRight` to fill in
 * missing values.
 *
 * This allows zipping potentially unbounded streams of data by key in
 * constant space but the caller is responsible for ensuring that the
 * streams are sorted by distinct keys.
 *
 * @tsplus static ets/SortedByKey/Aspects zipAllSortedByKey
 */

export const zipAllSortedByKey = ord => self => zipAllSortedByKey_(self, ord);
//# sourceMappingURL=zipAllSortedByKey.mjs.map