{"id":20784643,"url":"https://github.com/genkami/dogs","last_synced_at":"2025-05-11T12:33:36.715Z","repository":{"id":37247079,"uuid":"410795734","full_name":"genkami/dogs","owner":"genkami","description":"Make Go functional with dogs","archived":false,"fork":false,"pushed_at":"2024-11-08T21:57:12.000Z","size":148,"stargazers_count":38,"open_issues_count":7,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-08T22:34:03.359Z","etag":null,"topics":["functional","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/genkami.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":"2021-09-27T08:06:15.000Z","updated_at":"2023-07-09T06:21:03.000Z","dependencies_parsed_at":"2023-11-28T00:23:36.226Z","dependency_job_id":"6599161d-ec73-47e3-b707-489439903961","html_url":"https://github.com/genkami/dogs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genkami%2Fdogs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genkami%2Fdogs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genkami%2Fdogs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genkami%2Fdogs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/genkami","download_url":"https://codeload.github.com/genkami/dogs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225049054,"owners_count":17412916,"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":["functional","go","golang"],"created_at":"2024-11-17T14:31:51.174Z","updated_at":"2024-11-17T14:31:51.791Z","avatar_url":"https://github.com/genkami.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dogs\n\n![ci status](https://github.com/genkami/dogs/workflows/Test/badge.svg)\n[![Go Reference](https://pkg.go.dev/badge/github.com/genkami/dogs.svg)](https://pkg.go.dev/github.com/genkami/dogs)\n\n![logo](./doc/logo.png)\n\nMake Go functional with dogs\n\n# Caution\nThis is a **highly-experimental** package. Any changes will be made in a backward-incompatible manner.\n\nThis package will not compile without `gotip` since type parameters are not supported currently in any of Go releases.\n\nProbably **you don't need this** even after type parameters becomes GA. Even if you feel you do, maybe **you shouldn't use this**. It's against Go's philosophy.\n\n# Features\n\nWe will continue to implement more utility types and functions.\n\n## Type classes\n* Eq\n* Ord\n* Semigroup\n* Monoid\n\n## Data types\n* Pair\n* List\n* Slice\n* Map\n* Set\n* Iterator\n\n# Examples\n\nMore examples [here](https://github.com/genkami/dogs/tree/main/examples).\n\n## FizzBuzz\n\n```go\nfunc main() {\n\tmonoid := option.DeriveMonoid[string](algebra.DeriveAdditiveSemigroup[string]())\n\tfizzBuzz := func(i int) string {\n\t\tfizz := option.Filter(option.Some[string](\"Fizz\"), func(_ string) bool { return i%3 == 0 })\n\t\tbuzz := option.Filter(option.Some[string](\"Buzz\"), func(_ string) bool { return i%5 == 0 })\n\t\treturn option.UnwrapOr(monoid.Combine(fizz, buzz), fmt.Sprint(i))\n\t}\n\tit := iterator.Map(iterator.Range[int](1, 15), fizzBuzz)\n\titerator.ForEach(it, func(s string) { fmt.Println(s) })\n}\n```\n\n## Fibonacci\n\n```go\nfunc main() {\n\ttype Pair = pair.Pair[int, int]\n\tit := iterator.Unfold(\n\t\tPair{1, 1},\n\t\tfunc(p Pair) (Pair, int, bool) {\n\t\t\ta, b := p.Values()\n\t\t\treturn Pair{b, a + b}, a, true\n\t\t},\n\t)\n\titerator.ForEach(\n\t\titerator.Take(it, 5),\n\t\tfunc(i int) { fmt.Println(i) },\n\t)\n}\n```\n\n# Acknowledgements\nThis library is inspired mainly by:\n\n* [Haskell standard library](https://hackage.haskell.org/package/base)\n* [Scala Cats](https://typelevel.org/cats/)\n\nand many other functional languages.\n\n\n# License\n\nDistributed under the Apache License, Version 2.0. See LICENSE for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenkami%2Fdogs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenkami%2Fdogs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenkami%2Fdogs/lists"}