[Haskell-cafe] Type-level Programming

Vincenz Syntactically syntactically.vincenz at gmail.com
Fri Jun 22 12:32:39 EDT 2007


Dear all,

Recently I was playing around with encoding matrices in the type-level
system.  Thereby one can enable the multiplication of matrices.  The general
idea (which can be read about at (
http://notvincenz.blogspot.com/2007/06/generalized-matrix-multiplication.html)
is that there is more than one way to multiplly a matrix.

Given two matrices A and B, with M and N dimensions:

a_1*...*a_m and b_1*...*b_n  then whenever the last L dimensions of A match
the first L dimensions of B, they can be multiplied to have a matrix of
dimension:

a_1*..*a_(m-l)*b_(l+1)*...*b_n

What one does is a dot-product on those middle L dimensions.  This is what I
tried to do in the code in the blogpost.  However, I was unable to formulate
the constraints for the final multiplication class that does the actual
proper cross-multiplication.

Is this at all possible, or was I chasing ghosts?

Best regards,
Christophe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070622/abafb58b/attachment.htm


More information about the Haskell-Cafe mailing list