import { concreteStream, StreamInternal } from "@effect/core/stream/Stream/operations/_internal/StreamInternal" /** * Composes this stream with the specified stream to create a cartesian * product of elements. 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. * * @tsplus static effect/core/stream/Stream.Aspects cross * @tsplus pipeable effect/core/stream/Stream cross */ export function cross(that: Stream) { return (self: Stream): Stream => { concreteStream(self) return new StreamInternal( self.channel.concatMap((a) => { concreteStream(that) return that.channel.mapOut((b) => a.flatMap((a) => b.map((b) => [a, b]))) }) ) } }