4 ms·
> until (if) the language gets some sort of sum type Is there any discussion with the Go team about this actually happening?
by pstuart 2y ago
> until (if) the language gets some sort of sum type
Is there any discussion with the Go team about this actually happening?
- ajb 2y agoI don't know about recently, but people were asking about them from the first announcement in 2009; and got the answer that they were "under consideration" To be fair, it's a significant advantage of go that they have been strict about keeping it's feature set small. Edited to add: There is this 2023 proposal from Ian Lance Taylor (on the go team) https://github.com/golang/go/issues/57644 https://github.com/golang/go/issues/57644 But it makes all sum types include nil, which seems suboptimal
- pstuart 2y agoWell, he advocated for and eventually got generics, so it could happen here too.