Reputation: 319
The goal is to make from for example from [(1,2),(3,4),(5,6)] this array [|1,2,3,4,5,6|]. Msdn gives a simple example of Array.collect's usage. I tried to do the same with
x |> Array.collect (fun (a,b) -> [|a,b|])
but it still returns (a,b)[]. Thanks for the help in advance.
Upvotes: 0
Views: 592
Reputation: 4280
Your lambda creates array of one tuple [|a,b|]
You need array of two elements: (fun (a,b) -> [|a; b|])
Elements in collections are divided by ;
Upvotes: 8