Standard library additions for type parameters

168 views
Skip to first unread message

Caleb Spare

unread,
Jul 21, 2021, 2:15:57 PM7/21/21
to golang-dev
Hi all,

The type parameters design contemplates a variety of additions to the
standard library, some more speculative than others.

So far, two Go 1.18 proposals have been put forth:

* proposal: constraints: new package to define standard type parameter
constraints (https://github.com/golang/go/issues/45458)
* proposal: slices: new package to provide generic slice functions
(https://github.com/golang/go/issues/45955)

The design mentions other ideas including:

* maps
* sets
* additions to sort
* chans
* more containers (ordered maps, etc)

Are the folks working on the type parameter implementation planning on
proposing any of these for Go 1.18, or is the idea that the initial
release of generics will add only constraints and slices?

Thanks,
Caleb

Ian Lance Taylor

unread,
Jul 21, 2021, 3:25:17 PM7/21/21
to Caleb Spare, golang-dev
I plan to also propose maps and container/set. It is likely that we
will propose something for sort. At the moment I think that chans and
other containers are unlikely for 1.18.

Ian

Caleb Spare

unread,
Jul 21, 2021, 4:19:11 PM7/21/21
to Ian Lance Taylor, golang-dev
Great, looking forward to these. Thanks, Ian.
Reply all
Reply to author
Forward
0 new messages