Observing a structure of a datatype in a uniform way no matter whether it was defined in infix, prefix or record form.
This code is based on the
Derive module from the SYB3 code distribution,
(C) 2005, Ralf Laemmel and Simon Peyton Jones, see
The first part is the name, the second - a list of type parameters, the third - a list of constructors. For each constructor we have a name and a list describing constructor fields.
type TypeInfo = (Name, [Name], [(Name, [(Maybe Name, Type)])])