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

Mojo function

apply_zip

def apply_zip[func: def(IntTuple, IntTuple) thin -> IntTuple](t1: IntTuple, t2: IntTuple) -> IntTuple

Apply a function to pairs of elements from two IntTuples.

This function zips two IntTuples together and applies the given function to each pair of elements, creating a new IntTuple with the results.

Parameters:

  • ​func (def(IntTuple, IntTuple) thin -> IntTuple): Function that takes two IntTuples and returns an IntTuple.

Args:

Returns:

IntTuple: A new IntTuple containing the results of applying func to each pair.

def apply_zip[func: def(IntTuple, IntTuple) capturing thin -> IntTuple](t1: IntTuple, t2: IntTuple) -> IntTuple

Apply a capturing function to pairs of elements from two IntTuples.

This overload allows the function to capture variables from its environment.

Parameters:

  • ​func (def(IntTuple, IntTuple) capturing thin -> IntTuple): Capturing function that takes two IntTuples and returns an IntTuple.

Args:

Returns:

IntTuple: A new IntTuple containing the results of applying func to each pair.

def apply_zip[func: def(IntTuple, IntTuple, IntTuple) thin -> IntTuple](t1: IntTuple, t2: IntTuple, t3: IntTuple) -> IntTuple

Apply a function to triplets of elements from three IntTuples.

This function zips three IntTuples together and applies the given function to each triplet of elements, creating a new IntTuple with the results.

Parameters:

  • ​func (def(IntTuple, IntTuple, IntTuple) thin -> IntTuple): Function that takes three IntTuples and returns an IntTuple.

Args:

Returns:

IntTuple: A new IntTuple containing the results of applying func to each triplet.

def apply_zip[func: def(IntTuple, IntTuple, IntTuple) capturing thin -> IntTuple](t1: IntTuple, t2: IntTuple, t3: IntTuple) -> IntTuple

Apply a capturing function to triplets of elements from three IntTuples.

This overload allows the function to capture variables from its environment.

Parameters:

  • ​func (def(IntTuple, IntTuple, IntTuple) capturing thin -> IntTuple): Capturing function that takes three IntTuples and returns an IntTuple.

Args:

Returns:

IntTuple: A new IntTuple containing the results of applying func to each triplet.

Was this page helpful?