Safe Haskell | None |
---|---|
Language | Haskell98 |
Abstract syntax of global declarations.
Definitions for: SynDecl
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)
- | RoleAnnotD (RoleAnnotDecl id)
- type LHsDecl id = Located (HsDecl id)
- data HsDataDefn name = HsDataDefn {}
- data TyClDecl name
- = ForeignType {
- tcdLName :: Located name
- tcdExtName :: Maybe FastString
- | FamDecl {
- tcdFam :: FamilyDecl name
- | SynDecl { }
- | DataDecl {
- tcdLName :: Located name
- tcdTyVars :: LHsTyVarBndrs name
- tcdDataDefn :: HsDataDefn name
- tcdFVs :: NameSet
- | ClassDecl { }
- = ForeignType {
- type LTyClDecl name = Located (TyClDecl name)
- data TyClGroup name = TyClGroup {
- group_tyclds :: [LTyClDecl name]
- group_roles :: [LRoleAnnotDecl name]
- tyClGroupConcat :: [TyClGroup name] -> [LTyClDecl name]
- mkTyClGroup :: [LTyClDecl name] -> TyClGroup name
- isClassDecl :: TyClDecl name -> Bool
- isDataDecl :: TyClDecl name -> Bool
- isSynDecl :: TyClDecl name -> Bool
- tcdName :: TyClDecl name -> name
- isFamilyDecl :: TyClDecl name -> Bool
- isTypeFamilyDecl :: TyClDecl name -> Bool
- isDataFamilyDecl :: TyClDecl name -> Bool
- isOpenTypeFamilyInfo :: FamilyInfo name -> Bool
- isClosedTypeFamilyInfo :: FamilyInfo name -> Bool
- tyFamInstDeclName :: OutputableBndr name => TyFamInstDecl name -> name
- tyFamInstDeclLName :: OutputableBndr name => TyFamInstDecl name -> Located name
- countTyClDecls :: [TyClDecl name] -> (Int, Int, Int, Int, Int)
- pprTyClDeclFlavour :: TyClDecl a -> SDoc
- tyClDeclLName :: TyClDecl name -> Located name
- tyClDeclTyVars :: OutputableBndr name => TyClDecl name -> LHsTyVarBndrs name
- data FamilyDecl name = FamilyDecl {
- fdInfo :: FamilyInfo name
- fdLName :: Located name
- fdTyVars :: LHsTyVarBndrs name
- fdKindSig :: Maybe (LHsKind name)
- type LFamilyDecl name = Located (FamilyDecl name)
- data InstDecl name
- = ClsInstD {
- cid_inst :: ClsInstDecl name
- | DataFamInstD {
- dfid_inst :: DataFamInstDecl name
- | TyFamInstD {
- tfid_inst :: TyFamInstDecl name
- = ClsInstD {
- type LInstDecl name = Located (InstDecl name)
- data NewOrData
- data FamilyInfo name
- = DataFamily
- | OpenTypeFamily
- | ClosedTypeFamily [LTyFamInstEqn name]
- data TyFamInstDecl name = TyFamInstDecl {
- tfid_eqn :: LTyFamInstEqn name
- tfid_fvs :: NameSet
- type LTyFamInstDecl name = Located (TyFamInstDecl name)
- instDeclDataFamInsts :: [LInstDecl name] -> [DataFamInstDecl name]
- data DataFamInstDecl name = DataFamInstDecl {
- dfid_tycon :: Located name
- dfid_pats :: HsWithBndrs [LHsType name]
- dfid_defn :: HsDataDefn name
- dfid_fvs :: NameSet
- type LDataFamInstDecl name = Located (DataFamInstDecl name)
- pprDataFamInstFlavour :: DataFamInstDecl name -> SDoc
- data TyFamInstEqn name = TyFamInstEqn {
- tfie_tycon :: Located name
- tfie_pats :: HsWithBndrs [LHsType name]
- tfie_rhs :: LHsType name
- type LTyFamInstEqn name = Located (TyFamInstEqn name)
- type LClsInstDecl name = Located (ClsInstDecl name)
- data ClsInstDecl name = ClsInstDecl {
- cid_poly_ty :: LHsType name
- cid_binds :: LHsBinds name
- cid_sigs :: [LSig name]
- cid_tyfam_insts :: [LTyFamInstDecl name]
- cid_datafam_insts :: [LDataFamInstDecl 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) (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 (HsSplice id)) HsExplicitFlag
- type LSpliceDecl name = Located (SpliceDecl name)
- 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
- data RoleAnnotDecl name = RoleAnnotDecl (Located name) [Located (Maybe Role)]
- type LRoleAnnotDecl name = Located (RoleAnnotDecl name)
- roleAnnotDeclName :: RoleAnnotDecl name -> name
- data HsGroup id = HsGroup {
- hs_valds :: HsValBinds id
- hs_splcds :: [LSpliceDecl id]
- hs_tyclds :: [TyClGroup 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) | |
RoleAnnotD (RoleAnnotDecl id) |
Data id => Data (HsDecl id) | |
OutputableBndr name => Outputable (HsDecl name) | |
Typeable (* -> *) HsDecl |
data HsDataDefn nameSource
HsDataDefn | Declares a data type or newtype, giving its constructors
|
|
Data name => Data (HsDataDefn name) | |
OutputableBndr name => Outputable (HsDataDefn name) | |
Typeable (* -> *) HsDataDefn |
Class or type declarations
A type or class declaration.
ForeignType | |
| |
FamDecl | type/data family T :: *->* |
| |
SynDecl |
|
| |
DataDecl |
|
| |
ClassDecl | |
|
Data name => Data (TyClDecl name) | |
OutputableBndr name => Outputable (TyClDecl name) | |
Typeable (* -> *) TyClDecl |
TyClGroup | |
|
Data name => Data (TyClGroup name) | |
OutputableBndr name => Outputable (TyClGroup name) | |
Typeable (* -> *) TyClGroup |
tyClGroupConcat :: [TyClGroup name] -> [LTyClDecl name]Source
mkTyClGroup :: [LTyClDecl name] -> TyClGroup nameSource
isClassDecl :: TyClDecl name -> BoolSource
type class
isDataDecl :: TyClDecl name -> BoolSource
True
= argument is a data
/newtype
declaration.
isFamilyDecl :: TyClDecl name -> BoolSource
type/data family declaration
isTypeFamilyDecl :: TyClDecl name -> BoolSource
type family declaration
isDataFamilyDecl :: TyClDecl name -> BoolSource
data family declaration
isOpenTypeFamilyInfo :: FamilyInfo name -> BoolSource
open type family info
isClosedTypeFamilyInfo :: FamilyInfo name -> BoolSource
closed type family info
tyFamInstDeclName :: OutputableBndr name => TyFamInstDecl name -> nameSource
tyFamInstDeclLName :: OutputableBndr name => TyFamInstDecl name -> Located nameSource
pprTyClDeclFlavour :: TyClDecl a -> SDocSource
tyClDeclLName :: TyClDecl name -> Located nameSource
tyClDeclTyVars :: OutputableBndr name => TyClDecl name -> LHsTyVarBndrs nameSource
data FamilyDecl nameSource
FamilyDecl | |
|
Data name => Data (FamilyDecl name) | |
OutputableBndr name => Outputable (FamilyDecl name) | |
Typeable (* -> *) FamilyDecl |
type LFamilyDecl name = Located (FamilyDecl name)Source
Instance declarations
ClsInstD | |
| |
DataFamInstD | |
| |
TyFamInstD | |
|
Data name => Data (InstDecl name) | |
OutputableBndr name => Outputable (InstDecl name) | |
Typeable (* -> *) InstDecl |
data FamilyInfo nameSource
Data name => Data (FamilyInfo name) | |
Outputable (FamilyInfo name) | |
Typeable (* -> *) FamilyInfo |
data TyFamInstDecl nameSource
TyFamInstDecl | |
|
Data name => Data (TyFamInstDecl name) | |
OutputableBndr name => Outputable (TyFamInstDecl name) | |
Typeable (* -> *) TyFamInstDecl |
type LTyFamInstDecl name = Located (TyFamInstDecl name)Source
instDeclDataFamInsts :: [LInstDecl name] -> [DataFamInstDecl name]Source
data DataFamInstDecl nameSource
DataFamInstDecl | |
|
Data name => Data (DataFamInstDecl name) | |
OutputableBndr name => Outputable (DataFamInstDecl name) | |
Typeable (* -> *) DataFamInstDecl |
type LDataFamInstDecl name = Located (DataFamInstDecl name)Source
pprDataFamInstFlavour :: DataFamInstDecl name -> SDocSource
data TyFamInstEqn nameSource
One equation in a type family instance declaration
TyFamInstEqn | |
|
Data name => Data (TyFamInstEqn name) | |
OutputableBndr name => Outputable (TyFamInstEqn name) | |
Typeable (* -> *) TyFamInstEqn |
type LTyFamInstEqn name = Located (TyFamInstEqn name)Source
type LClsInstDecl name = Located (ClsInstDecl name)Source
data ClsInstDecl nameSource
ClsInstDecl | |
|
Data name => Data (ClsInstDecl name) | |
OutputableBndr name => Outputable (ClsInstDecl name) | |
Typeable (* -> *) ClsInstDecl |
Standalone deriving declarations
DerivDecl | |
|
Data name => Data (DerivDecl name) | |
OutputableBndr name => Outputable (DerivDecl name) | |
Typeable (* -> *) DerivDecl |
type LDerivDecl name = Located (DerivDecl name)Source
RULE
declarations
HsRule RuleName Activation [RuleBndr name] (Located (HsExpr name)) NameSet (Located (HsExpr name)) NameSet |
Data name => Data (RuleDecl name) | |
OutputableBndr name => Outputable (RuleDecl name) | |
Typeable (* -> *) RuleDecl |
RuleBndr (Located name) | |
RuleBndrSig (Located name) (HsWithBndrs (LHsType name)) |
Data name => Data (RuleBndr name) | |
OutputableBndr name => Outputable (RuleBndr name) | |
Typeable (* -> *) RuleBndr |
collectRuleBndrSigTys :: [RuleBndr name] -> [HsWithBndrs (LHsType name)]Source
VECTORISE
declarations
HsVect (Located name) (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 |
Data name => Data (VectDecl name) | |
OutputableBndr name => Outputable (VectDecl name) | |
Typeable (* -> *) VectDecl |
lvectDeclName :: NamedThing name => LVectDecl name -> NameSource
lvectInstDecl :: LVectDecl name -> BoolSource
default
declarations
data DefaultDecl nameSource
DefaultDecl [LHsType name] |
Data name => Data (DefaultDecl name) | |
OutputableBndr name => Outputable (DefaultDecl name) | |
Typeable (* -> *) DefaultDecl |
type LDefaultDecl name = Located (DefaultDecl name)Source
Template haskell declaration splice
data SpliceDecl idSource
SpliceDecl (Located (HsSplice id)) HsExplicitFlag |
Data id => Data (SpliceDecl id) | |
OutputableBndr name => Outputable (SpliceDecl name) | |
Typeable (* -> *) SpliceDecl |
type LSpliceDecl name = Located (SpliceDecl name)Source
Foreign function interface declarations
data ForeignDecl nameSource
ForeignImport (Located name) (LHsType name) Coercion ForeignImport | |
ForeignExport (Located name) (LHsType name) Coercion ForeignExport |
Data name => Data (ForeignDecl name) | |
OutputableBndr name => Outputable (ForeignDecl name) | |
Typeable (* -> *) ForeignDecl |
type LForeignDecl name = Located (ForeignDecl name)Source
data ForeignImportSource
data ForeignExportSource
data CImportSpecSource
Data-constructor declarations
ConDecl | |
|
Data name => Data (ConDecl name) | |
OutputableBndr name => Outputable (ConDecl name) | |
Typeable (* -> *) ConDecl |
Data ty => Data (ResType ty) | |
Outputable ty => Outputable (ResType ty) | |
Typeable (* -> *) ResType |
type HsConDeclDetails name = HsConDetails (LBangType name) [ConDeclField name]Source
hsConDeclArgTys :: HsConDeclDetails name -> [LBangType name]Source
Document comments
Deprecations
Warning name WarningTxt |
Data name => Data (WarnDecl name) | |
OutputableBndr name => Outputable (WarnDecl name) | |
Typeable (* -> *) WarnDecl |
Annotations
HsAnnotation (AnnProvenance name) (Located (HsExpr name)) |
Data name => Data (AnnDecl name) | |
OutputableBndr name => Outputable (AnnDecl name) | |
Typeable (* -> *) AnnDecl |
data AnnProvenance nameSource
Functor AnnProvenance | |
Foldable AnnProvenance | |
Traversable AnnProvenance | |
Data name => Data (AnnProvenance name) | |
Typeable (* -> *) AnnProvenance |
annProvenanceName_maybe :: AnnProvenance name -> Maybe nameSource
Role annotations
data RoleAnnotDecl nameSource
RoleAnnotDecl (Located name) [Located (Maybe Role)] |
Data name => Data (RoleAnnotDecl name) | |
OutputableBndr name => Outputable (RoleAnnotDecl name) | |
Typeable (* -> *) RoleAnnotDecl |
type LRoleAnnotDecl name = Located (RoleAnnotDecl name)Source
roleAnnotDeclName :: RoleAnnotDecl name -> nameSource
Grouping
HsGroup | |
|
Data id => Data (HsGroup id) | |
OutputableBndr name => Outputable (HsGroup name) | |
Typeable (* -> *) HsGroup |
appendGroups :: HsGroup a -> HsGroup a -> HsGroup aSource