GTALib-0.0.5: A library for GTA programming

Safe HaskellSafe-Infered



Copied from, and modified a bit.

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



type TypeInfo = (Name, [TyVarBndr], [(Name, [(Maybe Name, Type)])])Source

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.

typeInfo :: Name -> Q TypeInfoSource

Returns type information of a given type.

simpleName :: Name -> NameSource

Apply nameBase to the name.