// ets_tracing: off import type * as C from "../core.js" import * as Chain from "./chain.js" import * as Map from "./map.js" /** * 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. */ export function crossWith_( self: C.Stream, that: C.Stream, f: (a: A, a1: A1) => C ): C.Stream { return Chain.chain_(self, (l) => Map.map_(that, (r) => f(l, r))) } /** * 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. * * @ets_data_first crossWith_ */ export function crossWith( that: C.Stream, f: (a: A, a1: A1) => C ) { return (self: C.Stream) => crossWith_(self, that, f) }