See also https://fsharpforfunandprofit.com/posts/list-module-functions/
// ------------------------------
// add 1 to each item
// ------------------------------
// C#
myList.Select(x => x + 1)
// F#
myList |> List.map (fun x -> x + 1)
// ------------------------------
// run a method/function for each item
// ------------------------------
// C#
myList.Select(x => ProductId.Create(x) )
myList.Select(ProductId.Create) // alternative without lambda
// F#
myList |> List.map (fun x -> ProductId.Create x)
myList |> List.map ProductId.Create // alternative without lambda
// ------------------------------
// wrap each item in a class
// ------------------------------
// C#
myList.Select(x => new ProductId(x) )
// F#
myList |> List.map (fun x -> ProductId x)
myList |> List.map ProductId // alternative without lambda
myList.SelectMany(x => new[]{x,x} )
myList |> List.collect (fun x -> [x])
myList.Where(x => x > 1 )
myList |> List.filter (fun x -> x > 1)
myList.OrderBy(x => x)
myList |> List.sortBy (fun x -> x)
myList.OrderBy(x => x.LastName).ThenBy(x => x.FirstName)
myList |> List.sortBy (fun x -> x.LastName, x.FirstName)
myList.Any(x => x > 1 )
myList |> List.exists (fun x -> x > 1)