title: How to sum up a Member on a seq<type>?
body: <p>Could someone help me afloat here? Still new to F#, actually trying to use it for the first time for something serious but got stuck on this nOOb issue.</p>
  
  <p>I have a type Asset</p>
  
  <pre><code>type Asset(line:string) = 
      let fields = line.Split(',') 
      member this.EAD = Double.Parse(fields.[8])
  </code></pre>
  
  <p>Then i expose a csv file as a seq&lt;Asset&gt;:<br>
  'data' here is a seq&lt;string&gt; of the lines in the file</p>
  
  <pre><code>let assets = Seq.map(fun line -&gt; Asset(line)) data
  </code></pre>
  
  <p>Now I want to get the total EAD of these assets, but I get an error </p>
  
  <pre><code>'This value is not a function and cannot be applied'.
  </code></pre>
  
  <p>Here's some of the things I tried:</p>
  
  <pre><code>let totEAD = Seq.sum(a.EAD) assets // first try
  let totEAD = Seq.sum(fun(a)-&gt;a.EAD) assets // pretty sure this is a function..
  
  let getEad(a:Asset) = a.EAD // val getEad : Asset -&gt; float ... is it a val of a function?
  let x = Seq.sum(fun (a) -&gt; getEad(a)) assets // nope...
  </code></pre>
  
  <p>Thanks in advance,</p>
  
  <p>Gert-Jan</p>
  
  <p>update:</p>
  
  <p>This works, but I'm still puzzled why I can't do this in one go, any tips there?</p>
  
  <pre><code>let x = Seq.map(fun (a:Asset) -&gt; a.EAD) assets // first turn it into a seq&lt;float&gt;
  let tot = Seq.sum(x)
  </code></pre>