[Haskell-beginners] Matrix and types
fa-ml at ariis.it
Thu Mar 14 11:37:20 UTC 2019
On Thu, Mar 14, 2019 at 11:10:06AM +0000, mike h wrote:
> Multiplication of two matrices is only defined when the the number of columns in the first matrix
> equals the number of rows in the second matrix. i.e. c1 == r2
> So when writing the multiplication function I can check that c1 == r2 and do something.
> However what I really want to do, if possible, is to have the compiler catch the error.
Type-level literals  or any kind of similar trickery should help you
with having matrices checked at compile-time.
More information about the Beginners