3 ms·
The key difference being knowledge: I don't have to know `HashSet` is really just a map with a ZST to use it efficiently. All I need to know is that I don't nee
by woodruffw 5y ago
The key difference being knowledge: I don't have to know `HashSet` is really just a map with a ZST to use it efficiently. All I need to know is that I don't need a value, and the ecosystem obliges me. This in contrast to Go, where I need to know that `struct{}` is a ZST, that the "right" way to do a set is to use it as the map value, &c.
- typical182 5y agoThere is also a WIP Go proposal for adding a set to the standard library using the upcoming generics: https://github.com/golang/go/discussions/47331 https://github.com/golang/go/discussions/47331