
1 Dec
2011
1 Dec
'11
5:47 p.m.
Hi,
On 1 December 2011 22:38, Philippe Sismondi
Is it possible to discover the data constructor used to make a value without doing pattern matching?
Yes, it is. constrName :: Data a => a -> String constrName = show . toConstr http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-Data.h... (You can derive *Data* for your data type using the language extension * DeriveDataTypeable*) Hope this helps, Ozgur