{"id":20594724,"url":"https://github.com/unmango/go","last_synced_at":"2025-07-25T20:13:28.265Z","repository":{"id":257820226,"uuid":"870381384","full_name":"unmango/go","owner":"unmango","description":"Random Go crap","archived":false,"fork":false,"pushed_at":"2025-03-05T23:10:26.000Z","size":234,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T00:20:44.542Z","etag":null,"topics":["afero","functional-programming","go","golang","observable","reactive","rx"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"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/unmango.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":"2024-10-09T23:58:59.000Z","updated_at":"2025-03-05T23:10:29.000Z","dependencies_parsed_at":"2024-10-10T07:29:27.244Z","dependency_job_id":"28db8676-4be4-4701-9864-d734c4a4511f","html_url":"https://github.com/unmango/go","commit_stats":null,"previous_names":["unmango/go"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unmango%2Fgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unmango%2Fgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unmango%2Fgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unmango%2Fgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unmango","download_url":"https://codeload.github.com/unmango/go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242229396,"owners_count":20093383,"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":["afero","functional-programming","go","golang","observable","reactive","rx"],"created_at":"2024-11-16T08:09:59.547Z","updated_at":"2025-03-06T14:44:51.804Z","avatar_url":"https://github.com/unmango.png","language":"Go","readme":"\u003c!-- markdownlint-disable-file MD010 --\u003e\n\n# Go Source code for UnMango\n\nA collection of random Go packages.\n\n## iter\n\nThe `iter` package builds on the standard `iter` package.\nIt re-exports `Seq` and `Seq2` for convenience and adds `Seq3`.\nIt adds sequence creation functions such as `Empty`, `Singleton`, and `Values`.\n\n```go\nvar seq Seq[int] = iter.Empty[int]()\nvar seq Seq[int] = iter.Singleton(69)\nvar seq Seq[int] = iter.Values(69, 420)\n```\n\nIt also adds various sequence operations such as `Map`, `Fold`, and `Filter`.\n\n```go\nvar seq Seq[int] = iter.Values(69, 420)\n\n// [70, 421]\nmapped := iter.Map(seq, func(i int) int {\n\treturn i + 1\n})\n\n// 489\nsum := iter.Fold(seq, func(acc, i int) {\n\treturn acc + i\n}, 0)\n\n// [69]\nfiltered := iter.Filter(seq, func(i int) bool {\n\treturn i != 420\n})\n```\n\n## maps\n\nPrimarily re-exports functions and types for convenience.\nDue to Go not currently supporting generic type aliases, these functions adapt the standard `iter` seq to this module's `iter` package.\n\n```go\nfunc Test(seq iter.Seq2[string, int]) {\n\tvar m map[string]int = maps.Collect(seq)\n}\n```\n\nThe `maps` package also adds `AppendSeq` for appending a `map` to a `Seq2`.\n\n```go\nseq := maps.All(map[string]string{\"foo\": \"bar\"})\n\n// {\"foo\": \"bar\", \"bin\": \"baz\"}\nseq = maps.AppendSeq(seq, map[string]string{\"bin\": \"baz\"})\n```\n\n## result\n\nThe `result` pakcage adds the `Result` type representing either success or error.\nIt also adds various result operations such as `Map` and `Bind`.\n\n```go\nfunc main() {\n\tvar r Result[int] = func() (int, error) {\n\t\treturn 420, nil\n\t}\n\n\tr = result.Map(r, func(x int) int {\n\t\treturn x+1\n\t})\n}\n```\n\n## slices\n\nThe `slices` package re-exports functions and types from the standard `slices` package for convenience.\nDue to Go not currently supporting generic type aliases, these functions adapt the standard `slices` seq to this module's `slices` package.\n\n## rx\n\nThe `rx` package attempts to implement the observable and signal patterns for reactive programming in go.\nBoth `observable` and `signal` should be considered a 🚧 work in progress 🚧, but the `observable` package is generally usable.\n\n```go\nvar obs rx.Observable[int] = subject.New[int]()\n\nsub := obs.Subscribe(observer.Lift(func(i int) {\n\tfmt.Println(i)\n}))\ndefer sub()\n\nobs.OnNext(69)\nobs.OnComplete()\n```\n\n## Inspiration\n\nI stand on the shoulders of giants.\nA lot of this is inspired by the works of others, be sure to check out these repos as well.\n(They're much smarter than me)\n\n\u003chttps://github.com/fogfish/golem\u003e\n\n- [A Guide to Pure Combinators in Golang](https://medium.com/@dmkolesnikov/a-guide-to-pure-type-combinators-in-golang-or-how-to-stop-worrying-and-love-the-functional-e14f7f8cf35c)\n\n\u003chttps://github.com/IBM/fp-go\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funmango%2Fgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funmango%2Fgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funmango%2Fgo/lists"}