"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
exports.crossWith = exports.crossWith_ = void 0
// tracing: off
const chain_1 = require("./chain")
const map_1 = require("./map")
/**
 * Composes this stream with the specified stream to create a cartesian product of elements
 * with a specified function.
 * The `that` stream would be run multiple times, for every element in the `this` stream.
 *
 * See also `Stream#zip` for the more common point-wise variant.
 */
function crossWith_(self, that, f) {
  return (0, chain_1.chain_)(self, (l) => (0, map_1.map_)(that, (r) => f(l, r)))
}
exports.crossWith_ = crossWith_
/**
 * Composes this stream with the specified stream to create a cartesian product of elements
 * with a specified function.
 * The `that` stream would be run multiple times, for every element in the `this` stream.
 *
 * See also `Stream#zip` for the more common point-wise variant.
 *
 * @dataFirst crossWith_
 */
function crossWith(that, f) {
  return (self) => crossWith_(self, that, f)
}
exports.crossWith = crossWith
//# sourceMappingURL=crossWith.js.map
