<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><span style="font-size: 20px;" class="">Hi,<br class=""><br class="">As an exercise I want to write a Matrix library.<br class=""><br class="">Multiplication of two matrices is only defined when the the number of columns in the first matrix <br class="">equals the number of rows in the second matrix. i.e. c1 == r2</span><div class=""><span style="font-size: 20px;" class=""><br class=""></span><div class=""><span style="font-size: 20px;" class="">So when writing the multiplication function I can check that  c1 == r2 and do something.</span></div><div class=""><span style="font-size: 20px;" class="">However what I really want to do, if possible, is to have the compiler catch the error. </span></div></div><div class=""><span style="font-size: 20px;" class=""><br class=""></span></div><div class=""><span style="font-size: 20px;" class="">I’d appreciate any advice on how to approach this. I don’t want a full description of exactly what to do as that way I won’t have struggled  or argued with the compiler - which for me is the best way to learn Haskell :)</span></div><div class=""><span style="font-size: 20px;" class=""><br class=""></span></div><div class=""><span style="font-size: 20px;" class=""><br class=""></span></div><div class=""><span style="font-size: 20px;" class="">Thanks</span></div><div class=""><span style="font-size: 20px;" class=""><br class=""></span></div><div class=""><span style="font-size: 20px;" class="">Mike</span></div><div class=""><span style="font-size: 20px;" class=""><br class=""></span></div></body></html>