OxL Reference

method iter.map

A lazy sequence of f(x) for every element x.

Example:

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

Complexity. O(1) to build; `f` is called once per pulled element.

Since. 1.0.0-beta

Parameters

NameType
ffn(T) -> U F escaping

Returns

iter<U> F

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/iter.oxl:123

See also