OxL Reference

method iter.all

true if every element satisfies p (also for an empty sequence); stops at the first element that does not.

Example:

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

Complexity. O(n) at worst.

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:705

See also