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

Complexity. O(n).

Since. 1.0.0-beta

Returns

i16?

Effects

none declared (pure unless the body says otherwise)

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

See also