conc icon indicating copy to clipboard operation
conc copied to clipboard

[Feature] `iter` support running from a map

Open someblue opened this issue 1 year ago • 2 comments

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😭)

someblue avatar May 07 '24 09:05 someblue

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 🙂

camdencheek avatar May 07 '24 15:05 camdencheek

It sounds cool, thanks!

someblue avatar May 08 '24 06:05 someblue