import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/definition";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/collectWhile";
/**
 * Terminates the stream when encountering the first `Left`.
 *
 * @tsplus fluent ets/Stream collectWhileRight
 */

export function collectWhileRight(self, __tsplusTrace) {
  return tsplus_module_3.collectWhile_(self, either => tsplus_module_1.isRight(either) ? tsplus_module_2.some(either.right) : tsplus_module_2.none, __tsplusTrace);
}
//# sourceMappingURL=collectWhileRight.mjs.map