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

Necessity of fuse #15

Open
tmaxmax opened this issue Feb 2, 2021 · 0 comments
Open

Necessity of fuse #15

tmaxmax opened this issue Feb 2, 2021 · 0 comments
Labels
help wanted Extra attention is needed
Milestone

Comments

@tmaxmax
Copy link
Owner

tmaxmax commented Feb 2, 2021

In Rust, the iterator method fuse exists. It returns an iterator that will keep returning None after the first None. But while in Rust, Iterator's [next] method returns an Option, in Javascript next returns a value and a done flag, that indicates the end of the iterator. Because of this, Javascript's iterator are semantically already fused, rendering the method fuse useless. Although it could be used to turn an iterator over Option<T> (alias for T | null in our codebase), I think it wouldn't be semantically the same with Rust's fuse. Besides that, given the lack of generic specialization in Typescript, implementing it this way would be problematic.

Should the fuse method be implemented, then?

@tmaxmax tmaxmax added the help wanted Extra attention is needed label Feb 2, 2021
@tmaxmax tmaxmax added this to the February milestone Feb 2, 2021
@tmaxmax tmaxmax self-assigned this Feb 2, 2021
@tmaxmax tmaxmax mentioned this issue Feb 2, 2021
69 tasks
@tmaxmax tmaxmax removed their assignment Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant