As an alternative to storage
A = (a, a, a) B = (b, b, b)
and observing the same length, you can try:
AB = ([a,b], [a,b], [a,b])
Thus, the restriction that you need to ensure will be that each element from AB has a length of two and consists of types A and B - this should be possible in the usual scheme.
source share