Is List.collect the equivalent of LINQ List.SelectMany?
[1;2;3;4] |> List.collect (fun x -> [x * x])
in LINQ
new List<int>() { 1, 2, 3, 4 }
.SelectMany(x => new List<int>() { x * x });
Edited by:
A more suitable example
let list1 = [1;2;3;4]
let list2 = [2;4;6]
list1 |> List.collect (fun a -> list2 |> List.map (fun b -> a * b))
...
var list1 = new List<int>() { 1, 2, 3, 4 };
var list2 = new List<int>() { 2, 4, 6 }
list1.SelectMany(a => list2.Select(b => a * b));
source
share