-
Notifications
You must be signed in to change notification settings - Fork 321
RepeatCall shouldn't implement DoubleEndedIterator #86
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
Comments
I guess you're right about that, most implementations do not make sense as double ended. You can of course run into this problem in other places, like in a regular |
That's... odd. I've submitted a bug to discuss it (rust-lang/rust#30632). It kind of makes sense because map (and filter) are generally pure functions but this behavior should, at least, be noted. However, this case is pretty clear; |
I disagree actually, infinite sequences can have two ends (For example .cycle()). Maybe cycle is a bad argument, since I wrote it 😄 |
Oh no, cycle is not double ended! My evil plans,... Ok I guess I managed to scare you there by mistake. |
On the whole, sideeffectful iterators can always cause trouble like this. I'm leaning towards wontfixing this bug for this reason, it has use cases where double endedness is useful. |
-- ZFC Yes, some sequences can go backwards from the starting point but that's not double ended, it's no-ended (doubly infinite). |
I thought this issue could stay open until we make a decision (0.5 is next breaking change opportunity). Currently I lean WONTFIX. |
In a crazy turn of events, I'm removing the DEI implementation in 0.5 |
For example, the following iterator is definitely not reservable:
The text was updated successfully, but these errors were encountered: