HsDecls
Contents
Description
Abstract syntax of global declarations.
Definitions for: TyDecl
and ConDecl
, ClassDecl
,
InstDecl
, DefaultDecl
and ForeignDecl
.
- data HsDecl id
- type LHsDecl id = Located (HsDecl id)
- data TyClDecl name
- = ForeignType {
- tcdLName :: Located name
- tcdExtName :: Maybe FastString
- | TyFamily {
- tcdFlavour :: FamilyFlavour
- tcdLName :: Located name
- tcdTyVars :: [LHsTyVarBndr name]
- tcdKind :: Maybe Kind
- | TyData { }
- | TySynonym { }
- | ClassDecl { }
- = ForeignType {
- type LTyClDecl name = Located (TyClDecl name)
- isClassDecl :: TyClDecl name -> Bool
- isSynDecl :: TyClDecl name -> Bool
- isDataDecl :: TyClDecl name -> Bool
- isTypeDecl :: TyClDecl name -> Bool
- isFamilyDecl :: TyClDecl name -> Bool
- isFamInstDecl :: TyClDecl name -> Bool
- tcdName :: TyClDecl name -> name
- tyClDeclTyVars :: TyClDecl name -> [LHsTyVarBndr name]
- countTyClDecls :: [TyClDecl name] -> (Int, Int, Int, Int, Int, Int)
- data InstDecl name = InstDecl (LHsType name) (LHsBinds name) [LSig name] [LTyClDecl name]
- type LInstDecl name = Located (InstDecl name)
- data NewOrData
- data FamilyFlavour
- = TypeFamily
- | DataFamily
- instDeclATs :: [LInstDecl name] -> [LTyClDecl name]
- data DerivDecl name = DerivDecl (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) (LHsType name)
- collectRuleBndrSigTys :: [RuleBndr name] -> [LHsType name]
- 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) ForeignImport
- | ForeignExport (Located name) (LHsType name) ForeignExport
- type LForeignDecl name = Located (ForeignDecl name)
- data ForeignImport = CImport CCallConv Safety FastString CImportSpec
- data ForeignExport = CExport CExportSpec
- data CImportSpec
- data ConDecl name = ConDecl {
- con_name :: Located name
- con_explicit :: HsExplicitFlag
- con_qvars :: [LHsTyVarBndr name]
- con_cxt :: LHsContext name
- con_details :: HsConDeclDetails name
- con_res :: ResType name
- con_doc :: Maybe LHsDocString
- con_old_rec :: Bool
- type LConDecl name = Located (ConDecl name)
- data ResType name
- 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_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 (WarnDecl id) | |
AnnD (AnnDecl id) | |
RuleD (RuleDecl id) | |
SpliceD (SpliceDecl id) | |
DocD DocDecl | |
QuasiQuoteD (HsQuasiQuote id) |
Instances
Typeable1 HsDecl | |
Data id => Data (HsDecl id) | |
OutputableBndr name => Outputable (HsDecl name) |
Class or type declarations
A type or class declaration.
Constructors
ForeignType | |
Fields
| |
TyFamily | type/data family T :: *->* |
Fields
| |
TyData | Declares a data type or newtype, giving its construcors
|
Fields
| |
TySynonym | |
ClassDecl | |
Fields
|
Instances
Typeable1 TyClDecl | |
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
or data
/newtype instance
declaration.
isTypeDecl :: TyClDecl name -> BoolSource
type or type instance declaration
isFamilyDecl :: TyClDecl name -> BoolSource
type family declaration
isFamInstDecl :: TyClDecl name -> BoolSource
family instance (types, newtypes, and data types)
tyClDeclTyVars :: TyClDecl name -> [LHsTyVarBndr name]Source
Instance declarations
Instances
Typeable1 InstDecl | |
Data name => Data (InstDecl name) | |
OutputableBndr name => Outputable (InstDecl name) |
instDeclATs :: [LInstDecl name] -> [LTyClDecl name]Source
Standalone deriving declarations
Instances
Typeable1 DerivDecl | |
Data name => Data (DerivDecl name) | |
OutputableBndr name => Outputable (DerivDecl name) |
type LDerivDecl name = Located (DerivDecl name)Source
RULE
declarations
Constructors
HsRule RuleName Activation [RuleBndr name] (Located (HsExpr name)) NameSet (Located (HsExpr name)) NameSet |
Instances
Typeable1 RuleDecl | |
Data name => Data (RuleDecl name) | |
OutputableBndr name => Outputable (RuleDecl name) |
Constructors
RuleBndr (Located name) | |
RuleBndrSig (Located name) (LHsType name) |
Instances
Typeable1 RuleBndr | |
Data name => Data (RuleBndr name) | |
OutputableBndr name => Outputable (RuleBndr name) |
collectRuleBndrSigTys :: [RuleBndr name] -> [LHsType name]Source
default
declarations
data DefaultDecl name Source
Constructors
DefaultDecl [LHsType name] |
Instances
Typeable1 DefaultDecl | |
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
Constructors
SpliceDecl (Located (HsExpr id)) HsExplicitFlag |
Instances
Typeable1 SpliceDecl | |
Data id => Data (SpliceDecl id) | |
OutputableBndr name => Outputable (SpliceDecl name) |
Foreign function interface declarations
data ForeignDecl name Source
Constructors
ForeignImport (Located name) (LHsType name) ForeignImport | |
ForeignExport (Located name) (LHsType name) ForeignExport |
Instances
Typeable1 ForeignDecl | |
Data name => Data (ForeignDecl name) | |
OutputableBndr name => Outputable (ForeignDecl name) |
type LForeignDecl name = Located (ForeignDecl name)Source
data ForeignImport Source
Constructors
CImport CCallConv Safety FastString CImportSpec |
data ForeignExport Source
Constructors
CExport CExportSpec |
Data-constructor declarations
Constructors
ConDecl | |
Fields
|
Instances
Typeable1 ConDecl | |
Data name => Data (ConDecl name) | |
OutputableBndr name => Outputable (ConDecl name) |
Instances
Typeable1 ResType | |
Data name => Data (ResType name) | |
OutputableBndr name => Outputable (ResType name) |
type HsConDeclDetails name = HsConDetails (LBangType name) [ConDeclField name]Source
hsConDeclArgTys :: HsConDeclDetails name -> [LBangType name]Source
Document comments
Deprecations
Constructors
Warning name WarningTxt |
Instances
Typeable1 WarnDecl | |
Data name => Data (WarnDecl name) | |
OutputableBndr name => Outputable (WarnDecl name) |
Annotations
Constructors
HsAnnotation (AnnProvenance name) (Located (HsExpr name)) |
Instances
Typeable1 AnnDecl | |
Data name => Data (AnnDecl name) | |
OutputableBndr name => Outputable (AnnDecl name) |
data AnnProvenance name Source
Constructors
ValueAnnProvenance name | |
TypeAnnProvenance name | |
ModuleAnnProvenance |
Instances
Typeable1 AnnProvenance | |
Data name => Data (AnnProvenance name) |
annProvenanceName_maybe :: AnnProvenance name -> Maybe nameSource
modifyAnnProvenanceNameM :: Monad m => (before -> m after) -> AnnProvenance before -> m (AnnProvenance after)Source
Grouping
Constructors
HsGroup | |
Fields
|
Instances
Typeable1 HsGroup | |
Data id => Data (HsGroup id) | |
OutputableBndr name => Outputable (HsGroup name) |
appendGroups :: HsGroup a -> HsGroup a -> HsGroup aSource