I would like to define an array type that allows different types depending on position, but in a repeating, alternating manner as found in some data structures.
Example:
[A, B, A, B, ...]
[A, B, C, A, B, C, ...]
Is this possible?
I know that I can define it for arrays with a fixed number of elements like above (without the ellipsis), and
(A | B)[]
would on the other hand allow any element to be either of type A or B.
I tried these:
[(A, B)...]
[...[A, B]]
[(A, B)*]