-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
iter: documentation improvements #70986
Comments
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
here is an example from func Keys[Map ~map[K]V, K comparable, V any](m Map) iter.Seq[K] {
return func(yield func(K) bool) {
for k := range m {
if !yield(k) {
return
}
}
}
} |
Reading the links you sent the example you show is meant to demonstrate |
I think Ive made it pretty clear already what the issues are, and what a fix could look like - so I don't think I need to add anything further |
The referenced docs have this paragraph
Admittedly upon encountering this for the first time I thought "but how do I write one, so I can use it?" Would it be fine to do a PR that inserts a new paragraph and a short code before the above paragraph? Like a simple iterator over a slice just for simple illustration? |
Proposal Details
these
https://go.dev/pkg/iter/?m=old#Seq
https://go.dev/pkg/iter/?m=old#Seq2
both say this
"See the iter package documentation for more details" and link back to the same page:
https://go.dev/pkg/iter
also, the entire page does not give an example of implementing either type. technically yes, it does have the below example, but not an example of creating iter.Seq, and even the given example has a iter.Seq as input, so it would assume that you have already implemented iter.Seq without giving an example on how to do so
The text was updated successfully, but these errors were encountered: