The immediate problem you are working with is that split is an array of strings. To access an element of this array, the syntax is split.[x] , not split[x] (which would apply split to a single list [x] , considering it a function).
Here are some more questions:
- Your
list definition is probably incorrect: x has a length up to the script , not the length of the split array. If you want to convert an array or other sequence to a list, you can simply use List.ofSeq or Seq.toList instead of explicitly understanding the list [...] . - Your "throws" for the two are a little strange - this is not the correct syntax for performing conversions in F #, although in this case it will work.
double is a function, so brackets are not needed, and what you do really calls double 0 and double y . You should simply use 0.0 for the first case, and in the second it is not clear what you are converting from.
In general, it would probably be better to do a little more design to decide what your overall strategy will be, since it is not clear to me that you can combine a working parser based on your current approach. There are several well-known methods for writing a parser - are you trying to use a specific approach?
source share