Julia's Extended Tuple Interface
The following ArrayInterface functions extend Julia's tuple interface.
ArrayInterface.flatten_tuples — FunctionArrayInterface.flatten_tuples(t::Tuple) -> TupleFlattens any field of t that is a tuple. Only direct fields of t may be flattened.
Examples
julia> ArrayInterface.flatten_tuples((1, ()))
(1,)
julia> ArrayInterface.flatten_tuples((1, (2, 3)))
(1, 2, 3)
julia> ArrayInterface.flatten_tuples((1, (2, (3,))))
(1, 2, (3,))
ArrayInterface.map_tuple_type — FunctionArrayInterface.map_tuple_type(f, T::Type{<:Tuple})Returns tuple where each field corresponds to the field type of T modified by the function f.
Examples
julia> ArrayInterface.map_tuple_type(sqrt, Tuple{1,4,16})
(1.0, 2.0, 4.0)