I have multiple lists of data from 4 different sources with a common set of IDs that I would like to merge together, based on ID, basically ending up with a new list, one for each ID and a single entry for each source.
The objects in the output list from each of the 4 sources look something like this:
type data = {ID : int; value : decimal;}
so, for example I would have:
let sourceA = [data1, data2, data3];
let sourceB = [data1, data2, data3];
let sourceC = [data1, data2, data3];
let sourceD = [data1, data2, data3];
(I realize this code is not valid, just trying to give a basic idea... the lists are actually pulled and generated from a database)
I would then like to take sourceA, sourceB, sourceC and sourceD and process them into a list containing objects something like this:
type dataByID = {ID : int; valueA : decimal; valueB : decimal; valueC : decimal; valueD : decimal; }
...so that I can then print them out in a CSV, with the first column being the ID and coulmns 2 - 5 being data from sources A - D corresponding to the ID in that row.
I'm totally new to F#, so what would be the best way to process this data so that I match up all the source data values by ID??