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

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