OxL Reference

method List.min

The smallest element, or none for an empty list.

Example:

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

Complexity. O(n).

Since. 1.0.0-beta

Returns

u64?

Effects

none declared (pure unless the body says otherwise)

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

See also