import * as tracing_1 from "../../../../Tracing"
import * as tracing_2 from "../../../../Tracing"
const fileName_1 = "(@effect-ts/system): _src/Collections/Immutable/Chunk/api/exists.ts"
import { concreteId } from "../definition"
/**
 * Determines whether a predicate is satisfied for at least one element of this chunk.
 */

export function exists_(self, f) {
  const iterator = self.arrayLikeIterator()
  let next

  while ((next = iterator.next()) && !next.done) {
    const array = next.value
    const len = array.length
    let i = 0

    while (i < len) {
      const a = array[i]

      if (f(a)) {
        return true
      }

      i++
    }
  }

  return false
}
/**
 * Determines whether a predicate is satisfied for at least one element of this chunk.
 *
 * @dataFirst exists_
 */

export function exists(f) {
  return (self) => exists_(self, f)
}
//# sourceMappingURL=exists.js.map
