GTALib-0.0.2: A library for GTA programming

Safe HaskellSafe-Infered



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.

simpleName :: Name -> NameSource

Apply nameBase to the name.