You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
My understanding is that the argument to next() is forwarded to the underlying iterator. All the examples of this are with 1:1 combinators, like map() where each call to next() on the mapped iterator corresponds to a single call to next() on the underlying iterator. It's not at all clear from the explainer what the behavior is for combinators where a single next() call on the result iterator may correspond to multiple calls to next() on the underlying iterator, such as filter() and drop(). Conversely, for flatMap(), many calls to the result iterator can correspond to a single call to the underlying iterator, so it's worth clarifying this behavior as well.
My reading of the spec was that it filter passes the same value repeatedly, drop passes undefined repeatedly (since it only skips on the first call), and flatMap doesn't attempt to pass the protocol at all, but it took me a few hours of staring at the different parts of the spec to figure that out.
The text was updated successfully, but these errors were encountered:
My understanding is that the argument to
next()
is forwarded to the underlying iterator. All the examples of this are with 1:1 combinators, likemap()
where each call tonext()
on the mapped iterator corresponds to a single call tonext()
on the underlying iterator. It's not at all clear from the explainer what the behavior is for combinators where a singlenext()
call on the result iterator may correspond to multiple calls tonext()
on the underlying iterator, such asfilter()
anddrop()
. Conversely, forflatMap()
, many calls to the result iterator can correspond to a single call to the underlying iterator, so it's worth clarifying this behavior as well.My reading of the spec was that it
filter
passes the same value repeatedly,drop
passesundefined
repeatedly (since it only skips on the first call), andflatMap
doesn't attempt to pass the protocol at all, but it took me a few hours of staring at the different parts of the spec to figure that out.The text was updated successfully, but these errors were encountered: