import * as tsplus_module_1 from "@effect/core/stream/Stream/operations/make";
import * as tsplus_module_2 from "@effect/core/stream/Stream/operations/forever";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/interleaveWith";
/**
 * Interleaves this stream and the specified stream deterministically by
 * alternating pulling values from this stream and the specified stream. When
 * one stream is exhausted all remaining values in the other stream will be
 * pulled.
 *
 * @tsplus fluent ets/Stream interleave
 */

export function interleave_(self, that, __tsplusTrace) {
  return tsplus_module_3.interleaveWith_(self, that, () => tsplus_module_2.forever(tsplus_module_1.make(true, false), __tsplusTrace), __tsplusTrace);
}
/**
 * Interleaves this stream and the specified stream deterministically by
 * alternating pulling values from this stream and the specified stream. When
 * one stream is exhausted all remaining values in the other stream will be
 * pulled.
 *
 * @tsplus static ets/Stream/Aspects interleave
 */

export const interleave = (that, __tsplusTrace) => self => interleave_(self, that, __tsplusTrace);
//# sourceMappingURL=interleave.mjs.map