srgrr/gombinator ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Go library for lazy, goroutine safe data processing with channels and context support.

I want to be able to take a slice or a channel, then chain things like map, filter, and range in a simple way, where results are generated only when they are read. It should feel easy to write pipelines like getting numbers, filtering them, and transforming them without having to manage all the channel plumbing myself.

Please make it work with context cancellation so I can stop a stream cleanly, and include both the normal functions and the channel based versions so they can be chained together. If there are any cases that can return an error, add helper versions for that too. It would be great if the library also lets me tune the internal buffering a bit.

Keep it lightweight and focused on building readable lazy pipelines, not replacing simple sequential code. Add a couple of examples and tests showing how to use it with slices, channels, and multiple goroutines.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab