Haxe's enumeration types are algebraic data types (ADT). Their primary use is for describing data structures. Enums are denoted by the enum
keyword and contain one or more enum constructors.
enum Color {
Red;
Green;
Blue;
RGB(r : Int, g : Int, b : Int);
}
The above enum can be instantiated as follows:
var c1 = Color.Red;
var c2 = Color.RGB(255, 0, 0);
Try the example on try.haxe.org.