haskell-src-exts-1.3.5: Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printerSource codeContentsIndex
MaintainerNiklas Broberg, d00nibro@chalmers.se
Type classes and instances
Data type declarations
Function bindings
Class Assertions and Contexts
Variables, Constructors and Operators
Template Haskell
Builtin names
Main function of a program
Special identifiers
Type constructors
Source coordinates

A suite of datatypes describing the abstract syntax of Haskell 98 http://www.haskell.org/onlinereport/ plus registered extensions, including:

  • multi-parameter type classes with functional dependencies (MultiParamTypeClasses, FunctionalDependencies)
  • parameters of type class assertions are unrestricted (FlexibleContexts)
  • forall types as universal and existential quantification (RankNTypes, ExistentialQuantification, etc)
  • pattern guards (PatternGuards)
  • implicit parameters (ImplicitParameters)
  • generalised algebraic data types (GADTs)
  • template haskell (TemplateHaskell)
  • empty data type declarations (EmptyDataDecls)
  • unboxed tuples (UnboxedTuples)
  • regular patterns (RegularPatterns)
  • HSP-style XML expressions and patterns (XmlSyntax)
data Module = Module SrcLoc ModuleName [OptionPragma] (Maybe WarningText) (Maybe [ExportSpec]) [ImportDecl] [Decl]
data WarningText
= DeprText String
| WarnText String
data ExportSpec
= EVar QName
| EAbs QName
| EThingAll QName
| EThingWith QName [CName]
| EModuleContents ModuleName
data ImportDecl = ImportDecl {
importLoc :: SrcLoc
importModule :: ModuleName
importQualified :: Bool
importSrc :: Bool
importPkg :: Maybe String
importAs :: Maybe ModuleName
importSpecs :: Maybe (Bool, [ImportSpec])
data ImportSpec
= IVar Name
| IAbs Name
| IThingAll Name
| IThingWith Name [CName]
data Assoc
= AssocNone
| AssocLeft
| AssocRight
data Decl
= TypeDecl SrcLoc Name [TyVarBind] Type
| TypeFamDecl SrcLoc Name [TyVarBind] (Maybe Kind)
| DataDecl SrcLoc DataOrNew Context Name [TyVarBind] [QualConDecl] [Deriving]
| GDataDecl SrcLoc DataOrNew Context Name [TyVarBind] (Maybe Kind) [GadtDecl] [Deriving]
| DataFamDecl SrcLoc Context Name [TyVarBind] (Maybe Kind)
| TypeInsDecl SrcLoc Type Type
| DataInsDecl SrcLoc DataOrNew Type [QualConDecl] [Deriving]
| GDataInsDecl SrcLoc DataOrNew Type (Maybe Kind) [GadtDecl] [Deriving]
| ClassDecl SrcLoc Context Name [TyVarBind] [FunDep] [ClassDecl]
| InstDecl SrcLoc Context QName [Type] [InstDecl]
| DerivDecl SrcLoc Context QName [Type]
| InfixDecl SrcLoc Assoc Int [Op]
| DefaultDecl SrcLoc [Type]
| SpliceDecl SrcLoc Exp
| TypeSig SrcLoc [Name] Type
| FunBind [Match]
| PatBind SrcLoc Pat (Maybe Type) Rhs Binds
| ForImp SrcLoc CallConv Safety String Name Type
| ForExp SrcLoc CallConv String Name Type
| RulePragmaDecl SrcLoc [Rule]
| DeprPragmaDecl SrcLoc [([Name], String)]
| WarnPragmaDecl SrcLoc [([Name], String)]
| InlineSig SrcLoc Bool Activation QName
| SpecSig SrcLoc QName [Type]
| SpecInlineSig SrcLoc Bool Activation QName [Type]
| InstSig SrcLoc Context QName [Type]
data Binds
= BDecls [Decl]
| IPBinds [IPBind]
data IPBind = IPBind SrcLoc IPName Exp
data ClassDecl
= ClsDecl Decl
| ClsDataFam SrcLoc Context Name [TyVarBind] (Maybe Kind)
| ClsTyFam SrcLoc Name [TyVarBind] (Maybe Kind)
| ClsTyDef SrcLoc Type Type
data InstDecl
= InsDecl Decl
| InsType SrcLoc Type Type
| InsData SrcLoc DataOrNew Type [QualConDecl] [Deriving]
| InsGData SrcLoc DataOrNew Type (Maybe Kind) [GadtDecl] [Deriving]
| InsInline SrcLoc Bool Activation QName
type Deriving = (QName, [Type])
data DataOrNew
= DataType
| NewType
data ConDecl
= ConDecl Name [BangType]
| InfixConDecl BangType Name BangType
| RecDecl Name [([Name], BangType)]
data QualConDecl = QualConDecl SrcLoc [TyVarBind] Context ConDecl
data GadtDecl = GadtDecl SrcLoc Name Type
data BangType
= BangedTy Type
| UnBangedTy Type
| UnpackedTy Type
data Match = Match SrcLoc Name [Pat] (Maybe Type) Rhs Binds
data Rhs
= UnGuardedRhs Exp
| GuardedRhss [GuardedRhs]
data GuardedRhs = GuardedRhs SrcLoc [Stmt] Exp
type Context = [Asst]
data FunDep = FunDep [Name] [Name]
data Asst
= ClassA QName [Type]
| InfixA Type QName Type
| IParam IPName Type
| EqualP Type Type
data Type
= TyForall (Maybe [TyVarBind]) Context Type
| TyFun Type Type
| TyTuple Boxed [Type]
| TyList Type
| TyApp Type Type
| TyVar Name
| TyCon QName
| TyParen Type
| TyInfix Type QName Type
| TyKind Type Kind
data Boxed
= Boxed
| Unboxed
data Kind
= KindStar
| KindBang
| KindFn Kind Kind
| KindParen Kind
| KindVar Name
data TyVarBind
= KindedVar Name Kind
| UnkindedVar Name
data Exp
= Var QName
| IPVar IPName
| Con QName
| Lit Literal
| InfixApp Exp QOp Exp
| App Exp Exp
| NegApp Exp
| Lambda SrcLoc [Pat] Exp
| Let Binds Exp
| If Exp Exp Exp
| Case Exp [Alt]
| Do [Stmt]
| MDo [Stmt]
| Tuple [Exp]
| TupleSection [Maybe Exp]
| List [Exp]
| Paren Exp
| LeftSection Exp QOp
| RightSection QOp Exp
| RecConstr QName [FieldUpdate]
| RecUpdate Exp [FieldUpdate]
| EnumFrom Exp
| EnumFromTo Exp Exp
| EnumFromThen Exp Exp
| EnumFromThenTo Exp Exp Exp
| ListComp Exp [QualStmt]
| ParComp Exp [[QualStmt]]
| ExpTypeSig SrcLoc Exp Type
| VarQuote QName
| TypQuote QName
| BracketExp Bracket
| SpliceExp Splice
| QuasiQuote String String
| XTag SrcLoc XName [XAttr] (Maybe Exp) [Exp]
| XETag SrcLoc XName [XAttr] (Maybe Exp)
| XPcdata String
| XExpTag Exp
| CorePragma String Exp
| SCCPragma String Exp
| GenPragma String (Int, Int) (Int, Int) Exp
| Proc Pat Exp
| LeftArrApp Exp Exp
| RightArrApp Exp Exp
| LeftArrHighApp Exp Exp
| RightArrHighApp Exp Exp
data Stmt
= Generator SrcLoc Pat Exp
| Qualifier Exp
| LetStmt Binds
| RecStmt [Stmt]
data QualStmt
= QualStmt Stmt
| ThenTrans Exp
| ThenBy Exp Exp
| GroupBy Exp
| GroupUsing Exp
| GroupByUsing Exp Exp
data FieldUpdate
= FieldUpdate QName Exp
| FieldPun Name
| FieldWildcard
data Alt = Alt SrcLoc Pat GuardedAlts Binds
data GuardedAlts
= UnGuardedAlt Exp
| GuardedAlts [GuardedAlt]
data GuardedAlt = GuardedAlt SrcLoc [Stmt] Exp
data XAttr = XAttr XName Exp
data Pat
= PVar Name
| PLit Literal
| PNeg Pat
| PNPlusK Name Integer
| PInfixApp Pat QName Pat
| PApp QName [Pat]
| PTuple [Pat]
| PList [Pat]
| PParen Pat
| PRec QName [PatField]
| PAsPat Name Pat
| PWildCard
| PIrrPat Pat
| PatTypeSig SrcLoc Pat Type
| PViewPat Exp Pat
| PRPat [RPat]
| PXTag SrcLoc XName [PXAttr] (Maybe Pat) [Pat]
| PXETag SrcLoc XName [PXAttr] (Maybe Pat)
| PXPcdata String
| PXPatTag Pat
| PXRPats [RPat]
| PExplTypeArg QName Type
| PQuasiQuote String String
| PBangPat Pat
data PatField
= PFieldPat QName Pat
| PFieldPun Name
| PFieldWildcard
data PXAttr = PXAttr XName Pat
data RPat
= RPOp RPat RPatOp
| RPEither RPat RPat
| RPSeq [RPat]
| RPGuard Pat [Stmt]
| RPCAs Name RPat
| RPAs Name RPat
| RPParen RPat
| RPPat Pat
data RPatOp
= RPStar
| RPStarG
| RPPlus
| RPPlusG
| RPOpt
| RPOptG
data Literal
= Char Char
| String String
| Int Integer
| Frac Rational
| PrimInt Integer
| PrimWord Integer
| PrimFloat Rational
| PrimDouble Rational
| PrimChar Char
| PrimString String
newtype ModuleName = ModuleName String
data QName
= Qual ModuleName Name
| UnQual Name
| Special SpecialCon
data Name
= Ident String
| Symbol String
data QOp
= QVarOp QName
| QConOp QName
data Op
= VarOp Name
| ConOp Name
data SpecialCon
= UnitCon
| ListCon
| FunCon
| TupleCon Boxed Int
| Cons
| UnboxedSingleCon
data CName
= VarName Name
| ConName Name
data IPName
= IPDup String
| IPLin String
data XName
= XName String
| XDomName String String
data Bracket
= ExpBracket Exp
| PatBracket Pat
| TypeBracket Type
| DeclBracket [Decl]
data Splice
= IdSplice String
| ParenSplice Exp
data Safety
= PlayRisky
| PlaySafe Bool
data CallConv
= StdCall
| CCall
data OptionPragma
= LanguagePragma SrcLoc [Name]
| IncludePragma SrcLoc String
| CFilesPragma SrcLoc String
| OptionsPragma SrcLoc (Maybe Tool) String
data Tool
| NHC98
| UnknownTool String
data Rule = Rule String Activation (Maybe [RuleVar]) Exp Exp
data RuleVar
= RuleVar Name
| TypedRuleVar Name Type
data Activation
= AlwaysActive
| ActiveFrom Int
| ActiveUntil Int
prelude_mod :: ModuleName
main_mod :: ModuleName
main_name :: Name
unit_con_name :: QName
tuple_con_name :: Boxed -> Int -> QName
list_cons_name :: QName
unboxed_singleton_con_name :: QName
unit_con :: Exp
tuple_con :: Boxed -> Int -> Exp
unboxed_singleton_con :: Exp
as_name :: Name
qualified_name :: Name
hiding_name :: Name
minus_name :: Name
bang_name :: Name
dot_name :: Name
star_name :: Name
export_name :: Name
safe_name :: Name
unsafe_name :: Name
threadsafe_name :: Name
stdcall_name :: Name
ccall_name :: Name
unit_tycon_name :: QName
fun_tycon_name :: QName
list_tycon_name :: QName
tuple_tycon_name :: Boxed -> Int -> QName
unboxed_singleton_tycon_name :: QName
unit_tycon :: Type
fun_tycon :: Type
list_tycon :: Type
tuple_tycon :: Boxed -> Int -> Type
unboxed_singleton_tycon :: Type
data SrcLoc = SrcLoc {
srcFilename :: String
srcLine :: Int
srcColumn :: Int
data Module Source
A complete Haskell source module.
Module SrcLoc ModuleName [OptionPragma] (Maybe WarningText) (Maybe [ExportSpec]) [ImportDecl] [Decl]
show/hide Instances
data WarningText Source
Warning text to optionally use in the module header of e.g. a deprecated module.
DeprText String
WarnText String
show/hide Instances
data ExportSpec Source
An item in a module's export specification.
EVar QNamevariable
EAbs QNameT: a class or datatype exported abstractly, or a type synonym.
EThingAll QNameT(..): a class exported with all of its methods, or a datatype exported with all of its constructors.
EThingWith QName [CName]T(C_1,...,C_n): a class exported with some of its methods, or a datatype exported with some of its constructors.
EModuleContents ModuleNamemodule M: re-export a module.
show/hide Instances
data ImportDecl Source
An import declaration.
importLoc :: SrcLocposition of the import keyword.
importModule :: ModuleNamename of the module imported.
importQualified :: Boolimported qualified?
importSrc :: Boolimported with {-# SOURCE #-}?
importPkg :: Maybe Stringimported with explicit package name
importAs :: Maybe ModuleNameoptional alias name in an as clause.
importSpecs :: Maybe (Bool, [ImportSpec])optional list of import specifications. The Bool is True if the names are excluded by hiding.
show/hide Instances
data ImportSpec Source
An import specification, representing a single explicit item imported (or hidden) from a module.
IVar Namevariable
IAbs NameT: the name of a class, datatype or type synonym.
IThingAll NameT(..): a class imported with all of its methods, or a datatype imported with all of its constructors.
IThingWith Name [CName]T(C_1,...,C_n): a class imported with some of its methods, or a datatype imported with some of its constructors.
show/hide Instances
data Assoc Source
Associativity of an operator.
AssocNonenon-associative operator (declared with infix)
AssocLeftleft-associative operator (declared with infixl).
AssocRightright-associative operator (declared with infixr)
show/hide Instances
data Decl Source
A top-level declaration.
TypeDecl SrcLoc Name [TyVarBind] TypeA type declaration
TypeFamDecl SrcLoc Name [TyVarBind] (Maybe Kind)A type family declaration
DataDecl SrcLoc DataOrNew Context Name [TyVarBind] [QualConDecl] [Deriving]A data OR newtype declaration
GDataDecl SrcLoc DataOrNew Context Name [TyVarBind] (Maybe Kind) [GadtDecl] [Deriving]A data OR newtype declaration, GADT style
DataFamDecl SrcLoc Context Name [TyVarBind] (Maybe Kind)A data family declaration
TypeInsDecl SrcLoc Type TypeA type family instance declaration
DataInsDecl SrcLoc DataOrNew Type [QualConDecl] [Deriving]A data family instance declaration
GDataInsDecl SrcLoc DataOrNew Type (Maybe Kind) [GadtDecl] [Deriving]A data family instance declaration, GADT style
ClassDecl SrcLoc Context Name [TyVarBind] [FunDep] [ClassDecl]A declaration of a type class
InstDecl SrcLoc Context QName [Type] [InstDecl]An declaration of a type class instance
DerivDecl SrcLoc Context QName [Type]A standalone deriving declaration
InfixDecl SrcLoc Assoc Int [Op]A declaration of operator fixity
DefaultDecl SrcLoc [Type]A declaration of default types
SpliceDecl SrcLoc ExpA Template Haskell splicing declaration
TypeSig SrcLoc [Name] TypeA type signature declaration
FunBind [Match]A set of function binding clauses
PatBind SrcLoc Pat (Maybe Type) Rhs BindsA pattern binding
ForImp SrcLoc CallConv Safety String Name TypeA foreign import declaration
ForExp SrcLoc CallConv String Name TypeA foreign export declaration
RulePragmaDecl SrcLoc [Rule]A RULES pragma
DeprPragmaDecl SrcLoc [([Name], String)]A DEPRECATED pragma
WarnPragmaDecl SrcLoc [([Name], String)]A WARNING pragma
InlineSig SrcLoc Bool Activation QNameAn INLINE pragma
SpecSig SrcLoc QName [Type]A SPECIALISE pragma
SpecInlineSig SrcLoc Bool Activation QName [Type]A SPECIALISE INLINE pragma
InstSig SrcLoc Context QName [Type]A SPECIALISE instance pragma
show/hide Instances
data Binds Source
A binding group inside a let or where clause.
BDecls [Decl]An ordinary binding group
IPBinds [IPBind]A binding group for implicit parameters
show/hide Instances
data IPBind Source
A binding of an implicit parameter.
IPBind SrcLoc IPName Exp
show/hide Instances
Type classes and instances
data ClassDecl Source
Declarations inside a class declaration.
ClsDecl Declordinary declaration
ClsDataFam SrcLoc Context Name [TyVarBind] (Maybe Kind)declaration of an associated data type
ClsTyFam SrcLoc Name [TyVarBind] (Maybe Kind)declaration of an associated type synonym
ClsTyDef SrcLoc Type Typedefault choice for an associated type synonym
show/hide Instances
data InstDecl Source
Declarations inside an instance declaration.
InsDecl Declordinary declaration
InsType SrcLoc Type Typean associated type definition
InsData SrcLoc DataOrNew Type [QualConDecl] [Deriving]an associated data type implementation
InsGData SrcLoc DataOrNew Type (Maybe Kind) [GadtDecl] [Deriving]an associated data type implemented using GADT style
InsInline SrcLoc Bool Activation QNamean INLINE pragma
show/hide Instances
type Deriving = (QName, [Type])Source
A single derived instance, which may have arguments since it may be a MPTC.
Data type declarations
data DataOrNew Source
A flag stating whether a declaration is a data or newtype declaration.
show/hide Instances
data ConDecl Source
Declaration of an ordinary data constructor.
ConDecl Name [BangType]ordinary data constructor
InfixConDecl BangType Name BangTypeinfix data constructor
RecDecl Name [([Name], BangType)]record constructor
show/hide Instances
data QualConDecl Source
A single constructor declaration within a data type declaration, which may have an existential quantification binding.
QualConDecl SrcLoc [TyVarBind] Context ConDecl
show/hide Instances
data GadtDecl Source
A single constructor declaration in a GADT data type declaration.
GadtDecl SrcLoc Name Type
show/hide Instances
data BangType Source
The type of a constructor argument or field, optionally including a strictness annotation.
BangedTy Typestrict component, marked with "!"
UnBangedTy Typenon-strict component
UnpackedTy Typeunboxed component, marked with an UNPACK pragma
show/hide Instances
Function bindings
data Match Source
Clauses of a function binding.
Match SrcLoc Name [Pat] (Maybe Type) Rhs Binds
show/hide Instances
data Rhs Source
The right hand side of a function or pattern binding.
UnGuardedRhs Expunguarded right hand side (exp)
GuardedRhss [GuardedRhs]guarded right hand side (gdrhs)
show/hide Instances
data GuardedRhs Source
A guarded right hand side | stmts = exp. The guard is a series of statements when using pattern guards, otherwise it will be a single qualifier expression.
GuardedRhs SrcLoc [Stmt] Exp
show/hide Instances
Class Assertions and Contexts
type Context = [Asst]Source
A context is a set of assertions
data FunDep Source
A functional dependency, given on the form l1 l2 ... ln -> r2 r3 .. rn
FunDep [Name] [Name]
show/hide Instances
data Asst Source
Class assertions. In Haskell 98, the argument would be a tyvar, but this definition allows multiple parameters, and allows them to be types. Also extended with support for implicit parameters and equality constraints.
ClassA QName [Type]ordinary class assertion
InfixA Type QName Typeclass assertion where the class name is given infix
IParam IPName Typeimplicit parameter assertion
EqualP Type Typetype equality constraint
show/hide Instances
data Type Source
A type qualified with a context. An unqualified type has an empty context.
TyForall (Maybe [TyVarBind]) Context Typequalified type
TyFun Type Typefunction type
TyTuple Boxed [Type]tuple type, possibly boxed
TyList Typelist syntax, e.g. [a], as opposed to [] a
TyApp Type Typeapplication of a type constructor
TyVar Nametype variable
TyCon QNamenamed type or type constructor
TyParen Typetype surrounded by parentheses
TyInfix Type QName Typeinfix type constructor
TyKind Type Kindtype with explicit kind signature
show/hide Instances
data Boxed Source
Flag denoting whether a tuple is boxed or unboxed.
show/hide Instances
data Kind Source
An explicit kind annotation.
KindStar*, the kind of types
KindBang!, the kind of unboxed types
KindFn Kind Kind->, the kind of a type constructor
KindParen Kinda kind surrounded by parentheses
KindVar Namea kind variable (as of yet unsupported by compilers)
show/hide Instances
data TyVarBind Source
A type variable declaration, optionally with an explicit kind annotation.
KindedVar Name Kindvariable binding with kind annotation
UnkindedVar Nameordinary variable binding
show/hide Instances
data Exp Source
Haskell expressions.
Var QNamevariable
IPVar IPNameimplicit parameter variable
Con QNamedata constructor
Lit Literalliteral constant
InfixApp Exp QOp Expinfix application
App Exp Expordinary application
NegApp Expnegation expression -exp (unary minus)
Lambda SrcLoc [Pat] Explambda expression
Let Binds Explocal declarations with let ... in ...
If Exp Exp Expif exp then exp else exp
Case Exp [Alt]case exp of alts
Do [Stmt]do-expression: the last statement in the list should be an expression.
MDo [Stmt]mdo-expression
Tuple [Exp]tuple expression
TupleSection [Maybe Exp]tuple section expression, e.g. (,,3)
List [Exp]list expression
Paren Expparenthesised expression
LeftSection Exp QOpleft section (exp qop)
RightSection QOp Expright section (qop exp)
RecConstr QName [FieldUpdate]record construction expression
RecUpdate Exp [FieldUpdate]record update expression
EnumFrom Expunbounded arithmetic sequence, incrementing by 1: [from ..]
EnumFromTo Exp Expbounded arithmetic sequence, incrementing by 1 [from .. to]
EnumFromThen Exp Expunbounded arithmetic sequence, with first two elements given [from, then ..]
EnumFromThenTo Exp Exp Expbounded arithmetic sequence, with first two elements given [from, then .. to]
ListComp Exp [QualStmt]ordinary list comprehension
ParComp Exp [[QualStmt]]parallel list comprehension
ExpTypeSig SrcLoc Exp Typeexpression with explicit type signature
VarQuote QName'x for template haskell reifying of expressions
TypQuote QName''T for template haskell reifying of types
BracketExp Brackettemplate haskell bracket expression
SpliceExp Splicetemplate haskell splice expression
QuasiQuote String Stringquasi-quotaion: [$name| string |]
XTag SrcLoc XName [XAttr] (Maybe Exp) [Exp]xml element, with attributes and children
XETag SrcLoc XName [XAttr] (Maybe Exp)empty xml element, with attributes
XPcdata StringPCDATA child element
XExpTag Expescaped haskell expression inside xml
CorePragma String ExpCORE pragma
SCCPragma String ExpSCC pragma
GenPragma String (Int, Int) (Int, Int) ExpGENERATED pragma
Proc Pat Exparrows proc: proc pat -> exp
LeftArrApp Exp Exparrow application (from left): exp -< exp
RightArrApp Exp Exparrow application (from right): exp >- exp
LeftArrHighApp Exp Exphigher-order arrow application (from left): exp -<< exp
RightArrHighApp Exp Exphigher-order arrow application (from right): exp >>- exp
show/hide Instances
data Stmt Source
A statement, representing both a stmt in a do-expression, an ordinary qual in a list comprehension, as well as a stmt in a pattern guard.
Generator SrcLoc Pat Expa generator: pat <- exp
Qualifier Expan exp by itself: in a do-expression, an action whose result is discarded; in a list comprehension and pattern guard, a guard expression
LetStmt Bindslocal bindings
RecStmt [Stmt]a recursive binding group for arrows
show/hide Instances
data QualStmt Source
A general transqual in a list comprehension, which could potentially be a transform of the kind enabled by TransformListComp.
QualStmt Stmtan ordinary statement
ThenTrans Expthen exp
ThenBy Exp Expthen exp by exp
GroupBy Expthen group by exp
GroupUsing Expthen group using exp
GroupByUsing Exp Expthen group by exp using exp
show/hide Instances
data FieldUpdate Source
An fbind in a labeled construction or update expression.
FieldUpdate QName Expordinary label-expresion pair
FieldPun Namerecord field pun
FieldWildcardrecord field wildcard
show/hide Instances
data Alt Source
An alt alternative in a case expression.
Alt SrcLoc Pat GuardedAlts Binds
show/hide Instances
data GuardedAlts Source
The right-hand sides of a case alternative, which may be a single right-hand side or a set of guarded ones.
UnGuardedAlt Exp-> exp
GuardedAlts [GuardedAlt]gdpat
show/hide Instances
data GuardedAlt Source
A guarded case alternative | stmts -> exp.
GuardedAlt SrcLoc [Stmt] Exp
show/hide Instances
data XAttr Source
An xml attribute, which is a name-expression pair.
XAttr XName Exp
show/hide Instances
data Pat Source
A pattern, to be matched against a value.
PVar Namevariable
PLit Literalliteral constant
PNeg Patnegated pattern
PNPlusK Name Integern+k pattern
PInfixApp Pat QName Patpattern with an infix data constructor
PApp QName [Pat]data constructor and argument patterns
PTuple [Pat]tuple pattern
PList [Pat]list pattern
PParen Patparenthesized pattern
PRec QName [PatField]labelled pattern, record style
PAsPat Name Pat@-pattern
PWildCardwildcard pattern: _
PIrrPat Patirrefutable pattern: ~pat
PatTypeSig SrcLoc Pat Typepattern with type signature
PViewPat Exp Patview patterns of the form (exp -> pat)
PRPat [RPat]regular list pattern
PXTag SrcLoc XName [PXAttr] (Maybe Pat) [Pat]XML element pattern
PXETag SrcLoc XName [PXAttr] (Maybe Pat)XML singleton element pattern
PXPcdata StringXML PCDATA pattern
PXPatTag PatXML embedded pattern
PXRPats [RPat]XML regular list pattern
PExplTypeArg QName TypeExplicit generics style type argument e.g. f {| Int |} x = ...
PQuasiQuote String Stringquasi quote patter: [$name| string |]
PBangPat Patstrict (bang) pattern: f !x = ...
show/hide Instances
data PatField Source
An fpat in a labeled record pattern.
PFieldPat QName Patordinary label-pattern pair
PFieldPun Namerecord field pun
PFieldWildcardrecord field wildcard
show/hide Instances
data PXAttr Source
An XML attribute in a pattern.
PXAttr XName Pat
show/hide Instances
data RPat Source
An entity in a regular pattern.
RPOp RPat RPatOp
RPEither RPat RPat
RPSeq [RPat]
RPGuard Pat [Stmt]
RPCAs Name RPat
RPAs Name RPat
RPParen RPat
RPPat Pat
show/hide Instances
data RPatOp Source
A regular pattern operator.
RPStar* = 0 or more
RPStarG*! = 0 or more, greedy
RPPlus+ = 1 or more
RPPlusG+! = 1 or more, greedy
RPOpt? = 0 or 1
RPOptG?! = 0 or 1, greedy
show/hide Instances
data Literal Source
literal Values of this type hold the abstract value of the literal, not the precise string representation used. For example, 10, 0o12 and 0xa have the same representation.
Char Charcharacter literal
String Stringstring literal
Int Integerinteger literal
Frac Rationalfloating point literal
PrimInt Integerunboxed integer literal
PrimWord Integerunboxed word literal
PrimFloat Rationalunboxed float literal
PrimDouble Rationalunboxed double literal
PrimChar Charunboxed character literal
PrimString Stringunboxed string literal
show/hide Instances
Variables, Constructors and Operators
newtype ModuleName Source
The name of a Haskell module.
ModuleName String
show/hide Instances
data QName Source
This type is used to represent qualified variables, and also qualified constructors.
Qual ModuleName Namename qualified with a module name
UnQual Nameunqualified local name
Special SpecialConbuilt-in constructor with special syntax
show/hide Instances
data Name Source
This type is used to represent variables, and also constructors.
Ident Stringvarid or conid.
Symbol Stringvarsym or consym
show/hide Instances
data QOp Source
Possibly qualified infix operators (qop), appearing in expressions.
QVarOp QNamevariable operator (qvarop)
QConOp QNameconstructor operator (qconop)
show/hide Instances
data Op Source
Operators appearing in infix declarations are never qualified.
VarOp Namevariable operator (varop)
ConOp Nameconstructor operator (conop)
show/hide Instances
data SpecialCon Source
Constructors with special syntax. These names are never qualified, and always refer to builtin type or data constructors.
UnitConunit type and data constructor ()
ListConlist type constructor []
FunConfunction type constructor ->
TupleCon Boxed Intn-ary tuple type and data constructors (,) etc, possibly boxed (#,#)
Conslist data constructor (:)
UnboxedSingleConunboxed singleton tuple constructor (# #)
show/hide Instances
data CName Source
A name (cname) of a component of a class or data type in an import or export specification.
VarName Namename of a method or field
ConName Namename of a data constructor
show/hide Instances
data IPName Source
An implicit parameter name.
IPDup String?ident, non-linear implicit parameter
IPLin String%ident, linear implicit parameter
show/hide Instances
data XName Source
The name of an xml element or attribute, possibly qualified with a namespace.
XName String
XDomName String String
show/hide Instances
Template Haskell
data Bracket Source
A template haskell bracket expression.
ExpBracket Expexpression bracket: [| ... |]
PatBracket Patpattern bracket: [p| ... |]
TypeBracket Typetype bracket: [t| ... |]
DeclBracket [Decl]declaration bracket: [d| ... |]
show/hide Instances
data Splice Source
A template haskell splice expression
IdSplice Stringvariable splice: $var
ParenSplice Expparenthesised expression splice: $(exp)
show/hide Instances
data Safety Source
The safety of a foreign function call.
PlaySafe Boolsafe (False) or threadsafe (True)
show/hide Instances
data CallConv Source
The calling convention of a foreign function call.
show/hide Instances
data OptionPragma Source
A top level options pragma, preceding the module header.
LanguagePragma SrcLoc [Name]LANGUAGE pragma
IncludePragma SrcLoc StringINCLUDE pragma
CFilesPragma SrcLoc StringCFILES pragma
OptionsPragma SrcLoc (Maybe Tool) StringOPTIONS pragma, possibly qualified with a tool, e.g. OPTIONS_GHC
show/hide Instances
data Tool Source
Recognised tools for OPTIONS pragmas.
UnknownTool String
show/hide Instances
data Rule Source
The body of a RULES pragma.
Rule String Activation (Maybe [RuleVar]) Exp Exp
show/hide Instances
data RuleVar Source
Variables used in a RULES pragma, optionally annotated with types
RuleVar Name
TypedRuleVar Name Type
show/hide Instances
data Activation Source
Activation clause of a RULES pragma.
ActiveFrom Int
ActiveUntil Int
show/hide Instances
Builtin names
prelude_mod :: ModuleNameSource
main_mod :: ModuleNameSource
Main function of a program
main_name :: NameSource
unit_con_name :: QNameSource
tuple_con_name :: Boxed -> Int -> QNameSource
list_cons_name :: QNameSource
unboxed_singleton_con_name :: QNameSource
unit_con :: ExpSource
tuple_con :: Boxed -> Int -> ExpSource
unboxed_singleton_con :: ExpSource
Special identifiers
as_name :: NameSource
qualified_name :: NameSource
hiding_name :: NameSource
minus_name :: NameSource
bang_name :: NameSource
dot_name :: NameSource
star_name :: NameSource
export_name :: NameSource
safe_name :: NameSource
unsafe_name :: NameSource
threadsafe_name :: NameSource
stdcall_name :: NameSource
ccall_name :: NameSource
Type constructors
unit_tycon_name :: QNameSource
fun_tycon_name :: QNameSource
list_tycon_name :: QNameSource
tuple_tycon_name :: Boxed -> Int -> QNameSource
unboxed_singleton_tycon_name :: QNameSource
unit_tycon :: TypeSource
fun_tycon :: TypeSource
list_tycon :: TypeSource
tuple_tycon :: Boxed -> Int -> TypeSource
unboxed_singleton_tycon :: TypeSource
Source coordinates
data SrcLoc Source
A single position in the source.
srcFilename :: String
srcLine :: Int
srcColumn :: Int
show/hide Instances
Produced by Haddock version 2.6.0