OxL Reference

method iter.any

true if some element satisfies p; stops at the first one.

Example:

oxl✓ checked in CI
fn main() io {
  print("{[1, 2, 3].iter().any(x => x > 2)} {[1, 2, 3].iter().any(x => x > 5)}")
}
Output
true false
pub(api) move fn any<effect F>(p: fn(T) -> bool F) -> bool  F

Complexity. O(n) at worst; stops at the first match.

Since. 1.0.0-beta

Parameters

NameType
pfn(T) -> bool F

Returns

bool F

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/iter.oxl:687

See also