- tcdCtxt :: HsContext name, -- Context
- tcdName :: name, -- Type constructor
- tcdTyVars :: [HsTyVarBndr name], -- Type variables
- tcdCons :: [ConDecl name], -- Data constructors
- tcdDerivs :: Maybe (HsContext name), -- Derivings; Nothing => not specified
- -- Just [] => derive exactly what is asked
- tcdLoc :: SrcLoc
+ tcdCtxt :: LHsContext name, -- Context
+ tcdLName :: Located name, -- Type constructor
+ tcdTyVars :: [LHsTyVarBndr name], -- Type variables
+ tcdKindSig :: Maybe Kind, -- Optional kind sig;
+ -- (only for the 'where' form)
+
+ tcdCons :: [LConDecl name], -- Data constructors
+ -- For data T a = T1 | T2 a the LConDecls are all ConDecls
+ -- For data T a where { T1 :: T a } the LConDecls are all GadtDecls
+
+ tcdDerivs :: Maybe [LHsType name]
+ -- Derivings; Nothing => not specified
+ -- Just [] => derive exactly what is asked
+ -- These "types" must be of form
+ -- forall ab. C ty1 ty2
+ -- Typically the foralls and ty args are empty, but they
+ -- are non-empty for the newtype-deriving case