News for hackers. Stuff that matters.
Re:Python's sad, unimaginative Enum by tikhonj on Saturday May 11, 2013 @05:18PM (#5692130)
Not just arguably--that's exactly what they are. E.g., in Haskell:

    data Suit = Spades
              | Hearts
              | Clubs
              | Diamonds deriving (Show, Eq, Bounded, Enum)
this creates a type that acts exactly like an enum. With the added benefit of having a well-defined string representation and maxBound/minBound constants for free.

There are no comments on this comment yet.