I want a datatype to represent a finite set of integers that can be addressed by specific names. I figure the best way to do that is to use an Enum.
However, there is o
instance Enum MyDataType where fromEnum = fromJust . flip lookup table toEnum = fromJust . flip lookup (map swap table) table = [(Foo, 0), (Bar, 1), (Baz, 2)]