OxL Reference

fn repeat

Infinite sequence of copies of x.

Example:

oxl✓ checked in CI
fn main() io {
  print("{repeat("ab").take(3).collect()}")
}
Output
["ab", "ab", "ab"]
pub(api) fn repeat<T>(x: T) -> iter<T>

Complexity. O(1) to build; each pull copies `x`.

Since. 1.0.0-beta

Parameters

NameType
xT

Returns

iter<T>

Effects

none declared (pure unless the body says otherwise)

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

See also