Safe Haskell | None |
---|
Abstract syntax of global declarations.
Definitions for: TyDecl
and ConDecl
, ClassDecl
,
InstDecl
, DefaultDecl
and ForeignDecl
.
- data HsDecl id
- = TyClD (TyClDecl id)
- | InstD (InstDecl id)
- | DerivD (DerivDecl id)
- | ValD (HsBind id)
- | SigD (Sig id)
- | DefD (DefaultDecl id)
- | ForD (ForeignDecl id)
- | WarningD (WarnDecl id)
- | AnnD (AnnDecl id)
- | RuleD (RuleDecl id)
- | VectD (VectDecl id)
- | SpliceD (SpliceDecl id)
- | DocD DocDecl
- | QuasiQuoteD (HsQuasiQuote id)
- type LHsDecl id = Located (HsDecl id)
- data HsTyDefn name
- data TyClDecl name
- = ForeignType {
- tcdLName :: Located name
- tcdExtName :: Maybe FastString
- | TyFamily {
- tcdFlavour :: FamilyFlavour
- tcdLName :: Located name
- tcdTyVars :: LHsTyVarBndrs name
- tcdKindSig :: Maybe (LHsKind name)
- | TyDecl { }
- | ClassDecl { }
- = ForeignType {
- type LTyClDecl name = Located (TyClDecl name)
- type TyClGroup name = [LTyClDecl name]
- isClassDecl :: TyClDecl name -> Bool
- isDataDecl :: TyClDecl name -> Bool
- isSynDecl :: TyClDecl name -> Bool
- isFamilyDecl :: TyClDecl name -> Bool
- isHsDataDefn :: HsTyDefn name -> Bool
- isHsSynDefn :: HsTyDefn name -> Bool
- tcdName :: TyClDecl name -> name
- famInstDeclName :: LFamInstDecl a -> a
- countTyClDecls :: [TyClDecl name] -> (Int, Int, Int, Int, Int)
- pprTyDefnFlavour :: HsTyDefn a -> SDoc
- pprTyClDeclFlavour :: TyClDecl a -> SDoc
- data InstDecl name
- = ClsInstD {
- cid_poly_ty :: LHsType name
- cid_binds :: LHsBinds name
- cid_sigs :: [LSig name]
- cid_fam_insts :: [LFamInstDecl name]
- | FamInstD {
- lid_inst :: FamInstDecl name
- = ClsInstD {
- type LInstDecl name = Located (InstDecl name)
- data NewOrData
- data FamilyFlavour
- = TypeFamily
- | DataFamily
- data FamInstDecl name = FamInstDecl {}
- type LFamInstDecl name = Located (FamInstDecl name)
- instDeclFamInsts :: [LInstDecl name] -> [FamInstDecl name]
- data DerivDecl name = DerivDecl {
- deriv_type :: LHsType name
- type LDerivDecl name = Located (DerivDecl name)
- data RuleDecl name = HsRule RuleName Activation [RuleBndr name] (Located (HsExpr name)) NameSet (Located (HsExpr name)) NameSet
- type LRuleDecl name = Located (RuleDecl name)
- data RuleBndr name
- = RuleBndr (Located name)
- | RuleBndrSig (Located name) (HsWithBndrs (LHsType name))
- collectRuleBndrSigTys :: [RuleBndr name] -> [HsWithBndrs (LHsType name)]
- data VectDecl name
- = HsVect (Located name) (Maybe (LHsExpr name))
- | HsNoVect (Located name)
- | HsVectTypeIn Bool (Located name) (Maybe (Located name))
- | HsVectTypeOut Bool TyCon (Maybe TyCon)
- | HsVectClassIn (Located name)
- | HsVectClassOut Class
- | HsVectInstIn (LHsType name)
- | HsVectInstOut ClsInst
- type LVectDecl name = Located (VectDecl name)
- lvectDeclName :: NamedThing name => LVectDecl name -> Name
- lvectInstDecl :: LVectDecl name -> Bool
- data DefaultDecl name = DefaultDecl [LHsType name]
- type LDefaultDecl name = Located (DefaultDecl name)
- data SpliceDecl id = SpliceDecl (Located (HsExpr id)) HsExplicitFlag
- data ForeignDecl name
- = ForeignImport (Located name) (LHsType name) Coercion ForeignImport
- | ForeignExport (Located name) (LHsType name) Coercion ForeignExport
- type LForeignDecl name = Located (ForeignDecl name)
- data ForeignImport = CImport CCallConv Safety (Maybe Header) CImportSpec
- data ForeignExport = CExport CExportSpec
- noForeignImportCoercionYet :: Coercion
- noForeignExportCoercionYet :: Coercion
- data CImportSpec
- data ConDecl name = ConDecl {
- con_name :: Located name
- con_explicit :: HsExplicitFlag
- con_qvars :: LHsTyVarBndrs name
- con_cxt :: LHsContext name
- con_details :: HsConDeclDetails name
- con_res :: ResType (LHsType name)
- con_doc :: Maybe LHsDocString
- con_old_rec :: Bool
- type LConDecl name = Located (ConDecl name)
- data ResType ty
- type HsConDeclDetails name = HsConDetails (LBangType name) [ConDeclField name]
- hsConDeclArgTys :: HsConDeclDetails name -> [LBangType name]
- data DocDecl
- type LDocDecl = Located DocDecl
- docDeclDoc :: DocDecl -> HsDocString
- data WarnDecl name = Warning name WarningTxt
- type LWarnDecl name = Located (WarnDecl name)
- data AnnDecl name = HsAnnotation (AnnProvenance name) (Located (HsExpr name))
- type LAnnDecl name = Located (AnnDecl name)
- data AnnProvenance name
- = ValueAnnProvenance name
- | TypeAnnProvenance name
- | ModuleAnnProvenance
- annProvenanceName_maybe :: AnnProvenance name -> Maybe name
- modifyAnnProvenanceNameM :: Monad m => (before -> m after) -> AnnProvenance before -> m (AnnProvenance after)
- data HsGroup id = HsGroup {
- hs_valds :: HsValBinds id
- hs_tyclds :: [[LTyClDecl id]]
- hs_instds :: [LInstDecl id]
- hs_derivds :: [LDerivDecl id]
- hs_fixds :: [LFixitySig id]
- hs_defds :: [LDefaultDecl id]
- hs_fords :: [LForeignDecl id]
- hs_warnds :: [LWarnDecl id]
- hs_annds :: [LAnnDecl id]
- hs_ruleds :: [LRuleDecl id]
- hs_vects :: [LVectDecl id]
- hs_docs :: [LDocDecl]
- emptyRdrGroup :: HsGroup a
- emptyRnGroup :: HsGroup a
- appendGroups :: HsGroup a -> HsGroup a -> HsGroup a
Toplevel declarations
A Haskell Declaration
TyClD (TyClDecl id) | A type or class declaration. |
InstD (InstDecl id) | An instance declaration. |
DerivD (DerivDecl id) | |
ValD (HsBind id) | |
SigD (Sig id) | |
DefD (DefaultDecl id) | |
ForD (ForeignDecl id) | |
WarningD (WarnDecl id) | |
AnnD (AnnDecl id) | |
RuleD (RuleDecl id) | |
VectD (VectDecl id) | |
SpliceD (SpliceDecl id) | |
DocD DocDecl | |
QuasiQuoteD (HsQuasiQuote id) |
Typeable1 HsDecl | |
(Typeable (HsDecl id), Data id) => Data (HsDecl id) | |
OutputableBndr name => Outputable (HsDecl name) |
TySynonym | Synonym expansion |
TyData | Declares a data type or newtype, giving its construcors
|
|
Typeable1 HsTyDefn | |
(Typeable (HsTyDefn name), Data name) => Data (HsTyDefn name) | |
OutputableBndr name => Outputable (HsTyDefn name) |
Class or type declarations
A type or class declaration.
ForeignType | |
| |
TyFamily | type/data family T :: *->* |
| |
TyDecl | |
| |
ClassDecl | |
|
Typeable1 TyClDecl | |
(Typeable (TyClDecl name), Data name) => Data (TyClDecl name) | |
OutputableBndr name => Outputable (TyClDecl name) |
isClassDecl :: TyClDecl name -> BoolSource
type class
isDataDecl :: TyClDecl name -> BoolSource
True
= argument is a data
/newtype
declaration.
isFamilyDecl :: TyClDecl name -> BoolSource
type family declaration
isHsDataDefn :: HsTyDefn name -> BoolSource
isHsSynDefn :: HsTyDefn name -> BoolSource
famInstDeclName :: LFamInstDecl a -> aSource
pprTyDefnFlavour :: HsTyDefn a -> SDocSource
pprTyClDeclFlavour :: TyClDecl a -> SDocSource
Instance declarations
ClsInstD | |
| |
FamInstD | |
|
Typeable1 InstDecl | |
(Typeable (InstDecl name), Data name) => Data (InstDecl name) | |
OutputableBndr name => Outputable (InstDecl name) |
data FamilyFlavour Source
TypeFamily | type family ... |
DataFamily | data family ... |
data FamInstDecl name Source
Typeable1 FamInstDecl | |
(Typeable (FamInstDecl name), Data name) => Data (FamInstDecl name) | |
OutputableBndr name => Outputable (FamInstDecl name) |
type LFamInstDecl name = Located (FamInstDecl name)Source
instDeclFamInsts :: [LInstDecl name] -> [FamInstDecl name]Source
Standalone deriving declarations
DerivDecl | |
|
Typeable1 DerivDecl | |
(Typeable (DerivDecl name), Data name) => Data (DerivDecl name) | |
OutputableBndr name => Outputable (DerivDecl name) |
type LDerivDecl name = Located (DerivDecl name)Source
RULE
declarations
HsRule RuleName Activation [RuleBndr name] (Located (HsExpr name)) NameSet (Located (HsExpr name)) NameSet |
Typeable1 RuleDecl | |
(Typeable (RuleDecl name), Data name) => Data (RuleDecl name) | |
OutputableBndr name => Outputable (RuleDecl name) |
RuleBndr (Located name) | |
RuleBndrSig (Located name) (HsWithBndrs (LHsType name)) |
Typeable1 RuleBndr | |
(Typeable (RuleBndr name), Data name) => Data (RuleBndr name) | |
OutputableBndr name => Outputable (RuleBndr name) |
collectRuleBndrSigTys :: [RuleBndr name] -> [HsWithBndrs (LHsType name)]Source
VECTORISE
declarations
HsVect (Located name) (Maybe (LHsExpr name)) | |
HsNoVect (Located name) | |
HsVectTypeIn Bool (Located name) (Maybe (Located name)) | |
HsVectTypeOut Bool TyCon (Maybe TyCon) | |
HsVectClassIn (Located name) | |
HsVectClassOut Class | |
HsVectInstIn (LHsType name) | |
HsVectInstOut ClsInst |
Typeable1 VectDecl | |
(Typeable (VectDecl name), Data name) => Data (VectDecl name) | |
OutputableBndr name => Outputable (VectDecl name) |
lvectDeclName :: NamedThing name => LVectDecl name -> NameSource
lvectInstDecl :: LVectDecl name -> BoolSource
default
declarations
data DefaultDecl name Source
DefaultDecl [LHsType name] |
Typeable1 DefaultDecl | |
(Typeable (DefaultDecl name), Data name) => Data (DefaultDecl name) | |
OutputableBndr name => Outputable (DefaultDecl name) |
type LDefaultDecl name = Located (DefaultDecl name)Source
Top-level template haskell splice
data SpliceDecl id Source
SpliceDecl (Located (HsExpr id)) HsExplicitFlag |
Typeable1 SpliceDecl | |
(Typeable (SpliceDecl id), Data id) => Data (SpliceDecl id) | |
OutputableBndr name => Outputable (SpliceDecl name) |
Foreign function interface declarations
data ForeignDecl name Source
ForeignImport (Located name) (LHsType name) Coercion ForeignImport | |
ForeignExport (Located name) (LHsType name) Coercion ForeignExport |
Typeable1 ForeignDecl | |
(Typeable (ForeignDecl name), Data name) => Data (ForeignDecl name) | |
OutputableBndr name => Outputable (ForeignDecl name) |
type LForeignDecl name = Located (ForeignDecl name)Source
data ForeignImport Source
data ForeignExport Source
data CImportSpec Source
Data-constructor declarations
ConDecl | |
|
Typeable1 ConDecl | |
(Typeable (ConDecl name), Data name) => Data (ConDecl name) | |
OutputableBndr name => Outputable (ConDecl name) |
Typeable1 ResType | |
(Typeable (ResType ty), Data ty) => Data (ResType ty) | |
Outputable ty => Outputable (ResType ty) |
type HsConDeclDetails name = HsConDetails (LBangType name) [ConDeclField name]Source
hsConDeclArgTys :: HsConDeclDetails name -> [LBangType name]Source
Document comments
Deprecations
Warning name WarningTxt |
Typeable1 WarnDecl | |
(Typeable (WarnDecl name), Data name) => Data (WarnDecl name) | |
OutputableBndr name => Outputable (WarnDecl name) |
Annotations
HsAnnotation (AnnProvenance name) (Located (HsExpr name)) |
Typeable1 AnnDecl | |
(Typeable (AnnDecl name), Data name) => Data (AnnDecl name) | |
OutputableBndr name => Outputable (AnnDecl name) |
data AnnProvenance name Source
Typeable1 AnnProvenance | |
(Typeable (AnnProvenance name), Data name) => Data (AnnProvenance name) |
annProvenanceName_maybe :: AnnProvenance name -> Maybe nameSource
modifyAnnProvenanceNameM :: Monad m => (before -> m after) -> AnnProvenance before -> m (AnnProvenance after)Source
Grouping
HsGroup | |
|
Typeable1 HsGroup | |
(Typeable (HsGroup id), Data id) => Data (HsGroup id) | |
OutputableBndr name => Outputable (HsGroup name) |
appendGroups :: HsGroup a -> HsGroup a -> HsGroup aSource