I want to write an algorithm that intersects a 2-dimensional matrix of size k by n + 1 (say) and where each element in the array is a list of elements. These lists vary in size; they can be 1, 2, ..., k long. I can even say that in the first line they will all be length 1, in the second line: length 2, ..., in the k-th line: length k. I assume that Haskell has some kind of mechanism for k-tuples, I just donβt know what it is. Even if the type was indexed by some fixed size, that would be nice - it would mean a slight performance hit, but not so bad.
Any suggestions?
source share