ForeignDecl(..), LForeignDecl, ForeignImport(..), ForeignExport(..),
CImportSpec(..), FoType(..),
ConDecl(..), ResType(..), LConDecl,
- DocDecl(..), LDocDecl, docDeclDoc, DocEntity(..),
+ DocDecl(..), LDocDecl, docDeclDoc,
DeprecDecl(..), LDeprecDecl,
HsGroup(..), emptyRdrGroup, emptyRnGroup, appendGroups,
tcdName, tyClDeclNames, tyClDeclTyVars,
hs_depds :: [LDeprecDecl id],
hs_ruleds :: [LRuleDecl id],
- hs_docs :: [DocEntity id]
- -- Used to remember the module structure,
- -- which is needed to produce Haddock documentation
+ hs_docs :: [LDocDecl id]
}
emptyGroup, emptyRdrGroup, emptyRnGroup :: HsGroup a
--
-- * 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
-- only 'TyData',
-- 'TyFunction',
-- and 'TySynonym'
- tcdDocs :: [DocEntity name] -- Haddock docs
+ tcdDocs :: [LDocDecl name] -- Haddock docs
}
data NewOrData
\begin{code}
--- source code entities, for representing the module structure
-data DocEntity name
- = DeclEntity name
- | DocEntity (DocDecl name)
-
type LDocDecl name = Located (DocDecl name)
data DocDecl name