▲ | cosmic_quanta 10 months ago | |
That's a great question. Haskell has arrays and matrices of homogeneous types, so it wouldn't work by default. If you needed this kind of functionality, you would have to create your own Matrix type which would look very similar to a 9-tuple, and then define matrix multiplication. It would then be possible to encode the dimensional constraints in the type signature, but it's already quite involved for 2x2 matrices:
I can't imagine for 3x3. |