{"id":13731760,"url":"https://github.com/life4/genesis","last_synced_at":"2025-05-15T07:02:40.122Z","repository":{"id":38058792,"uuid":"208289840","full_name":"life4/genesis","owner":"life4","description":"All generic functions for Go you ever need!","archived":false,"fork":false,"pushed_at":"2024-11-19T18:59:43.000Z","size":1134,"stargazers_count":347,"open_issues_count":2,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-07T01:11:25.100Z","etag":null,"topics":["elixir","enum","erlang","fp","functional-programming","generic","generic-programming","generics","go","golang","goroutine","map","maps","slice","slices"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/life4/genesis","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/life4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-09-13T15:11:13.000Z","updated_at":"2025-03-15T00:39:19.000Z","dependencies_parsed_at":"2022-07-13T00:40:51.670Z","dependency_job_id":"33dfa420-60d6-47ff-802a-cf1aa66f5dd2","html_url":"https://github.com/life4/genesis","commit_stats":{"total_commits":338,"total_committers":10,"mean_commits":33.8,"dds":0.09171597633136097,"last_synced_commit":"0d94ca923333468c9e9fc606b91c19eee6572a54"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/life4%2Fgenesis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/life4%2Fgenesis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/life4%2Fgenesis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/life4%2Fgenesis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/life4","download_url":"https://codeload.github.com/life4/genesis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852124,"owners_count":21171839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["elixir","enum","erlang","fp","functional-programming","generic","generic-programming","generics","go","golang","goroutine","map","maps","slice","slices"],"created_at":"2024-08-03T02:01:37.911Z","updated_at":"2025-04-14T08:57:44.288Z","avatar_url":"https://github.com/life4.png","language":"Go","readme":"# Genesis\n\nGeneric functions for Go. Bringing the beauty of functional programming in Go 1.18+.\n\n**😎 Features:**\n\n+ 🛠️ Over 170 generic functions for channels, maps, and slices.\n+ 💪 Uses the power of Go 1.18+ generics.\n+ 🧐 No code generation.\n+ 🪶 No dependencies (except [is](https://github.com/matryer/is) for testing).\n+ 🏃 Pure Go.\n+ 🪩 Sync and async versions of all the main functions.\n\n**🔨 When to use:**\n\n+ 🐘 **In a big project**. More the project grows, more you find yourself writing boring generic code like \"Min\". Break the cycle.\n+ 🤝 **In a team project**. Each line of code you write means higher maintenance cost that in turn means loosing time and money.\n+ 🐶 **In a pet project**. Leave the boring stuff to us, focus on the fun parts.\n+ 📚 **When readability matters**. `slices.Shrink` is a function with a human-friendly name and documentation. `s[:len(s):len(s)]` is a jibberish and black magic. Prefer the former.\n+ 💔 **When you miss some conveniences** that come in other languages out-of-the-box.\n+ 🐇 **When you write a highly concurrent code** and don't want to manually implement code for cancellation, results collection and ordering, worker groups, context, etc.\n\n**📦 What's inside**:\n\n+ `Filter`, `Map`, and `Reduce` for data processing on steroids.\n+ `FilterAsync`, `MapAsync`, and `ReduceAsync` for making your code fast and concurrent with a single line of code.\n+ `Grow` and `Shrink` for reducing memory allocations.\n+ `Permutations` and `Product` for simple iterations.\n+ `Shuffle` and `Sort` for randomization.\n+ `Any` and `All` for simple flow control.\n+ `Range`, `Count`, and `Cycle` for generating sequences.\n\nAnd much more.\n\n## 💾 Installation\n\n```bash\ngo get github.com/life4/genesis\n```\n\n## 👀 Examples\n\nFind the minimal value in a slice of ints:\n\n```go\nlambdas.Must(slices.Min([]int{42, 7, 13})) == 7\n```\n\nDouble values in a slice of ints:\n\n```go\nslices.Map([]int{4, 8, 15}, func(el int) int { return el * 2 })\n```\n\nConcurrently check status codes for multiple URLs:\n\n```go\nurls := []string{\n    \"https://go.dev/\",\n    \"https://golang.org/\",\n    \"https://google.com/\",\n}\ncodes := slices.MapAsync(\n    urls, 0,\n    func(url string) int {\n        return lambdas.Must(http.Get(url)).StatusCode\n    },\n)\n```\n\n## 🔨 Usage\n\nGenesis contains the following packages:\n\n+ [🍞 slices](https://pkg.go.dev/github.com/life4/genesis/slices): generic functions for slices (`[]T`).\n+ [🗺 maps](https://pkg.go.dev/github.com/life4/genesis/maps): generic functions for maps (`map[K]V`).\n+ [📺 channels](https://pkg.go.dev/github.com/life4/genesis/channels): generic function for channels (`chan T`).\n+ [⚙️ sets](https://pkg.go.dev/github.com/life4/genesis/sets): generic function for sets (`map[T]struct{}`).\n+ [🛟 lambdas](https://pkg.go.dev/github.com/life4/genesis/lambdas): helper generic functions to work with `slices.Map` and similar.\n\nSee [📄 DOCUMENTATION](https://pkg.go.dev/github.com/life4/genesis) for more info.\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flife4%2Fgenesis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flife4%2Fgenesis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flife4%2Fgenesis/lists"}