title: F# Matrix Multiplication
body: <p>I'm trying to multiply two matrices.</p>
  
  <p>I'm using transpose taken from this post: <a href="https://stackoverflow.com/questions/3016139/help-me-to-explain-the-f-matrix-transpose-function">Help me to explain the F# Matrix transpose function</a></p>
  
  <pre><code>let rec transpose = function
  | (_::_)::_ as M -&gt; List.map List.head M :: transpose (List.map List.tail M)
  | _ -&gt; []
  </code></pre>
  
  <p>I'm also using innerMult which multiplies every element of a two lists and then adds them.</p>
  
  <pre><code>let rec innerMult u v =
  match u, v with 
  | [x], [y] -&gt; x*y     | u'::u, v'::v -&gt; u'*v' + inner u v 
  </code></pre>
  
  <p>So using these two functions I want will try to multiply rows by columns. Of course I assume both matrices meet the conditions for multiplication to happen. That is, rows must equal columns. </p>
  
  <p>Matrix multiplication code:</p>
  
  <pre><code>let multiply (xs, ys) = 
  let tl = transpose ys in 
      let rec mMult xs = 
      match xs, tl with
      | x::xs, t::tl -&gt; inner x t
    mMult xs;;
  </code></pre>
  
  <blockquote>
    <p>Test: multiply ([[1;2;3];[4;5;6]], [[0;1];[3;2];[1;2]]);; Output: >
    val it : int = 9</p>
  </blockquote>
  
  <p>At the moment it is missing recursion or List.map so that it actually does the matrix multiplication. I just don't see how to solve this. </p>