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

[Feature] iter support running from a map #136

Open
someblue opened this issue May 7, 2024 · 2 comments
Open

[Feature] iter support running from a map #136

someblue opened this issue May 7, 2024 · 2 comments

Comments

@someblue
Copy link

someblue commented May 7, 2024

conc is very wonderful to writing concurrent code, thanks for your project!

Currently, there is only iter.Map() run from a slice. But sometimes we need to concurrently run from a map.

Could you consider provide a function like:

func RunFromMap[K comparable, V any, R any](input map[K]V, f func(*T, *V) R) []R

(iter.Map running from slice has occuppied the best name. The naming maybe a little hard to decide😭)

@camdencheek
Copy link
Member

Spoiler: I'd like the next version of the conc/iter package to support the new stdlib iter package. In this case, you could create a Seq2 from any map and conc could consume that.

Still pretty early in the design process (especially since iterators haven't stabilized yet), but stay tuned 🙂

@someblue
Copy link
Author

someblue commented May 8, 2024

It sounds cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants