Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/golang-design/go2generics
๐งช A chunk of experiments and demos about Go 2 generics design (type parameter & type set)
https://github.com/golang-design/go2generics
generics go golang
Last synced: about 2 months ago
JSON representation
๐งช A chunk of experiments and demos about Go 2 generics design (type parameter & type set)
- Host: GitHub
- URL: https://github.com/golang-design/go2generics
- Owner: golang-design
- License: bsd-2-clause
- Created: 2020-03-13T08:55:45.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-04-01T07:55:03.000Z (almost 3 years ago)
- Last Synced: 2024-11-07T22:42:19.693Z (2 months ago)
- Topics: generics, go, golang
- Language: Go
- Homepage: https://changkun.de/s/go2generics/
- Size: 244 KB
- Stars: 150
- Watchers: 7
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: history/201006.go2.txt
- License: LICENSE
Awesome Lists containing this project
- my-awesome - golang-design/go2generics - 04 star:0.2k fork:0.0k ๐งช A chunk of experiments and demos about Go 2 generics design (type parameter & type set) (Go)
README
# go2generics ![](https://changkun.de/urlstat?mode=github&repo=golang-design/go2generics)
A chunk of demos for Go generics design (based on type parameters and type sets).
## Standard Package
### Package `constraints`
See the official implementation [here](https://github.com/golang/exp/tree/master/constraints).
### Package `slices`
See the official implementation [here](https://github.com/golang/exp/tree/master/slices).
### Package `maps`
See the official implementation [here](https://github.com/golang/exp/tree/master/maps).
### Package `container/set`
This package is from the following discussions:
- [golang/go#47331](https://golang.org/issue/47331) proposal: container/set: new package to provide a generic set type (discussion)
See a possible implementation [here](./std/container/set).
### Others (under discussion)
- [golang/go#47657](https://golang.org/issue/47657) proposal: sync, sync/atomic: add PoolOf, MapOf, ValueOf
- [golang/go#47632](https://golang.org/issue/47632) proposal: container/heap: add Heap, a heap backed by a slice
- [golang/go#47619](https://golang.org/issue/47619) proposal: generic functions in the sort package## Further Examples
See folders in this repository.
## Known Issues- https://go.dev/issue/45639
- https://go.dev/issue/51338
- sync/*
- notsupport/*## References
Here are some documents to get familiar with the spirit of generics:
- Changkun Ou. [A Summary of Go Generics Research](./generics.md) 2020.08. Last Updates: 2021.08.
- Changkun Ou. Go 2 Generics: Type Parameters. https://changkun.de/s/go2generics/.
## LicneseBSD-2-Clause
Copyright ยฉ 2020-2021 [Changkun Ou](https://changkun.de)