title: F# function - expected type differs from actual
body: <p>I have been trying to write a curried function "multvec" which uses u=(u1, u2, ..., un) and v=(v1, v2, ..., vn) and outputs u1*v1 + u2*v2 + ... + un*vn. I think I have the logic mostly correct (at least it would be in other languages...) but I keep getting an: </p>
  
  <pre><code>stdin(11,57): error FS0001: This expression was expected to have type
  'a list    
  but here has type
  'c list * 'd list -&gt; 'b list
  </code></pre>
  
  <p>The code is below: The problem is clearly in the call to product in the last line. However, I was under the impression that the base case ( x * y )::[ ] would just product an 'a list, instead of what it actually produces. </p>
  
  <pre><code>let rec multvec xs ys = function
      | [ ], [ ] -&gt; failwith "Both lists cannot be empty"
      | x::[ ], y::[ ] -&gt; ( x * y )::[ ]
      | x::xs, y::ys -&gt; let product = multvec xs ys
                        ( x * y ) + ( List.reduce (+) product )
  </code></pre>
  
  <p>Any clarity on this error would be greatly appreciated! Thank you in advance.  </p>