A Go library providing efficient, parallel, lazy map, reduce, filter, and other functional operations on sequences with built-in error handling.
FuncFrog is a Go library that provides a stream-like API for performing functional operations on data sequences. It enables developers to write expressive, pipeline-driven code with support for lazy evaluation, parallel execution, and minimal overhead. The library implements operations like map, reduce, filter, and sort on slices and other sequences, aiming to bring functional programming idioms to Go in a performant, idiomatic way.
Go developers working with data processing pipelines, especially those needing parallel execution, lazy evaluation, or functional-style transformations on large or complex data sequences. It suits projects where performance and clean, chainable API design are priorities.
Developers choose FuncFrog for its combination of lazy evaluation, configurable parallelism, and type-safe pipelines with generics, all with minimal overhead. Its unique error-handling mechanism (Yeti/Snag) and support for infinite sequences or unknown-length data differentiate it from simpler functional libraries in Go.
Stream api (kind of) implementation for go, other useful functions and packages to use go in a functional way
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows splitting operations across multiple goroutines with minimal overhead, as shown in the README's performance tests and Parallel(n int) method for efficient large-scale data processing.
Supports on-demand evaluation of sequences, optimizing performance for infinite or large data streams, evident in constructors like Func and Cycle that handle unknown lengths.
Includes map, reduce, filter, sort, and more, with utilities for type conversion and error handling, providing comprehensive functional tools as listed in the supported functions.
Maintains type safety across transformations using Go generics, reducing runtime errors and enabling clean API design, as demonstrated in examples with Map and Reduce across types.
The Yeti/Snag mechanism is unique and described as 'uncommon at first glance,' requiring additional learning and potentially confusing developers used to standard Go error patterns.
Several functions like Reverse, IsAny, and Until are marked TBD in the README, indicating gaps in functionality that may limit usability for some use cases.
Improper use of methods like Take can lead to deadlocks or infinite loops, as warned in the README example where misconfiguration causes the pipeline to jam indefinitely.