Safe Haskell | None |
---|---|
Language | Haskell2010 |
HsDecls
Contents
Description
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 (WarnDecls id)
- | AnnD (AnnDecl id)
- | RuleD (RuleDecls 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
- = FamDecl {
- tcdFam :: FamilyDecl name
- | SynDecl { }
- | DataDecl {
- tcdLName :: Located name
- tcdTyVars :: LHsTyVarBndrs name
- tcdDataDefn :: HsDataDefn name
- tcdFVs :: PostRn name NameSet
- | ClassDecl { }
- = FamDecl {
- 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
- hsDeclHasCusk :: TyClDecl name -> Bool
- famDeclHasCusk :: FamilyDecl name -> Bool
- 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 :: PostRn name NameSet
- type LTyFamInstDecl name = Located (TyFamInstDecl name)
- instDeclDataFamInsts :: [LInstDecl name] -> [DataFamInstDecl name]
- data DataFamInstDecl name = DataFamInstDecl {
- dfid_tycon :: Located name
- dfid_pats :: HsTyPats name
- dfid_defn :: HsDataDefn name
- dfid_fvs :: PostRn name NameSet
- type LDataFamInstDecl name = Located (DataFamInstDecl name)
- pprDataFamInstFlavour :: DataFamInstDecl name -> SDoc
- data TyFamEqn name pats = TyFamEqn {}
- type TyFamInstEqn name = TyFamEqn name (HsTyPats name)
- type LTyFamInstEqn name = Located (TyFamInstEqn name)
- type TyFamDefltEqn name = TyFamEqn name (LHsTyVarBndrs name)
- type LTyFamDefltEqn name = Located (TyFamDefltEqn name)
- type HsTyPats name = HsWithBndrs name [LHsType 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]
- cid_overlap_mode :: Maybe (Located OverlapMode)
- data DerivDecl name = DerivDecl {
- deriv_type :: LHsType name
- deriv_overlap_mode :: Maybe (Located OverlapMode)
- type LDerivDecl name = Located (DerivDecl name)
- type LRuleDecls name = Located (RuleDecls name)
- data RuleDecls name = HsRules {
- rds_src :: SourceText
- rds_rules :: [LRuleDecl name]
- data RuleDecl name = HsRule (Located RuleName) Activation [LRuleBndr name] (Located (HsExpr name)) (PostRn name NameSet) (Located (HsExpr name)) (PostRn name NameSet)
- type LRuleDecl name = Located (RuleDecl name)
- data RuleBndr name
- = RuleBndr (Located name)
- | RuleBndrSig (Located name) (HsWithBndrs name (LHsType name))
- type LRuleBndr name = Located (RuleBndr name)
- collectRuleBndrSigTys :: [RuleBndr name] -> [HsWithBndrs name (LHsType name)]
- flattenRuleDecls :: [LRuleDecls name] -> [LRuleDecl name]
- data VectDecl name
- = HsVect SourceText (Located name) (LHsExpr name)
- | HsNoVect SourceText (Located name)
- | HsVectTypeIn SourceText Bool (Located name) (Maybe (Located name))
- | HsVectTypeOut Bool TyCon (Maybe TyCon)
- | HsVectClassIn SourceText (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 SpliceExplicitFlag
- data SpliceDecl id = SpliceDecl (Located (HsSplice id)) SpliceExplicitFlag
- type LSpliceDecl name = Located (SpliceDecl name)
- data ForeignDecl name
- = ForeignImport (Located name) (LHsType name) (PostTc name Coercion) ForeignImport
- | ForeignExport (Located name) (LHsType name) (PostTc name Coercion) ForeignExport
- type LForeignDecl name = Located (ForeignDecl name)
- data ForeignImport = CImport (Located CCallConv) (Located Safety) (Maybe Header) CImportSpec (Located SourceText)
- data ForeignExport = CExport (Located CExportSpec) (Located SourceText)
- noForeignImportCoercionYet :: PlaceHolder
- noForeignExportCoercionYet :: PlaceHolder
- data CImportSpec
- data ConDecl name = ConDecl {
- con_names :: [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) (Located [LConDeclField name])
- hsConDeclArgTys :: HsConDeclDetails name -> [LBangType name]
- data DocDecl
- type LDocDecl = Located DocDecl
- docDeclDoc :: DocDecl -> HsDocString
- data WarnDecl name = Warning [Located name] WarningTxt
- type LWarnDecl name = Located (WarnDecl name)
- data WarnDecls name = Warnings {
- wd_src :: SourceText
- wd_warnings :: [LWarnDecl name]
- type LWarnDecls name = Located (WarnDecls name)
- data AnnDecl name = HsAnnotation SourceText (AnnProvenance name) (Located (HsExpr name))
- type LAnnDecl name = Located (AnnDecl name)
- data AnnProvenance name
- = ValueAnnProvenance (Located name)
- | TypeAnnProvenance (Located 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 :: [LWarnDecls id]
- hs_annds :: [LAnnDecl id]
- hs_ruleds :: [LRuleDecls 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
Constructors
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 (WarnDecls id) | |
AnnD (AnnDecl id) | |
RuleD (RuleDecls id) | |
VectD (VectDecl id) | |
SpliceD (SpliceDecl id) | |
DocD DocDecl | |
QuasiQuoteD (HsQuasiQuote id) | |
RoleAnnotD (RoleAnnotDecl id) |
Instances
DataId id => Data (HsDecl id) | |
OutputableBndr name => Outputable (HsDecl name) | |
Typeable (* -> *) HsDecl |
data HsDataDefn name Source
Constructors
HsDataDefn | Declares a data type or newtype, giving its constructors
|
Fields
|
Instances
DataId id => Data (HsDataDefn id) | |
OutputableBndr name => Outputable (HsDataDefn name) | |
Typeable (* -> *) HsDataDefn |
Class or type declarations
A type or class declaration.
Constructors
FamDecl | type/data family T :: *->* |
Fields
| |
SynDecl |
|
DataDecl |
|
Fields
| |
ClassDecl | |
Fields
|
Instances
DataId id => Data (TyClDecl id) | |
OutputableBndr name => Outputable (TyClDecl name) | |
Typeable (* -> *) TyClDecl |
Constructors
TyClGroup | |
Fields
|
Instances
DataId id => Data (TyClGroup id) | |
OutputableBndr name => Outputable (TyClGroup name) | |
Typeable (* -> *) TyClGroup |
tyClGroupConcat :: [TyClGroup name] -> [LTyClDecl name] Source
mkTyClGroup :: [LTyClDecl name] -> TyClGroup name Source
isClassDecl :: TyClDecl name -> Bool Source
type class
isDataDecl :: TyClDecl name -> Bool Source
True
= argument is a data
/newtype
declaration.
isFamilyDecl :: TyClDecl name -> Bool Source
type/data family declaration
isTypeFamilyDecl :: TyClDecl name -> Bool Source
type family declaration
isDataFamilyDecl :: TyClDecl name -> Bool Source
data family declaration
isOpenTypeFamilyInfo :: FamilyInfo name -> Bool Source
open type family info
isClosedTypeFamilyInfo :: FamilyInfo name -> Bool Source
closed type family info
tyFamInstDeclName :: OutputableBndr name => TyFamInstDecl name -> name Source
tyFamInstDeclLName :: OutputableBndr name => TyFamInstDecl name -> Located name Source
pprTyClDeclFlavour :: TyClDecl a -> SDoc Source
tyClDeclLName :: TyClDecl name -> Located name Source
tyClDeclTyVars :: OutputableBndr name => TyClDecl name -> LHsTyVarBndrs name Source
hsDeclHasCusk :: TyClDecl name -> Bool Source
Does this declaration have a complete, user-supplied kind signature? See Note [Complete user-supplied kind signatures]
famDeclHasCusk :: FamilyDecl name -> Bool Source
Does this family declaration have a complete, user-supplied kind signature?
data FamilyDecl name Source
Constructors
FamilyDecl | |
Fields
|
Instances
DataId id => Data (FamilyDecl id) | |
OutputableBndr name => Outputable (FamilyDecl name) | |
Typeable (* -> *) FamilyDecl |
type LFamilyDecl name = Located (FamilyDecl name) Source
Instance declarations
Constructors
ClsInstD | |
Fields
| |
DataFamInstD | |
Fields
| |
TyFamInstD | |
Fields
|
Instances
DataId id => Data (InstDecl id) | |
OutputableBndr name => Outputable (InstDecl name) | |
Typeable (* -> *) InstDecl |
data FamilyInfo name Source
Constructors
DataFamily | |
OpenTypeFamily | |
ClosedTypeFamily [LTyFamInstEqn name] |
Instances
DataId name => Data (FamilyInfo name) | |
Outputable (FamilyInfo name) | |
Typeable (* -> *) FamilyInfo |
data TyFamInstDecl name Source
Constructors
TyFamInstDecl | |
Fields
|
Instances
DataId 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 name Source
Constructors
DataFamInstDecl | |
Fields
|
Instances
DataId name => Data (DataFamInstDecl name) | |
OutputableBndr name => Outputable (DataFamInstDecl name) | |
Typeable (* -> *) DataFamInstDecl |
type LDataFamInstDecl name = Located (DataFamInstDecl name) Source
pprDataFamInstFlavour :: DataFamInstDecl name -> SDoc Source
data TyFamEqn name pats Source
One equation in a type family instance declaration See Note [Type family instance declarations in HsSyn]
Constructors
TyFamEqn | |
type TyFamInstEqn name = TyFamEqn name (HsTyPats name) Source
type LTyFamInstEqn name Source
Arguments
= Located (TyFamInstEqn name) | May have |
type TyFamDefltEqn name = TyFamEqn name (LHsTyVarBndrs name) Source
type LTyFamDefltEqn name = Located (TyFamDefltEqn name) Source
Arguments
= HsWithBndrs name [LHsType name] | Type patterns (with kind and type bndrs) See Note [Family instance declaration binders] |
type LClsInstDecl name = Located (ClsInstDecl name) Source
data ClsInstDecl name Source
Constructors
ClsInstDecl | |
Fields
|
Instances
DataId id => Data (ClsInstDecl id) | |
OutputableBndr name => Outputable (ClsInstDecl name) | |
Typeable (* -> *) ClsInstDecl |
Standalone deriving declarations
Constructors
DerivDecl | |
Fields
|
Instances
DataId name => Data (DerivDecl name) | |
OutputableBndr name => Outputable (DerivDecl name) | |
Typeable (* -> *) DerivDecl |
type LDerivDecl name = Located (DerivDecl name) Source
RULE
declarations
type LRuleDecls name = Located (RuleDecls name) Source
Constructors
HsRules | |
Fields
|
Instances
DataId name => Data (RuleDecls name) | |
OutputableBndr name => Outputable (RuleDecls name) | |
Typeable (* -> *) RuleDecls |
Constructors
HsRule (Located RuleName) Activation [LRuleBndr name] (Located (HsExpr name)) (PostRn name NameSet) (Located (HsExpr name)) (PostRn name NameSet) |
Instances
DataId name => Data (RuleDecl name) | |
OutputableBndr name => Outputable (RuleDecl name) | |
Typeable (* -> *) RuleDecl |
Constructors
RuleBndr (Located name) | |
RuleBndrSig (Located name) (HsWithBndrs name (LHsType name)) |
Instances
DataId name => Data (RuleBndr name) | |
OutputableBndr name => Outputable (RuleBndr name) | |
Typeable (* -> *) RuleBndr |
collectRuleBndrSigTys :: [RuleBndr name] -> [HsWithBndrs name (LHsType name)] Source
flattenRuleDecls :: [LRuleDecls name] -> [LRuleDecl name] Source
VECTORISE
declarations
Constructors
HsVect SourceText (Located name) (LHsExpr name) | |
HsNoVect SourceText (Located name) | |
HsVectTypeIn SourceText Bool (Located name) (Maybe (Located name)) | |
HsVectTypeOut Bool TyCon (Maybe TyCon) | |
HsVectClassIn SourceText (Located name) | |
HsVectClassOut Class | |
HsVectInstIn (LHsType name) | |
HsVectInstOut ClsInst |
Instances
DataId name => Data (VectDecl name) | |
OutputableBndr name => Outputable (VectDecl name) | |
Typeable (* -> *) VectDecl |
lvectDeclName :: NamedThing name => LVectDecl name -> Name Source
lvectInstDecl :: LVectDecl name -> Bool Source
default
declarations
data DefaultDecl name Source
Constructors
DefaultDecl [LHsType name] |
Instances
DataId name => Data (DefaultDecl name) | |
OutputableBndr name => Outputable (DefaultDecl name) | |
Typeable (* -> *) DefaultDecl |
type LDefaultDecl name = Located (DefaultDecl name) Source
Template haskell declaration splice
data SpliceExplicitFlag Source
Constructors
ExplicitSplice | |
ImplicitSplice |
data SpliceDecl id Source
Constructors
SpliceDecl (Located (HsSplice id)) SpliceExplicitFlag |
Instances
DataId id => Data (SpliceDecl id) | |
OutputableBndr name => Outputable (SpliceDecl name) | |
Typeable (* -> *) SpliceDecl |
type LSpliceDecl name = Located (SpliceDecl name) Source
Foreign function interface declarations
data ForeignDecl name Source
Constructors
ForeignImport (Located name) (LHsType name) (PostTc name Coercion) ForeignImport | |
ForeignExport (Located name) (LHsType name) (PostTc name Coercion) ForeignExport |
Instances
DataId name => Data (ForeignDecl name) | |
OutputableBndr name => Outputable (ForeignDecl name) | |
Typeable (* -> *) ForeignDecl |
type LForeignDecl name = Located (ForeignDecl name) Source
data ForeignImport Source
Constructors
CImport (Located CCallConv) (Located Safety) (Maybe Header) CImportSpec (Located SourceText) |
Instances
Data-constructor declarations
data T b = forall a. Eq a => MkT a b MkT :: forall b a. Eq a => MkT a b data T b where MkT1 :: Int -> T Int data T = IntMkT
Int | MkT2 data T a where IntMkT
Int :: T Int
Constructors
ConDecl | |
Fields
|
Instances
DataId name => Data (ConDecl name) | |
OutputableBndr name => Outputable (ConDecl name) | |
Typeable (* -> *) ConDecl |
Arguments
= Located (ConDecl name) | May have |
Instances
Data ty => Data (ResType ty) | |
Outputable ty => Outputable (ResType ty) | |
Typeable (* -> *) ResType |
type HsConDeclDetails name = HsConDetails (LBangType name) (Located [LConDeclField name]) Source
hsConDeclArgTys :: HsConDeclDetails name -> [LBangType name] Source
Document comments
docDeclDoc :: DocDecl -> HsDocString Source
Deprecations
Constructors
Warning [Located name] WarningTxt |
Instances
Data name => Data (WarnDecl name) | |
OutputableBndr name => Outputable (WarnDecl name) | |
Typeable (* -> *) WarnDecl |
Constructors
Warnings | |
Fields
|
Instances
Data name => Data (WarnDecls name) | |
OutputableBndr name => Outputable (WarnDecls name) | |
Typeable (* -> *) WarnDecls |
type LWarnDecls name = Located (WarnDecls name) Source
Annotations
Constructors
HsAnnotation SourceText (AnnProvenance name) (Located (HsExpr name)) |
Instances
DataId name => Data (AnnDecl name) | |
OutputableBndr name => Outputable (AnnDecl name) | |
Typeable (* -> *) AnnDecl |
data AnnProvenance name Source
Constructors
ValueAnnProvenance (Located name) | |
TypeAnnProvenance (Located name) | |
ModuleAnnProvenance |
Instances
Functor AnnProvenance | |
Foldable AnnProvenance | |
Traversable AnnProvenance | |
Data name => Data (AnnProvenance name) | |
Typeable (* -> *) AnnProvenance |
annProvenanceName_maybe :: AnnProvenance name -> Maybe name Source
Role annotations
data RoleAnnotDecl name Source
Constructors
RoleAnnotDecl (Located name) [Located (Maybe Role)] |
Instances
Data name => Data (RoleAnnotDecl name) | |
OutputableBndr name => Outputable (RoleAnnotDecl name) | |
Typeable (* -> *) RoleAnnotDecl |
type LRoleAnnotDecl name = Located (RoleAnnotDecl name) Source
roleAnnotDeclName :: RoleAnnotDecl name -> name Source
Grouping
Constructors
HsGroup | |
Fields
|
Instances
DataId id => Data (HsGroup id) | |
OutputableBndr name => Outputable (HsGroup name) | |
Typeable (* -> *) HsGroup |
emptyRdrGroup :: HsGroup a Source
emptyRnGroup :: HsGroup a Source
appendGroups :: HsGroup a -> HsGroup a -> HsGroup a Source