{"id":20354750,"url":"https://github.com/superpaintman/typed","last_synced_at":"2026-06-10T07:31:48.283Z","repository":{"id":44734154,"uuid":"452780106","full_name":"SuperPaintman/typed","owner":"SuperPaintman","description":"typed is a typed Go stdlib for generics","archived":false,"fork":false,"pushed_at":"2022-01-28T01:23:28.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T16:48:44.716Z","etag":null,"topics":["generic","generics","go","go-generics","go118","golang"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/SuperPaintman/typed","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/SuperPaintman.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}},"created_at":"2022-01-27T17:32:42.000Z","updated_at":"2022-03-07T18:06:28.000Z","dependencies_parsed_at":"2022-08-27T17:01:28.084Z","dependency_job_id":null,"html_url":"https://github.com/SuperPaintman/typed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SuperPaintman/typed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Ftyped","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Ftyped/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Ftyped/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Ftyped/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperPaintman","download_url":"https://codeload.github.com/SuperPaintman/typed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Ftyped/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34142638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":["generic","generics","go","go-generics","go118","golang"],"created_at":"2024-11-14T23:09:34.557Z","updated_at":"2026-06-10T07:31:48.263Z","avatar_url":"https://github.com/SuperPaintman.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typed [🇹]\n\n`typed` is a typed Go stdlib (almost) for generics.\n\n\u003e It is a set of experimental packages that heavily use features of\n\u003e [Go 1.18](https://tip.golang.org/doc/go1.18) generics.\n\n---\n\n## Examples\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"github.com/SuperPaintman/typed/mathx\"\n)\n\nfunc main() {\n  v := mathx.Max(1, 20)\n\n  fmt.Printf(\"v: %d\\n\", v)\n  // Output: v: 20\n}\n```\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"github.com/SuperPaintman/typed/containerx/stackx\"\n)\n\nfunc main() {\n  var stack stackx.Stack[int]\n\n  stack = append(stack, 7331)\n  stack = append(stack, 1337)\n\n  v1, ok := stack.Pop()\n  fmt.Printf(\"v1: %d, ok: %v\\n\", v1, ok)\n  // Output: v1: 1337, ok: true\n\n  v2, ok := stack.Pop()\n  fmt.Printf(\"v2: %d, ok: %v\\n\", v2, ok)\n  // Output: v2: 7331, ok: true\n\n  v3, ok := stack.Pop()\n  fmt.Printf(\"v3: %d, ok: %v\\n\", v3, ok)\n  // Output: v3: 0, ok: false\n}\n```\n\n```go\npackage main\n\nimport (\n  \"encoding/json\"\n  \"fmt\"\n  \"github.com/SuperPaintman/typed/nullx\"\n)\n\nfunc main() {\n  var post struct {\n    Description nullx.Nullable[string]\n    Likes       nullx.Nullable[int]\n    Tags        nullx.NonNullableSlice[string]\n  }\n\n  if err := json.Unmarshal([]byte(`{ \"likes\": 0 }`), \u0026post); err != nil {\n    panic(err)\n  }\n\n  fmt.Printf(\"%#v\\n\", post)\n  // Output: struct { Description nullx.Nullable[string]; Likes nullx.Nullable[int]; Tags nullx.NonNullableSlice[string] }{Description:nullx.Nullable[string]{Value:\"\", Valid:false}, Likes:nullx.Nullable[int]{Value:0, Valid:true}, Tags:nullx.NonNullableSlice[string](nil)}\n\n  b, err := json.Marshal(post)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Printf(\"%s\\n\", b)\n  // Output: {\"Description\":null,\"Likes\":0,\"Tags\":[]}\n}\n```\n\n---\n\n## FAQ\n\n\u003e **Question**:\n\u003e\n\u003e Should I use this package in production?\n\u003e\n\u003e **Answer**:\n\u003e\n\u003e At the moment, I think not. As long as\n\u003e [Go 1.18](https://tip.golang.org/doc/go1.18) is in beta, it is better to\n\u003e taste Go generics, but it is questionable to use them in real projects.\n\u003e\n\u003e Later, probably yes.\n\n\u003e **Question**:\n\u003e\n\u003e Why every package has `x` suffix?\n\u003e\n\u003e **Answer**:\n\u003e\n\u003e To avoid collisions with the std Go packages and save idiomatic\n\u003e [package naming](https://go.dev/blog/package-names) simultaneously.\n\u003e\n\u003e Also, `t` (or any other letters) looks awkward and unreadable in package names\n\u003e (like `matht`).\n\n---\n\n#### License\n\n[MIT](./LICENSE)\n\n---\n\nWith 🫀 by [Aleksandr Krivoshchekov (@SuperPaintman)](https://github.com/SuperPaintman)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperpaintman%2Ftyped","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperpaintman%2Ftyped","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperpaintman%2Ftyped/lists"}