On Sun, Oct 13, 2019 at 05:42:21PM -0400, David Mertz wrote:
I have definitely hit this difficulty many times. The part of the code that "just puts something in the collection" doesn't need to care conceptually about the kind of collection. Taking the data back out somewhere else more often needs to worry about order, efficiency, concurrency, etc.
And that's why I am skeptical that there is "very common" code that doesn't care about whether it has a list or a set. We surely almost always will care when we're taking the data out again, because of ordering and efficiency etc. If you require a set for the data-output side, why would you accept a list for the data-input side when you won't be able to use it further on? And vice versa. In the absense of any concrete examples demonstrating that this is useful, I think this is an over-generalisation of little practical use. -- Steven