Search code examples
haxe

HashSet class in Haxe


Is there a predefined HashSet class in Haxe, similar to

s = set()

in Python or

import java.util.HashSet;

in Java?

I know, I can simply use haxe.ds.HashMap in order to quickly implement such a set, however I'm curious whether I really need to do this ...


Solution

  • There's no set data structure in the standard library, but that doesn't necessarily mean you have to implement one yourself. The polygonal-ds library is excellent for instance, and comes with a HashSet class (among many others).