Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try out some collection traits #107

Closed
reem opened this issue Feb 1, 2015 · 4 comments
Closed

Try out some collection traits #107

reem opened this issue Feb 1, 2015 · 4 comments

Comments

@reem
Copy link
Collaborator

reem commented Feb 1, 2015

No description provided.

@apasel422
Copy link
Contributor

I'm working on some map stuff for this, inspired by @gankro's post Replace Most of the Collections API with ranges and iterators.

@Gankra
Copy link
Owner

Gankra commented Feb 5, 2015

One issue with my proposal of having a Get/Remove/Insert traits is that the semantics for remove and insert are different for Maps and Sequences. Panic vs Option.

@apasel422
Copy link
Contributor

See https://github.com/apasel422/eclectic.

This is very much a work in progress, and there are certain bugs with associated types that are preventing me from organizing this exactly the way I want. I opted to separate mutable functionality into separate traits, though there is an argument to be made for combining them.

I will be adding additional constraints for indexing and iteration (all three modes) in the future.

I also need to figure out a solution to the iterator discrepancy between maps like TreeMap and TrieMap (the former yields (&K, &V), while the latter yields (usize, &V)). I have an idea for how to fix this using a Borrow bound on an associated IterKey type that would default to &K once we have default associated types, but the solution currently involves an extra lifetime parameter on Map that ends up propagating to all four map traits. I'll demonstrate this in another branch.

@apasel422
Copy link
Contributor

rust-lang/rust#20671 is also holding things up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants