title: F# function takes too many arguments or used in a context not expected
body: <p>I'm trying to implement a cost function and I currently have</p>
  
  <pre><code>let computeCost (X : Matrix&lt;double&gt;) (y : Vector&lt;double&gt;) (theta : Vector&lt;double&gt;) =
      let m = y.Count |&gt; double
      let J = (1.0/(2.0*m))*(((X*theta - y) |&gt; Vector.map (fun x -&gt; x*x)).Sum)
      J
  </code></pre>
  
  <p>For some reason I get an error on the half after the first * saying "This function takes too many arguments, or is used in a context where a function is not expected."</p>
  
  <p>However, when I do this</p>
  
  <pre><code>let computeCost (X : Matrix&lt;double&gt;) (y : Vector&lt;double&gt;) (theta : Vector&lt;double&gt;) =
      let m = y.Count |&gt; double
      let J = (((X*theta - y) |&gt; Vector.map (fun x -&gt; x*x)).Sum)
      J
  </code></pre>
  
  <p>It works perfectly fine and it says that <code>val J:float</code> which is what I expect. But as soon as  add in the second piece which is the <code>(1.0/(2.0*m))</code> part I get the error. I have parenthesis around everything so I don't see how it can be some partial function being applied or something along those lines. I'm sure it's something dumb but I can't seem to figure it out.</p>