Take the following example:
I have a class
public class SomeItem
{
public string Name;
public DateTime Published;
public uint16 Size;
}
I have List<SomeItem>one and I want to calculate the total size of all the elements.
In C # I will just write
var totalSize = items.Sum((i) => i.Size);
I looked at the List functions in F #, but they always complain about types.
How do you write this in F #?
(I tried search engines, but search engine support for F # is terrible)
source
share