{"action":"closed","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/1098","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/1098/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/1098/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/1098/events","html_url":"https://github.com/dotnet/corefx/issues/1098","id":60101475,"number":1098,"title":"Discussion: Add some form of ListExtensions, similar to linq Enumerable extensions","user":{"login":"nvivo","id":202449,"avatar_url":"https://avatars.githubusercontent.com/u/202449?v=3","gravatar_id":"","url":"https://api.github.com/users/nvivo","html_url":"https://github.com/nvivo","followers_url":"https://api.github.com/users/nvivo/followers","following_url":"https://api.github.com/users/nvivo/following{/other_user}","gists_url":"https://api.github.com/users/nvivo/gists{/gist_id}","starred_url":"https://api.github.com/users/nvivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvivo/subscriptions","organizations_url":"https://api.github.com/users/nvivo/orgs","repos_url":"https://api.github.com/users/nvivo/repos","events_url":"https://api.github.com/users/nvivo/events{/privacy}","received_events_url":"https://api.github.com/users/nvivo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"ellismg","id":9602953,"avatar_url":"https://avatars.githubusercontent.com/u/9602953?v=3","gravatar_id":"","url":"https://api.github.com/users/ellismg","html_url":"https://github.com/ellismg","followers_url":"https://api.github.com/users/ellismg/followers","following_url":"https://api.github.com/users/ellismg/following{/other_user}","gists_url":"https://api.github.com/users/ellismg/gists{/gist_id}","starred_url":"https://api.github.com/users/ellismg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellismg/subscriptions","organizations_url":"https://api.github.com/users/ellismg/orgs","repos_url":"https://api.github.com/users/ellismg/repos","events_url":"https://api.github.com/users/ellismg/events{/privacy}","received_events_url":"https://api.github.com/users/ellismg/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-03-06T13:28:14Z","updated_at":"2015-09-30T17:13:39Z","closed_at":"2015-09-30T17:13:39Z","body":"This is a proposal based on to discussions in #461 and #494.\r\n\r\nCurrently, things like Sort, IndexOf, BinarySearch and other methods are implemented as part of the Array and List types twice. It's clear these methods are useful in other places, both .NET types and user implementations. Also, these methods usually operate in place, instead of generating a new list which allows for more optimized code in some situations.\r\n\r\nThere is also a proposal (#461) to add Shuffle method, but we cannot agree on where, because there is not a correct place for it today.\r\n\r\nI'd like to propose a `System.Collections.Generic.ListExtensions` (or some other name) that would be a place to implement these generic extesnions in a similar way that System.Linq.Enumerable does for IEnumerables, but for `IList<T>`.\r\n\r\nIt would contain methods like:\r\n\r\n* Sort\r\n* Shuffle\r\n* IndexOf\r\n* BinarySearch\r\n\r\nThis would then become the default place for any algorithms optimized for in-place operations.\r\n\r\nI agree some of these methods could operate even with `IReadOnlyCollection`, so the real name of the implementation is open for debate. Maybe we need multiple classes for ICollection/IReadOnlyCollection/IList, etc. \r\n\r\nPlease note that this is not a concrete proposal, but things are getting lost in long discussions and I'd like to know from the team if this idea was already discussed internally, and if you want to do add these kind of things, so we could even propose new generic implementations over time in a better way."}}