I just published : Iterator lib for Go: Library providing Map(), Filter(), Reduce() for Go

571 views
Skip to first unread message

Serge Hulne

unread,
Aug 25, 2021, 2:17:59 PM8/25/21
to golang-nuts
https://github.com/serge-hulne/go_iter


Currently working on the doc and examples.

Howard C. Shaw III

unread,
Sep 3, 2021, 1:53:45 PM9/3/21
to golang-nuts
Just so you are aware of what's out there:


"I wanted to see how hard it was to implement this sort of thing in Go, with as nice an API as I could manage. It wasn't hard.

Having written it a couple of years ago, I haven't had occasion to use it once. Instead, I just use "for" loops.

You shouldn't use it either.

Rob Pike

"

https://github.com/JohnCGriffin/yogofn - uses reflection, but has non-reflective code for float64, int, and string slices.

https://github.com/kulshekhar/fungen - uses go generate to create list-like types with MRF functions.

https://github.com/thoas/go-funk - reflect-based generic MRF, along with some single-typed instances

https://github.com/benashford/go-func - another reflection based MRF

https://blog.gopheracademy.com/advent-2015/glow-map-reduce-for-golang/ - glow is more like your example, using channels for MRF, but adds the ability to shard and distribute the shards.

You might want to look over these and see what differentiates your solution so that you can mention it in your Readme.MD. Also, don't forget that generics are coming in 1.18, and they are already enabled in go-tip, so you can be working on a non-reflection based generic solution.

Samuel Berthe

unread,
Mar 3, 2022, 1:49:20 PM3/3/22
to golang-nuts
Go will have support for generics soon.
You won't need reflection anymore. \o/

https://github.com/samber/lo

Rob Muhlestein

unread,
Mar 14, 2022, 4:10:48 PM3/14/22
to golang-nuts
Here's one with 1.18 generics: https://github.com/rwxrob/fn (for fun).

Serge Hulne

unread,
Mar 14, 2022, 4:16:11 PM3/14/22
to Rob Muhlestein, golang-nuts
Cool!

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/9UaV33bB4Qc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/51caeaaf-13d0-461d-9ed9-d438ccfe12bcn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages