Comments (4)
I'm working on some map stuff for this, inspired by @gankro's post Replace Most of the Collections API with ranges and iterators.
from collect-rs.
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.
from collect-rs.
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.
from collect-rs.
rust-lang/rust#20671 is also holding things up.
from collect-rs.
Related Issues (20)
- solve the borrow issue with the LRU cache? HOT 12
- Doc tests not running HOT 3
- Implement `into_iter` method for all collections
- Enhance `LinkedHashMap` HOT 3
- Add Haskell-style traversables HOT 3
- Document trait impl behavior HOT 2
- Compilation fails on rust master
- Clean up and enhance `TreeMap` HOT 7
- Disband collect-rs in favour of separate crates? HOT 33
- `TreeMap::insert`'s behavior differs from `{BTreeMap, HashMap}` HOT 5
- Deprecate `trie` in favor of external crate
- Push new version to crates.io HOT 1
- immut_slist -> cons-list?
- collect does not compile on nightly 3-21 HOT 2
- version was not bumped on crates.io? HOT 4
- Check out cool no-unsafe-code intrusive-style dlist HOT 3
- Tone down some greedy benches? HOT 1
- Some types are missing `Debug` impls HOT 3
- Be consistent with `Keys` and `Values` iterators HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collect-rs.