Comments (3)
This seems like a reasonable compromise, also giving an affordance to the user to also assert a specific kind of Iterator
being returned (like DoubleEndedIterator
). I was trying to hide it a little bit because I was thinking it would allow us to make changes here to the returned type, for example if we ever make a new expression to consume generators and give back a non-unit value through resume
, but making the returned type explicit such a change would be opt-in, which is reasonable.
from iterator_item.
When comparing with the async
version, I would expect the Iterator part not to be shown, given that there is like for async fn
an additional marker on the fn
part:
async fn foo() -> i32 { ... }
// vs
fn foo() -> impl Future<Output = i32> { ... }
// and iterators
fn* foo() -> i32 { ... }
// vs
fn foo() -> impl Iterator<Item = i32> { ... }
Edit: This does unfortunately not solve the issue of the potential change of return types @estebank mentioned though.
from iterator_item.
When comparing with the async version,
I don't want to reopen that particular discussion here, but: some folks, myself included, believe that should have been spelled -> impl Future<Output=T>
(or perhaps -> impl Future<T>
) as well. And I think that may be possible to improve upon.
@estebank Exactly.
from iterator_item.
Related Issues (4)
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 iterator_item.