Safe Haskell | None |
---|---|
Language | Haskell2010 |
Representation of Haskell AST definitions. These include definition of data types, classes, instances and so on. The definition of value bindings are in the Binds module.
- data Decl dom stage
- = TypeDecl { }
- | TypeFamilyDecl {
- _declTypeFamily :: Ann TypeFamily dom stage
- | ClosedTypeFamilyDecl { }
- | DataDecl {
- _declNewtype :: Ann DataOrNewtypeKeyword dom stage
- _declCtx :: AnnMaybe Context dom stage
- _declHead :: Ann DeclHead dom stage
- _declCons :: AnnList ConDecl dom stage
- _declDeriving :: AnnMaybe Deriving dom stage
- | GDataDecl {
- _declNewtype :: Ann DataOrNewtypeKeyword dom stage
- _declCtx :: AnnMaybe Context dom stage
- _declHead :: Ann DeclHead dom stage
- _declKind :: AnnMaybe KindConstraint dom stage
- _declGadt :: AnnList GadtConDecl dom stage
- _declDeriving :: AnnMaybe Deriving dom stage
- | TypeInstDecl {
- _declInstance :: Ann InstanceRule dom stage
- _declAssignedType :: Ann Type dom stage
- | DataInstDecl {
- _declNewtype :: Ann DataOrNewtypeKeyword dom stage
- _declInstance :: Ann InstanceRule dom stage
- _declCons :: AnnList ConDecl dom stage
- _declDeriving :: AnnMaybe Deriving dom stage
- | GDataInstDecl {
- _declNewtype :: Ann DataOrNewtypeKeyword dom stage
- _declInstance :: Ann InstanceRule dom stage
- _declKind :: AnnMaybe KindConstraint dom stage
- _declGadt :: AnnList GadtConDecl dom stage
- | ClassDecl { }
- | InstDecl {
- _declOverlap :: AnnMaybe OverlapPragma dom stage
- _declInstRule :: Ann InstanceRule dom stage
- _declInstDecl :: AnnMaybe InstBody dom stage
- | PatternSynonymDecl {
- _declPatSyn :: Ann PatternSynonym dom stage
- | DerivDecl {
- _declOverlap :: AnnMaybe OverlapPragma dom stage
- _declInstRule :: Ann InstanceRule dom stage
- | FixityDecl {
- _declFixity :: Ann FixitySignature dom stage
- | DefaultDecl {
- _declTypes :: AnnList Type dom stage
- | TypeSigDecl {
- _declTypeSig :: Ann TypeSignature dom stage
- | PatTypeSigDecl {
- _declPatTypeSig :: Ann PatternTypeSignature dom stage
- | ValueBinding {
- _declValBind :: Ann ValueBind dom stage
- | ForeignImport { }
- | ForeignExport { }
- | PragmaDecl {
- _declPragma :: Ann TopLevelPragma dom stage
- | RoleDecl {
- _declRoleType :: Ann QualifiedName dom stage
- _declRoles :: AnnList Role dom stage
- | SpliceDecl {
- _declSplice :: Ann Splice dom stage
- data TypeFamily dom stage
- = TypeFamily { }
- | DataFamily { }
- data TypeFamilySpec dom stage
- = TypeFamilyKind {
- _tfSpecKind :: Ann KindConstraint dom stage
- | TypeFamilyInjectivity {
- _tfInjectivity :: Ann InjectivityAnn dom stage
- = TypeFamilyKind {
- data InjectivityAnn dom stage = InjectivityAnn {
- _injAnnRes :: Ann Name dom stage
- _injAnnDeps :: AnnList Name dom stage
- data ClassBody dom stage = ClassBody {
- _cbElements :: AnnList ClassElement dom stage
- data ClassElement dom stage
- = ClsSig {
- _ceTypeSig :: Ann TypeSignature dom stage
- | ClsDef { }
- | ClsTypeFam {
- _ceTypeFam :: Ann TypeFamily dom stage
- | ClsTypeDef { }
- | ClsDefSig { }
- | ClsMinimal {
- _pragmaFormula :: Ann MinimalFormula dom stage
- | ClsPatSig {
- _cePatSig :: Ann PatternTypeSignature dom stage
- = ClsSig {
- data DeclHead dom stage
- data InstBody dom stage = InstBody {
- _instBodyDecls :: AnnList InstBodyDecl dom stage
- data InstBodyDecl dom stage
- = InstBodyNormalDecl {
- _instBodyDeclFunbind :: Ann ValueBind dom stage
- | InstBodyTypeSig {
- _instBodyTypeSig :: Ann TypeSignature dom stage
- | InstBodyTypeDecl {
- _instBodyTypeEqn :: Ann TypeEqn dom stage
- | InstBodyDataDecl {
- _instBodyDataNew :: Ann DataOrNewtypeKeyword dom stage
- _instBodyLhsType :: Ann InstanceRule dom stage
- _instBodyDataCons :: AnnList ConDecl dom stage
- _instBodyDerivings :: AnnMaybe Deriving dom stage
- | InstBodyGadtDataDecl {
- _instBodyDataNew :: Ann DataOrNewtypeKeyword dom stage
- _instBodyLhsType :: Ann InstanceRule dom stage
- _instBodyDataKind :: AnnMaybe KindConstraint dom stage
- _instBodyGadtCons :: AnnList GadtConDecl dom stage
- _instBodyDerivings :: AnnMaybe Deriving dom stage
- | SpecializeInstance {
- _specializeInstanceType :: Ann Type dom stage
- | InstBodyPatSyn {
- _instBodyPatSyn :: Ann PatternSynonym dom stage
- = InstBodyNormalDecl {
- data GadtConDecl dom stage = GadtConDecl {
- _gadtConNames :: AnnList Name dom stage
- _gadtConType :: Ann GadtConType dom stage
- data GadtConType dom stage
- = GadtNormalType {
- _gadtConNormalType :: Ann Type dom stage
- | GadtRecordType {
- _gadtConRecordFields :: AnnList FieldDecl dom stage
- _gadtConResultType :: Ann Type dom stage
- = GadtNormalType {
- data FunDeps dom stage = FunDeps {}
- data FunDep dom stage = FunDep {
- _funDepLhs :: AnnList Name dom stage
- _funDepRhs :: AnnList Name dom stage
- data ConDecl dom stage
- = ConDecl {
- _conDeclName :: Ann Name dom stage
- _conDeclArgs :: AnnList Type dom stage
- | RecordDecl {
- _conDeclName :: Ann Name dom stage
- _conDeclFields :: AnnList FieldDecl dom stage
- | InfixConDecl {
- _conDeclLhs :: Ann Type dom stage
- _conDeclOp :: Ann Operator dom stage
- _conDeclRhs :: Ann Type dom stage
- = ConDecl {
- data FieldDecl dom stage = FieldDecl {
- _fieldNames :: AnnList Name dom stage
- _fieldType :: Ann Type dom stage
- data Deriving dom stage
- = DerivingOne {
- _oneDerived :: Ann InstanceHead dom stage
- | Derivings {
- _allDerived :: AnnList InstanceHead dom stage
- = DerivingOne {
- data InstanceRule dom stage
- = InstanceRule { }
- | InstanceParen {
- _irRule :: Ann InstanceRule dom stage
- data InstanceHead dom stage
- = InstanceHeadCon {
- _ihConName :: Ann Name dom stage
- | InstanceHeadInfix { }
- | InstanceHeadParen {
- _ihHead :: Ann InstanceHead dom stage
- | InstanceHeadApp { }
- = InstanceHeadCon {
- data TypeEqn dom stage = TypeEqn {}
- data PatternTypeSignature dom stage = PatternTypeSignature {
- _patSigName :: Ann Name dom stage
- _patSigType :: Ann Type dom stage
- data PatternSynonym dom stage = PatternSynonym {}
- data PatSynLhs dom stage
- = NormalPatSyn { }
- | InfixPatSyn {
- _patSynLhs :: Ann Name dom stage
- _patSynOp :: Ann Operator dom stage
- _patSynRhs :: Ann Name dom stage
- | RecordPatSyn { }
- data PatSynRhs dom stage
- = BidirectionalPatSyn {
- _patRhsPat :: Ann Pattern dom stage
- _patRhsOpposite :: AnnMaybe PatSynWhere dom stage
- | OneDirectionalPatSyn {
- _patRhsPat :: Ann Pattern dom stage
- = BidirectionalPatSyn {
- data PatSynWhere dom stage = PatSynWhere {
- _patOpposite :: AnnList Match dom stage
Documentation
Haskell declaration
TypeDecl | A type synonym ( |
TypeFamilyDecl | |
| |
ClosedTypeFamilyDecl | A closed type family declaration |
DataDecl | A data or newtype declaration. Empty data type declarations without where keyword are always belong to DataDecl. |
| |
GDataDecl | A data or newtype declaration. |
| |
TypeInstDecl | Type instance declaration ( |
| |
DataInstDecl | Data instance declaration ( |
| |
GDataInstDecl | Gadt style data instance declaration ( |
| |
ClassDecl | Type class declaration ( |
InstDecl | Instance declaration ( |
| |
PatternSynonymDecl | Pattern synonyms ( |
| |
DerivDecl | Standalone deriving declaration ( |
| |
FixityDecl | Fixity declaration ( |
| |
DefaultDecl | Default types ( |
| |
TypeSigDecl | Type signature declaration ( |
| |
PatTypeSigDecl | Type signature declaration ( |
| |
ValueBinding | Function binding ( |
| |
ForeignImport | Foreign import ( |
ForeignExport | foreign export ( |
PragmaDecl | top level pragmas |
| |
RoleDecl | role annotations ( |
| |
SpliceDecl | A Template Haskell splice declaration ( |
|
data TypeFamily dom stage Source #
Open type and data families
TypeFamily | A type family declaration ( |
DataFamily | Data family declaration |
type Rep (TypeFamily dom stage) Source # | |
data TypeFamilySpec dom stage Source #
Type family specification with kinds specification and injectivity.
TypeFamilyKind | |
| |
TypeFamilyInjectivity | |
|
type Rep (TypeFamilySpec dom stage) Source # | |
data InjectivityAnn dom stage Source #
Injectivity annotation for type families ( = r | r -> a
)
InjectivityAnn | |
|
type Rep (InjectivityAnn dom stage) Source # | |
data ClassBody dom stage Source #
The list of declarations that can appear in a typeclass
ClassBody | |
|
data ClassElement dom stage Source #
Members of a class declaration
ClsSig | Signature: |
| |
ClsDef | Default binding: |
ClsTypeFam | Declaration of an associated type synonym: |
| |
ClsTypeDef | Default choice for type synonym: |
ClsDefSig | Default signature (by using |
ClsMinimal | |
| |
ClsPatSig | Pattern signature in a class declaration (by using |
|
type Rep (ClassElement dom stage) Source # | |
data InstBody dom stage Source #
Instance body is the implementation of the class functions ( where a x = 1; b x = 2
)
InstBody | |
|
data InstBodyDecl dom stage Source #
Declarations inside an instance declaration.
InstBodyNormalDecl | A normal declaration ( |
| |
InstBodyTypeSig | Type signature in instance definition with |
| |
InstBodyTypeDecl | An associated type definition ( |
| |
InstBodyDataDecl | An associated data type implementation ( |
| |
InstBodyGadtDataDecl | An associated data type implemented using GADT style |
| |
SpecializeInstance | Specialize instance pragma (no phase selection is allowed) not supported yet |
| |
InstBodyPatSyn | A pattern synonym in a class instance |
|
type Rep (InstBodyDecl dom stage) Source # | |
data GadtConDecl dom stage Source #
GADT constructor declaration ( _D1 :: { _val :: Int } -> T String
)
GadtConDecl | |
|
type Rep (GadtConDecl dom stage) Source # | |
data GadtConType dom stage Source #
Type of GADT constructors (can be record types: { _val :: Int }
)
GadtNormalType | |
| |
GadtRecordType | |
|
type Rep (GadtConType dom stage) Source # | |
data FunDeps dom stage Source #
A list of functional dependencies: | a -> b, c -> d
separated by commas
data FunDep dom stage Source #
A functional dependency, given on the form l1 ... ln -> r1 ... rn
FunDep | |
|
data ConDecl dom stage Source #
A constructor declaration for a datatype
ConDecl | ordinary data constructor ( |
| |
RecordDecl | record data constructor ( |
| |
InfixConDecl | infix data constructor ( |
|
data FieldDecl dom stage Source #
Field declaration ( _fld :: Int
)
FieldDecl | |
|
data Deriving dom stage Source #
A deriving clause following a data type declaration. ( deriving Show
or deriving (Show, Eq)
)
DerivingOne | |
| |
Derivings | |
|
data InstanceRule dom stage Source #
The instance declaration rule, which is, roughly, the part of the instance declaration before the where keyword.
InstanceRule | |
InstanceParen | |
|
type Rep (InstanceRule dom stage) Source # | |
data InstanceHead dom stage Source #
The specification of the class instance declaration
InstanceHeadCon | Type or class name |
| |
InstanceHeadInfix | Infix application of the type/class name to the left operand |
InstanceHeadParen | Parenthesized instance head |
| |
InstanceHeadApp | Application to one more type |
type Rep (InstanceHead dom stage) Source # | |
data PatternTypeSignature dom stage Source #
A pattern type signature ( pattern p :: Int -> T
)
PatternTypeSignature | |
|
type Rep (PatternTypeSignature dom stage) Source # | |
data PatternSynonym dom stage Source #
Pattern synonyms: pattern Arrow t1 t2 = App "->" [t1, t2]
type Rep (PatternSynonym dom stage) Source # | |
data PatSynLhs dom stage Source #
Left hand side of a pattern synonym
NormalPatSyn | |
InfixPatSyn | |
| |
RecordPatSyn | |
data PatSynRhs dom stage Source #
Right-hand side of pattern synonym
BidirectionalPatSyn |
|
| |
OneDirectionalPatSyn | pattern Int <- App Int [] |
|
data PatSynWhere dom stage Source #
Where clause of pattern synonym (explicit expression direction)
PatSynWhere | |
|
type Rep (PatSynWhere dom stage) Source # | |