486c0a061c05a47b962f9a3ead7083081550a837

A Set is a group of values without any keys. You may only store strings and integers more data types will be implemented later. Access in a Set has the time complexity of O(lg n) because Hack has to do a search for the element within the Set. You may create a Set from a Map or Vector by running the function toSet().

The special feature with Sets is that it can’t contain doublets. Each value is unique. If you try to assign the same value twice it will just be ignored.

Since you do not have any keys in a Set it is natural to believe that $set[$k] syntax is not supported. But you may add an element using the bracket syntax ($set[] = …).