--
-- * If it is 'Just pats', we have the definition of an indexed type. Then,
-- 'pats' are type patterns for the type-indexes of the type constructor
--- and 'tcdVars' are the variables in those patterns. Hence, the arity of
+-- and 'tcdTyVars' are the variables in those patterns. Hence, the arity of
-- the indexed type (ie, the number of indexes) is 'length tcdTyPats' and
-- *not* 'length tcdVars'.
--
tcdFoType :: FoType
}
+ -- type/data/newtype family T :: *->*
| TyFamily { tcdFlavour:: FamilyFlavour, -- type, new, or data
tcdLName :: Located name, -- type constructor
tcdTyVars :: [LHsTyVarBndr name], -- type variables
tcdKind :: Maybe Kind -- result kind
}
+ -- Declares a data type or newtype, giving its construcors
+ -- data/newtype T a = <constrs>
+ -- data/newtype instance T [a] = <constrs>
| TyData { tcdND :: NewOrData,
tcdCtxt :: LHsContext name, -- Context
tcdLName :: Located name, -- Type constructor
-- Typically the foralls and ty args are empty, but they
-- are non-empty for the newtype-deriving case
}
- -- data instance: tcdPats = Just tys
- --
- -- data: tcdPats = Nothing,
| TySynonym { tcdLName :: Located name, -- type constructor
tcdTyVars :: [LHsTyVarBndr name], -- type variables