Mojo function
shallow_apply
shallow_apply[func: fn(IntTuple) -> Int](t: IntTuple) -> IntTuple
Apply a function to each top-level element of an IntTuple.
Unlike apply(), this function only operates on the immediate children
of the input tuple without recursing into nested tuples.
Parameters:
- func (
fn(IntTuple) -> Int): Function that takes anIntTupleand returns anInt. 
Args:
- t (
IntTuple): TheIntTuplewhose elements will be transformed. 
Returns:
IntTuple: A new IntTuple with the function applied to each top-level element.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!