method List.map
A new list with f applied to every element.
Example:
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> FSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
f | fn(T) -> U F |
Returns
List<U> F
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:445