OxL Reference

method List.map

A new list with f applied to every element.

Example:

oxl✓ checked in CI
fn main() io {
  print("{[1, 2, 3].map(x => x * x)}")
}
Output
[1, 4, 9]
pub(api) fn map<U, effect F>(f: fn(T) -> U F) -> List<U>  F

Since. 1.0.0-beta

Parameters

NameType
ffn(T) -> U F

Returns

List<U> F

Effects

none declared (pure unless the body says otherwise)

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

See also