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<i8> = [1, 2, 3, 4]
  let nothing: List<i8> = []
  print("{xs.max()} {nothing.max()}")
}
Output
4 none
pub(api) fn max() -> i8?

Complexity. O(n).

Since. 1.0.0-beta

Returns

i8?

Effects

none declared (pure unless the body says otherwise)

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

See also