HsDecls

ghc-7.8.3: The GHC API

Safe Haskell | None
Language | Haskell98

HsDecls

Contents

- Toplevel declarations
  - Class or type declarations
  - Instance declarations
  - Standalone deriving declarations
  - `RULE` declarations
  - `VECTORISE` declarations
  - `default` declarations
  - Template haskell declaration splice
  - Foreign function interface declarations
  - Data-constructor declarations
  - Document comments
  - Deprecations
  - Annotations
  - Role annotations
- Grouping

Description

Abstract syntax of global declarations.

Definitions for: `SynDecl` and `ConDecl`, `ClassDecl`, `InstDecl`, `DefaultDecl` and `ForeignDecl`.

Synopsis

- 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 {
  - dd_ND :: NewOrData
  - dd_ctxt :: LHsContext name
  - dd_cType :: Maybe CType
  - dd_kindSig :: Maybe (LHsKind name)
  - dd_cons :: [LConDecl name]
  - dd_derivs :: Maybe [LHsType name]
  }
- data TyClDecl name
  - = ForeignType {
    - tcdLName :: Located name
    - tcdExtName :: Maybe FastString
    }
  - | FamDecl {
    - tcdFam :: FamilyDecl name
    }
  - | SynDecl {
    - tcdLName :: Located name
    - tcdTyVars :: LHsTyVarBndrs name
    - tcdRhs :: LHsType name
    - tcdFVs :: NameSet
    }
  - | DataDecl {
    - tcdLName :: Located name
    - tcdTyVars :: LHsTyVarBndrs name
    - tcdDataDefn :: HsDataDefn name
    - tcdFVs :: NameSet
    }
  - | ClassDecl {
    - tcdCtxt :: LHsContext name
    - tcdLName :: Located name
    - tcdTyVars :: LHsTyVarBndrs name
    - tcdFDs :: [Located (FunDep name)]
    - tcdSigs :: [LSig name]
    - tcdMeths :: LHsBinds name
    - tcdATs :: [LFamilyDecl name]
    - tcdATDefs :: [LTyFamInstDecl name]
    - tcdDocs :: [LDocDecl]
    - tcdFVs :: NameSet
    }
- 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
    }
- type LInstDecl name = Located (InstDecl name)
- data NewOrData
  - = NewType
  - | DataType
- 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
  - = CLabel CLabelString
  - | CFunction CCallTarget
  - | CWrapper
- 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
  - = ResTyH98
  - | ResTyGADT ty
- type HsConDeclDetails name = HsConDetails (LBangType name) [ConDeclField name]
- hsConDeclArgTys :: HsConDeclDetails name -> [LBangType name]
- data DocDecl
  - = DocCommentNext HsDocString
  - | DocCommentPrev HsDocString
  - | DocCommentNamed String HsDocString
  - | DocGroup Int HsDocString
- 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

data HsDecl id Source

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) |
VectD (VectDecl id) |
SpliceD (SpliceDecl id) |
DocD DocDecl |
QuasiQuoteD (HsQuasiQuote id) |
RoleAnnotD (RoleAnnotDecl id) |

Instances

Data id => Data (HsDecl id) |
OutputableBndr name => Outputable (HsDecl name) |
Typeable (* -> *) HsDecl |

type LHsDecl id = Located (HsDecl id) Source

data HsDataDefn name Source

Constructors

HsDataDefn | Declares a data type or newtype, giving its constructors `data/newtype T a = constrs data/newtype instance T [a] = constrs`
Fields dd_ND :: NewOrData dd_ctxt :: LHsContext name Context dd_cType :: Maybe CType dd_kindSig :: Maybe (LHsKind name) Optional kind signature. `(Just k)` for a GADT-style `data`, or `data instance` decl, with explicit kind sig Always `Nothing` for H98-syntax decls dd_cons :: [LConDecl name] Data constructors For `data T a = T1 | T2 a` the `LConDecl`s all have `ResTyH98`. For `data T a where { T1 :: T a }` the `LConDecls` all have `ResTyGADT`. dd_derivs :: Maybe [LHsType name] Derivings; `Nothing` => not specified, `Just []` => derive exactly what is asked These "types" must be of form `forall ab. C ty1 ty2` Typically the foralls and ty args are empty, but they are non-empty for the newtype-deriving case

Instances

Data name => Data (HsDataDefn name) |
OutputableBndr name => Outputable (HsDataDefn name) |
Typeable (* -> *) HsDataDefn |

## Class or type declarations

data TyClDecl name Source

A type or class declaration.

Constructors

ForeignType |
Fields tcdLName :: Located name Type constructor tcdExtName :: Maybe FastString
FamDecl |
    type/data family T :: *->*
Fields tcdFam :: FamilyDecl name
SynDecl | `type` declaration
Fields tcdLName :: Located name Type constructor tcdTyVars :: LHsTyVarBndrs name Type variables; for an associated type these include outer binders tcdRhs :: LHsType name RHS of type declaration tcdFVs :: NameSet
DataDecl | `data` declaration
Fields tcdLName :: Located name Type constructor tcdTyVars :: LHsTyVarBndrs name Type variables; for an associated type these include outer binders tcdDataDefn :: HsDataDefn name tcdFVs :: NameSet
ClassDecl |
Fields tcdCtxt :: LHsContext name Context... tcdLName :: Located name Type constructor tcdTyVars :: LHsTyVarBndrs name Type variables; for an associated type these include outer binders tcdFDs :: [Located (FunDep name)] Functional deps tcdSigs :: [LSig name] Methods' signatures tcdMeths :: LHsBinds name Default methods tcdATs :: [LFamilyDecl name] Associated types; ie tcdATDefs :: [LTyFamInstDecl name] Associated type defaults tcdDocs :: [LDocDecl] Haddock docs tcdFVs :: NameSet

Instances

Data name => Data (TyClDecl name) |
OutputableBndr name => Outputable (TyClDecl name) |
Typeable (* -> *) TyClDecl |

type LTyClDecl name = Located (TyClDecl name) Source

data TyClGroup name Source

Constructors

TyClGroup |
Fields group_tyclds :: [LTyClDecl name] group_roles :: [LRoleAnnotDecl name]

Instances

Data name => Data (TyClGroup name) |
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.

isSynDecl :: TyClDecl name -> Bool Source

type or type instance declaration

tcdName :: TyClDecl name -> name Source

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

countTyClDecls :: [TyClDecl name] -> (Int, Int, Int, Int, Int) Source

pprTyClDeclFlavour :: TyClDecl a -> SDoc Source

tyClDeclLName :: TyClDecl name -> Located name Source

tyClDeclTyVars :: OutputableBndr name => TyClDecl name -> LHsTyVarBndrs name Source

data FamilyDecl name Source

Constructors

FamilyDecl |
Fields fdInfo :: FamilyInfo name fdLName :: Located name fdTyVars :: LHsTyVarBndrs name fdKindSig :: Maybe (LHsKind name)

Instances

Data name => Data (FamilyDecl name) |
OutputableBndr name => Outputable (FamilyDecl name) |
Typeable (* -> *) FamilyDecl |

type LFamilyDecl name = Located (FamilyDecl name) Source

## Instance declarations

data InstDecl name Source

Constructors

ClsInstD |
Fields cid_inst :: ClsInstDecl name
DataFamInstD |
Fields dfid_inst :: DataFamInstDecl name
TyFamInstD |
Fields tfid_inst :: TyFamInstDecl name

Instances

Data name => Data (InstDecl name) |
OutputableBndr name => Outputable (InstDecl name) |
Typeable (* -> *) InstDecl |

type LInstDecl name = Located (InstDecl name) Source

data NewOrData Source

Constructors

NewType |
    newtype Blah ...
DataType |
    data Blah ...

Instances

Eq NewOrData |
Data NewOrData |
Outputable NewOrData |
Typeable * NewOrData |

data FamilyInfo name Source

Constructors

DataFamily |
OpenTypeFamily |
ClosedTypeFamily [LTyFamInstEqn name] |

Instances

Data name => Data (FamilyInfo name) |
Outputable (FamilyInfo name) |
Typeable (* -> *) FamilyInfo |

data TyFamInstDecl name Source

Constructors

TyFamInstDecl |
Fields tfid_eqn :: LTyFamInstEqn name tfid_fvs :: NameSet

Instances

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 name Source

Constructors

DataFamInstDecl |
Fields dfid_tycon :: Located name dfid_pats :: HsWithBndrs [LHsType name] Type patterns (with kind and type bndrs) See Note [Family instance declaration binders] dfid_defn :: HsDataDefn name dfid_fvs :: NameSet

Instances

Data name => Data (DataFamInstDecl name) |
OutputableBndr name => Outputable (DataFamInstDecl name) |
Typeable (* -> *) DataFamInstDecl |

type LDataFamInstDecl name = Located (DataFamInstDecl name) Source

pprDataFamInstFlavour :: DataFamInstDecl name -> SDoc Source

data TyFamInstEqn name Source

One equation in a type family instance declaration

Constructors

TyFamInstEqn |
Fields tfie_tycon :: Located name tfie_pats :: HsWithBndrs [LHsType name] Type patterns (with kind and type bndrs) See Note [Family instance declaration binders] tfie_rhs :: LHsType name

Instances

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 name Source

Constructors

ClsInstDecl |
Fields cid_poly_ty :: LHsType name cid_binds :: LHsBinds name cid_sigs :: [LSig name] cid_tyfam_insts :: [LTyFamInstDecl name] cid_datafam_insts :: [LDataFamInstDecl name]

Instances

Data name => Data (ClsInstDecl name) |
OutputableBndr name => Outputable (ClsInstDecl name) |
Typeable (* -> *) ClsInstDecl |

## Standalone deriving declarations

data DerivDecl name Source

Constructors

DerivDecl |
Fields deriv_type :: LHsType name

Instances

Data name => Data (DerivDecl name) |
OutputableBndr name => Outputable (DerivDecl name) |
Typeable (* -> *) DerivDecl |

type LDerivDecl name = Located (DerivDecl name) Source

## `RULE` declarations

data RuleDecl name Source

Constructors

HsRule RuleName Activation [RuleBndr name] (Located (HsExpr name)) NameSet (Located (HsExpr name)) NameSet |

Instances

Data name => Data (RuleDecl name) |
OutputableBndr name => Outputable (RuleDecl name) |
Typeable (* -> *) RuleDecl |

type LRuleDecl name = Located (RuleDecl name) Source

data RuleBndr name Source

Constructors

RuleBndr (Located name) |
RuleBndrSig (Located name) (HsWithBndrs (LHsType name)) |

Instances

Data name => Data (RuleBndr name) |
OutputableBndr name => Outputable (RuleBndr name) |
Typeable (* -> *) RuleBndr |

collectRuleBndrSigTys :: [RuleBndr name] -> [HsWithBndrs (LHsType name)] Source

## `VECTORISE` declarations

data VectDecl name Source

Constructors

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 |

Instances

Data name => Data (VectDecl name) |
OutputableBndr name => Outputable (VectDecl name) |
Typeable (* -> *) VectDecl |

type LVectDecl name = Located (VectDecl name) Source

lvectDeclName :: NamedThing name => LVectDecl name -> Name Source

lvectInstDecl :: LVectDecl name -> Bool Source

## `default` declarations

data DefaultDecl name Source

Constructors

DefaultDecl [LHsType name] |

Instances

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 id Source

Constructors

SpliceDecl (Located (HsSplice id)) HsExplicitFlag |

Instances

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 name Source

Constructors

ForeignImport (Located name) (LHsType name) Coercion ForeignImport |
ForeignExport (Located name) (LHsType name) Coercion ForeignExport |

Instances

Data name => Data (ForeignDecl name) |
OutputableBndr name => Outputable (ForeignDecl name) |
Typeable (* -> *) ForeignDecl |

type LForeignDecl name = Located (ForeignDecl name) Source

data ForeignImport Source

Constructors

CImport CCallConv Safety (Maybe Header) CImportSpec |

Instances

Data ForeignImport |
Outputable ForeignImport |
Typeable * ForeignImport |

data ForeignExport Source

Constructors

CExport CExportSpec |

Instances

Data ForeignExport |
Outputable ForeignExport |
Typeable * ForeignExport |

noForeignImportCoercionYet :: Coercion Source

noForeignExportCoercionYet :: Coercion Source

data CImportSpec Source

Constructors

CLabel CLabelString |
CFunction CCallTarget |
CWrapper |

Instances

Data CImportSpec |
Typeable * CImportSpec |

## Data-constructor declarations

data ConDecl name Source

Constructors

ConDecl |
Fields con_name :: Located name Constructor name. This is used for the DataCon itself, and for the user-callable wrapper Id. con_explicit :: HsExplicitFlag Is there an user-written forall? (cf. `HsForAllTy`) con_qvars :: LHsTyVarBndrs name Type variables. Depending on `con_res` this describes the following entities ResTyH98: the constructor's *existential* type variables ResTyGADT: *all* the constructor's quantified type variables If con_explicit is Implicit, then con_qvars is irrelevant until after renaming. con_cxt :: LHsContext name The context. This does not include the "stupid theta" which lives only in the `TyData` decl. con_details :: HsConDeclDetails name The main payload con_res :: ResType (LHsType name) Result type of the constructor con_doc :: Maybe LHsDocString A possible Haddock comment. con_old_rec :: Bool TEMPORARY field; True = user has employed now-deprecated syntax for GADT-style record decl C { blah } :: T a b Remove this when we no longer parse this stuff, and hence do not need to report decprecated use

Instances

Data name => Data (ConDecl name) |
OutputableBndr name => Outputable (ConDecl name) |
Typeable (* -> *) ConDecl |

type LConDecl name = Located (ConDecl name) Source

data ResType ty Source

Constructors

ResTyH98 |
ResTyGADT ty |

Instances

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

data DocDecl Source

Constructors

DocCommentNext HsDocString |
DocCommentPrev HsDocString |
DocCommentNamed String HsDocString |
DocGroup Int HsDocString |

Instances

Data DocDecl |
Outputable DocDecl |
Typeable * DocDecl |

type LDocDecl = Located DocDecl Source

docDeclDoc :: DocDecl -> HsDocString Source

## Deprecations

data WarnDecl name Source

Constructors

Warning name WarningTxt |

Instances

Data name => Data (WarnDecl name) |
OutputableBndr name => Outputable (WarnDecl name) |
Typeable (* -> *) WarnDecl |

type LWarnDecl name = Located (WarnDecl name) Source

## Annotations

data AnnDecl name Source

Constructors

HsAnnotation (AnnProvenance name) (Located (HsExpr name)) |

Instances

Data name => Data (AnnDecl name) |
OutputableBndr name => Outputable (AnnDecl name) |
Typeable (* -> *) AnnDecl |

type LAnnDecl name = Located (AnnDecl name) Source

data AnnProvenance name Source

Constructors

ValueAnnProvenance name |
TypeAnnProvenance 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

data HsGroup id Source

A `HsDecl` is categorised into a `HsGroup` before being fed to the renamer.

Constructors

HsGroup |
Fields 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]

Instances

Data 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