This is usually referred to as “unrolling”. You can’t do this in general for vectors in julia because a vector can hold a variable number of items (under some restrictions maybe you can for your use case). It is possible for StaticArrays and Tuples though.
There is https://github.com/cstjean/Unrolled.jl and https://github.com/StephenVavasis/Unroll.jl and maybe other packages as well.
3 Likes