OxL Reference

method List.max

The largest element, or none for an empty list.

Example:

oxl✓ checked in CI
fn main() io {
  let xs: List<u128> = [1, 2, 3, 4]
  let nothing: List<u128> = []
  print("{xs.max()} {nothing.max()}")
}
Output
4 none
pub(api) fn max() -> u128?

Complexity. O(n).

Since. 1.0.0-beta

Returns

u128?

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/numbers.oxl:5461

See also