Implement allPairs on List, Seq and Array modules#989
Implement allPairs on List, Seq and Array modules#989KevinRansom merged 2 commits intodotnet:masterfrom
Conversation
ad5e656 to
0a020aa
Compare
| Check.QuickThrowOnFailure allPairsFst<NormalFloat, NormalFloat> | ||
|
|
||
| let allPairsSnd<'a, 'b when 'b : equality> (xs : 'a list) (ys : 'b list) = | ||
| let pairsFst = List.allPairs xs ys |> List.map snd |
There was a problem hiding this comment.
can you please rename it to pairsSnd
| [<RequireQualifiedAccess>] | ||
| module Array = | ||
|
|
||
| /// <summary>Builds a new array that contains the cartesian product of the two input arrays.</summary> |
There was a problem hiding this comment.
Please use a less technical term than "Cartesian product" in the comment, such as "contains all pairings of elements from the first and second arrays", likewise the other three signature file comments
|
This looks good to me and ready to go apart from the one documentation comment above (which could perhaps be applied later) |
Implement allPairs on List, Seq and Array modules
|
I will take this PR as is. @PatrickMcDonald. |
|
Both https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/lists and https://msdn.microsoft.com/visualfsharpdocs/conceptual/collections.list-module-%5bfsharp%5d are missing documentation for List.allPairs . The former links to the latter "For information about additional operations on lists, see the library reference topic Collections.List Module." |
This is an initial pull request that implements allPairs on the collections.
See fsharp/fslang-design#47 and https://github.com/fsharp/FSharpLangDesign/blob/master/RFCs/FS-1002-cartesian-product-for-collections.md