I have code that zips 3 lists, finds a maximum and extracts part of the max tuple. Isn't there a shorter way to do this in F#?let Triplets = List.zip3 A B Clet T1 (x, _, _) = xlet T2 (_, x, _) = xlet T3 (_, _, x) = xlet Best = List.maxBy T3 TripletsT1 Best,T2 Best // return to C# code
Extracting a maximum from zipped lists
f#
One way to simplify this would be to use nested pairs (('a * 'b) * 'c) instead of a triple ('a * 'b * 'c). That way, you can use fst and snd to get to the parts that you want:let triplets = List.zip (List.zip A B) Clet best = List.maxBy snd tripletsfst bestNotice that I also changed the names of variables to lowercase, that is the common naming convention in F#.