IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

chain

chain[*Ts: Iterable](*iterables: *Ts.values, out res: _ChainedIterator[*#kgen.param_list.tabulate(TypeList[Ts.values], [idx: __mlir_type.index] Ts.values[idx].IteratorType[False, iterables.origin._mlir_origin, iterables.origin])]) where TypeList.all_satisfies[comptime[Type: Iterable] _type_is_eq_parse_time[Type.IteratorType[False, iterables.origin._mlir_origin, iterables.origin].Element, Ts.values[0].IteratorType[False, iterables.origin._mlir_origin, iterables.origin].Element]()]()

Chain multiple iterables that return the same type.

Parameters:

  • *Ts (Iterable): The iterator types.

Args:

  • *iterables (*Ts.values): The iterables.

Returns:

_ChainedIterator[*#kgen.param_list.tabulate(TypeList[Ts.values], [idx: __mlir_type.index] Ts.values[idx].IteratorType[False, iterables.origin._mlir_origin, iterables.origin])]: The chained iterator.

chain[*Ts: IterableOwned](var *iterables: *Ts.values, out res: _ChainedIterator[*#kgen.param_list.tabulate(TypeList[Ts.values], [idx: __mlir_type.index] Ts.values[idx].IteratorOwnedType)]) where TypeList.all_satisfies[comptime[Type: IterableOwned] _type_is_eq_parse_time[Type.IteratorOwnedType.Element, Ts.values[0].IteratorOwnedType.Element]()]()

Chain multiple iterables that return the same type.

Parameters:

Args:

  • *iterables (*Ts.values): The iterables.

Returns:

_ChainedIterator[*#kgen.param_list.tabulate(TypeList[Ts.values], [idx: __mlir_type.index] Ts.values[idx].IteratorOwnedType)]: The chained iterator.