Currently, only nominal types can be extended; structural types like tuples and function types cannot be. Is there some fundamental limitation preventing support for structural types? If not, what would be required to add support for structural type extensions?
One example use case is that of using tuples to denote groups of elements which conform to some protocol and where the group has a statically known size. For example, in Swift for TensorFlow, it is often useful to build APIs on top of tensor groups. Such groups can be arrays of tensors, for example, but it would be great if we could also support conforming tuples of tensor groups to the TensorGroup protocol. This limitation results in undesirable structs, such as TensorPair, which have the same semantics as tuples of TensorGroups.