Comments (12)
I believe the current (IMO annoying :P) convention is to use newtypes.
from collect-rs.
@aturon has plans for some kind of macro to make this more ergonomic.
But yeah, annoying.
from collect-rs.
Strictly speaking we could not bother since we make no back-compat guarantees at all.
from collect-rs.
@gankro I believe a few such macros are currently in use in std
for this purpose.
from collect-rs.
(I think it'd be interesting to try to provide a robust form of these macros in crates.io, but I won't have time to do that myself any time soon.)
from collect-rs.
Is there even a reason to have these iterators? Adaptors provide the same functionality without the combinatoric explosion of key-value/mutable-immutable/forward-reverse/subrange variants.
from collect-rs.
Hmm... I... Don't disagree.
from collect-rs.
You're making the intent clearer if you ask for keys or values only – also there's the possibility of implementing "just getting the keys" in a more efficient way, because it doesn't have to touch the values.
from collect-rs.
Ideally there's a way to get a keys iterator that doesn't contain the values type - this has been a problem for me in the past.
Thanks,
Jonathan Reem
On Wed, Jan 28, 2015 at 12:26 PM, tbu- [email protected] wrote:
You're making the intent clearer if you ask for keys or values only – also there's the possibility of implementing "just getting the keys" in a more efficient way, because it doesn't have to touch the values.
Reply to this email directly or view it on GitHub:
#99 (comment)
from collect-rs.
@reem As written, both forms (type alias and wrapper struct) reference the value type. Without being space-inefficient or using trait objects or unsafe code, I don't see how they can be written without being parameterized over the value.
from collect-rs.
Depending on the data structure it is sometimes possible to do it unsafely.
Thanks,
Jonathan Reem
On Wed, Jan 28, 2015 at 12:38 PM, Andrew Paseltiner
[email protected] wrote:
@reem As written, both forms (type alias and wrapper struct) reference the value type. Without being space-inefficient or using trait objects or unsafe code, I don't see how they can be written without being parameterized over the value.
Reply to this email directly or view it on GitHub:
#99 (comment)
from collect-rs.
Closing because trie
is now in an external crate. CC contain-rs/trie#4.
from collect-rs.
Related Issues (20)
- solve the borrow issue with the LRU cache? HOT 12
- Try out some collection traits HOT 4
- 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
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.