I'm just learning F#, and while playing at tryfsharp.org I noticed that if I change this code:
[0..100]
|> List.sum
to
["A"; "B"; "D"]
|> List.sum
I get the following error:
The type 'string' does not support the operator 'get_Zero'
(Here's the script that you can run/amend in your browser, though it only seems to work in IE for me!)
When I checked the definition of List.sum; it says that the type must have a static member called Zero. This seems to explain the error; except for the fact that I can't see any member called Zero on int!
So; where is this Zero member that applies to ints? I can't see it in intellisense if I type int.
, nor in the docs, which says int is just a .NET System.Int32 (which doesn't seem to have a static Zero property).
(note: it does say "Operator" and not "Member" in the error; which may be related; though the List.sum definition does just say "member").