Hacker News new | ask | show | jobs
by a1369209993 1990 days ago
> A Map [with value type = void/unit/() [0]] and a Set are two different things

Not to defend Go or anything, but that's like saying:

| A Array [with element type = byte/char/u8] and a String are different things

It might be useful to call them different names (of course that would require Go to support generic typedefs for `type Set k = Map k Void`), but they're still fundamentally the same thing.

0: which, to be fair, is not the same thing as a map with bool values.

1 comments

Fundamentally, all values are a collection of bits. That doesn't mean having distinct structures built on top of those bits isn't useful.