{"id":34171868,"url":"https://github.com/malinatrash/funky","last_synced_at":"2026-03-11T02:03:38.535Z","repository":{"id":316785110,"uuid":"1064845003","full_name":"malinatrash/funky","owner":"malinatrash","description":"Powerful library for functional programming in Go with modern generics.","archived":false,"fork":false,"pushed_at":"2025-10-07T07:18:25.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-18T08:27:45.865Z","etag":null,"topics":["backend","collections","composition","concurrency","fp","functional-programming","generics","go","golang","golang-developers","higher-order-functions","lazy-evaluation","library","map-filter-reduce","open-source","optional-types","pipeline","stream-api","type-safe","utilities"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malinatrash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-26T16:33:14.000Z","updated_at":"2025-10-29T15:47:14.000Z","dependencies_parsed_at":"2025-09-26T18:36:05.256Z","dependency_job_id":"c597629d-a7a7-405f-9dbc-4bc6637b3ea7","html_url":"https://github.com/malinatrash/funky","commit_stats":null,"previous_names":["malinatrash/funky"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/malinatrash/funky","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malinatrash%2Ffunky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malinatrash%2Ffunky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malinatrash%2Ffunky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malinatrash%2Ffunky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malinatrash","download_url":"https://codeload.github.com/malinatrash/funky/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malinatrash%2Ffunky/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30367810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","collections","composition","concurrency","fp","functional-programming","generics","go","golang","golang-developers","higher-order-functions","lazy-evaluation","library","map-filter-reduce","open-source","optional-types","pipeline","stream-api","type-safe","utilities"],"created_at":"2025-12-15T11:31:23.927Z","updated_at":"2026-03-11T02:03:38.528Z","avatar_url":"https://github.com/malinatrash.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Functional Programming Library for Go\n\nPowerful library for functional programming in Go with modern generics.\n\n## Main features\n\n### 🚀 Base functions\n\n- **Map, Filter, Reduce** - classic functions of higher order\n- **Parallel processing** - automatic parallelization for large collections\n- **Function composition** - Pipe, Compose, Curry\n\n### 🔧 Advanced utilities\n\n- **Optional/Result types** - safe work with nullable values\n- **Collections** - GroupBy, Chunk, Partition, Zip, Flatten\n- **Parallel operations** - with context and rate limiting\n\n## Examples\n\n### Base operations\n\n```go\nimport \"github.com/malinatrash/funky/pkg/fp\"\n\n// Map - transformation\nnumbers := []int{1, 2, 3, 4, 5}\ndoubled := fp.Map(numbers, func(x int) int { return x * 2 })\n// [2, 4, 6, 8, 10]\n\n// Filter - filtering\nevens := fp.Filter(numbers, func(x int) bool { return x%2 == 0 })\n// [2, 4]\n\n// Reduce - reduction\nsum := fp.Reduce(numbers, func(acc, x int) int { return acc + x }, 0)\n// 15\n```\n\n### Pipeline processing\n\n```go\nresult := fp.NewPipeline([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}).\n    Filter(func(x int) bool { return x%2 == 0 }).\n    Map(func(x int) int { return x * x }).\n    Collect()\n// [4, 16, 36, 64, 100]\n```\n\n### Optional/Result types\n\n```go\n// Optional for safe work with nil\nuser := fp.Some(\"John\")\nname := user.Map(strings.ToUpper).GetOrElse(\"Unknown\")\n// \"JOHN\"\n\n// Result for error handling\nresult := fp.Try(func() (int, error) {\n    return strconv.Atoi(\"42\")\n}).Map(func(x int) int { return x * 2 })\n\nif result.IsOk() {\n    fmt.Println(result.Unwrap()) // 84\n}\n```\n\n### Function composition\n\n```go\n// Pipe - from left to right\nresult := fp.Pipe3(\"hello\",\n    strings.ToUpper,\n    func(s string) string { return s + \"!\" },\n    func(s string) string { return \"\u003e\u003e\u003e \" + s })\n// \"\u003e\u003e\u003e HELLO!\"\n\n// Compose - from right to left\ntransform := fp.Compose3(\n    func(s string) string { return \"\u003e\u003e\u003e \" + s },\n    func(s string) string { return s + \"!\" },\n    strings.ToUpper)\nresult := transform(\"hello\")\n// \"\u003e\u003e\u003e HELLO!\"\n```\n\n### Collections\n\n```go\n// GroupBy\nusers := []User{{Name: \"John\", Age: 25}, {Name: \"Jane\", Age: 25}}\nbyAge := fp.GroupBy(users, func(u User) int { return u.Age })\n\n// Chunk\nnumbers := []int{1, 2, 3, 4, 5, 6, 7}\nchunks := fp.Chunk(numbers, 3)\n// [[1, 2, 3], [4, 5, 6], [7]]\n\n// Zip\nnames := []string{\"John\", \"Jane\"}\nages := []int{25, 30}\npairs := fp.Zip(names, ages)\n// [{John, 25}, {Jane, 30}]\n```\n\n### Parallel processing\n\n```go\n// Parallel Map\nlarge := make([]int, 10000)\nresult := fp.MapParallel(large, heavyComputation)\n\n// With context\nctx := context.Background()\nresult, err := fp.MapWithContext(ctx, data, func(ctx context.Context, item int) (string, error) {\n    return processItem(ctx, item)\n}, fp.DefaultParallelConfig())\n```\n\n## Library structure\n\n- `commonconst.go` - Common types and constants\n- `map.go` - Mapping functions\n- `filter.go` - Filtering functions\n- `reduce.go` - Reduction functions\n- `compose.go` - Function composition and currying\n- `collections.go` - Collection utilities\n- `optional.go` - Optional and Result types\n- `parallel.go` - Parallel processing\n- `utils.go` - Additional utilities\n\n## Performance\n\nThe library automatically selects the optimal strategy:\n\n- For small collections (\u003c100 elements) - sequential processing\n- For large collections - parallel processing with worker pool\n- Configurable parallelism parameters\n\n## Compatibility\n\n- Go 1.18+ (requires generics)\n- Thread-safe operations\n- Zero-dependency (only standard library)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalinatrash%2Ffunky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalinatrash%2Ffunky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalinatrash%2Ffunky/lists"}