Thanks for the explanation. I understand that inference has its limitations, but I thought my example would be pretty easy for the compiler to infer.
This issue came up as part of a module I’m writing for high-dimensional array manipulation. The problem I ran into is that size and the functions I need to use from TensorOperations use tuples, but to do the dimension mangling I need either (1) a mutable data structure, such as a Vector or MVector, in which case the cost of converting between tuples and vectors becomes significant; or (2) to dissect and reassemble multiple tuples, in which case the cost of constructing tuples becomes significant. This led me to explore how quickly tuples can be constructed and how much inference can help, and then to the example above.
It would be a topic for another thread (such as this one), but I find myself wishing there was such a thing as super fast mutable tuples.