OxL Reference

method List.count

The number of elements for which p is true.

Example:

oxl✓ checked in CI
fn main() io {
  print("{[1, 2, 3, 4].count(x => x > 1)}")
}
Output
3
pub(api) fn count<effect F>(p: fn(T) -> bool F) -> usize  F

Since. 1.0.0-beta

Parameters

NameType
pfn(T) -> bool F

Returns

usize F

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/collections.oxl:523

See also