You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The documention about maxBy (Array, List, ...) should state that the first max value is returned. #19129
The code returns the index of the first max value. However, the documentation does not state this fact. I had to look into the implementation (I looked into the implementation of Array).
I can provide a PR, but I want to check first, whether it would have a chance to be accepted - maybe there is no such guarantee of returning the first maximum.
This will be accepted 👍 , thank you for spotting this. maxBy for List/Array/Seq shall have it. The one for Query should not as we do not control the underlying implementations.
Activity
T-Gro commentedon Dec 3, 2025
This will be accepted 👍 , thank you for spotting this.
maxByfor List/Array/Seq shall have it. The one forQueryshould not as we do not control the underlying implementations.https://github.com/search?q=repo%3Adotnet%2Ffsharp+maxBy+path%3A%2F%5Esrc%5C%2FFSharp%5C.Core%5C%2F%2F&type=code
This could be also added as a special case for existing maxBy tests in order to guard that behavior for future regressions (e.g. if anyone would want to change implementation of the functions in the future) - https://github.com/search?q=repo%3Adotnet%2Ffsharp+maxBy+path%3A%2F%5Etests%5C%2FFSharp%5C.Core%5C.UnitTests%5C%2FFSharp%5C.Core%5C%2FMicrosoft%5C.FSharp%5C.Collections%5C%2F%2F&type=code . CollectionsModulesConsistency will allow to write a test to guard the three major collection types via an unified test.
ursenzler commentedon Dec 5, 2025
See PR #19140