Thanks for the feedback! I’m definitely not focusing too hard on names right now, since I consider them less of a substantive issue than the overall categorization. Some methods names are more verbose than I expect they should be right now, to just make everything as clear as possible.
I agree that Container and Collection are really close names, and ambiguous if they were accepted as is. More than happy to change Mutable to MutableCollection, I just assumed you guys had picked that name for a reason and left it as is. UnstructuredContainer’s also fine with me.
Internal iterators… I don’t love adding them. But without them there’s just no way to connect up collections generically. I can axe that stuff, but then we lose a lot of default and generic implementations. The *_all methods can be changed to take Iterators, at least. Should we really wait for HKT/Associated-types/whatever to have the ability to generically link together collections like that? If you guys say so, I’ll leave it, but I think that it’ll suck in the interim.
I hear you on breaking things down into too small parts, but part of the issue is that some operations can only be made available in certain contexts. For instance if I put insert
in the same trait as remove
, then e.g. a Vec
can’t support insert
unless its contents support Eq
, because only a Vec<T:Eq> can possibly support remove
. Forcing someone to support Eq
for something they just want to push/pop with seems pretty awful.
All the Searchable*, Sortable*, and Unstructured* variants have to exist as far as I can tell because of this. I have avoided breaking some of the more concrete types like Deque/Queue/Stack into Mutable/Immutable variants because they’re basically stupid immutably. Are there any traits you think should be tossed?
Edit, Just to be clear: Some of these traits aren’t even necessarily intended to be used generically, they literally can’t be put together without reducing the usefulness of the concrete type due to the way trait constraints are declared.
I am a bit dubious on the Resizable/Mutable split I currently have for Lists, though.
Should I be trying to make unifications/additions more clear? Almost everything is just a unification, though. Sorted* and Stack/Queue/PriorityQueue really just are blatant omissions.