Excuse me if this is quite basic, I'm new to functional programming and F#.
I have to create a function that takes a list of tuples (string*int) and return a list of tuples (string *int)
So basically I want to apply some functions to each tuple in pairList and return a list of tuples.
I am guessing I could do this through a recursive function.
I have the following code so far:
let rec aFunction (pairList:List<string*int>): List<string*int> =
match pairList with
| [] -> []
| head :: tail -> [fst head,snd (someFunc1 (someFunc2 (fst head,snd head)))]
This basically just apply the various functions to only the head of the list and return me a list of tuple.
In order to get it working for the whole list I tried the following:
| head :: tail -> [fst head,snd (someFunc1 (someFunc2 (fst head,snd head)));aFunction tail]
But I get the following error :
This expression was expected to have type string * int but here has type List < string * int >