Any at UnitRange seems unoptimal

Thank you!
PartialStruct is understandable for me I think. For me it some kind of “abstract” set that hold infromation for the compiler, that could do some optimization based on the hardcoded values in special cases.

For me, my tactic is like:

  • I use Tuples in cases like where I know there will be 2-3-4 element on that position that type would be nice to be compile time optimised in the function I call.
  • I use Arrays where they are homogeneous elements.
  • In case of heterogeneous sets I think I use Arrays sometime but I try to always split them into multiple arrays if it isn’t too too big effort.

By the way

Isn’t @nospecialize would be good for that, so even with Tuple we wouldn’t do any recompilation?