
10 Mar
2014
10 Mar
'14
9:59 a.m.
On Mon, 10 Mar 2014 14:54:14 +0100, Niklas Haas
You can derive Data using the DeriveDataTypeable extension and then use the toConstr :: Data a => a -> Constr method to obtain the Constr (which has a Show instance that in this case just returns "A", "B" etc.)
Oops, you are asking about the other direction. Well, you're in luck here too - Data has readConstr :: DataType -> String -> Maybe Constr.