// tracing: off
import * as E from "../../Either"
import * as O from "../../Option"
import { collectWhileMap_ } from "./collectWhileMap"
/**
 * Terminates the stream when encountering the first `Left`.
 */

export function collectWhileRight(self) {
  return collectWhileMap_(
    self,
    E.fold(
      (_) => O.none,
      (a) => O.some(a)
    )
  )
}
//# sourceMappingURL=collectWhileRight.js.map
