Safe Haskell | Safe-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
http://homepages.cwi.nl/~ralf/syb3/code.html.
Documentation
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.