I'm looking for a Haskell-ish way to define values for enums. Here is what I currently have:
data Binop
= Plus
| Minus
| Times
| Divide
-- deriving ( Show ) <--- removed this
instance Show Binop where
show Plus = "+"
show Minus = "-"
show Times = "*"
show Divide = "/"
It would be nice to have the constant values ("+", "-" etc.) in the Binop data type.