I have a 2d array of floats:
let scores = Array2D.init<float> width height (fun _ _ -> 0.)
and I would like to convert it to a list of lists where I have a list of rows and each of these row is a list of column values.
for example:
[
1, 2, 3
4, 5, 6
7, 8, 9
]
would become:
[
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
]
I found this question: F# convert Array2 into a list
but it converts the 2d array into a list, I'm trying to find how to convert it to a list of list. I could iterate through the elements and build the list, but I'm sure there has to be a better way.