Language.Haskell.Exts.Syntax

haskell-src-exts-1.17.1: Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer

Copyright | (c) Niklas Broberg 2004-2009, (c) The GHC Team, 1997-2000
License | BSD-style (see the file LICENSE.txt)
Maintainer | Niklas Broberg, d00nibro@chalmers.se
Stability | stable
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Language.Haskell.Exts.Syntax

Contents

- Modules
- Declarations
  - Type classes and instances
  - Data type declarations
  - Function bindings
- Class Assertions and Contexts
- Types
- Expressions
- Patterns
- Literals
- Variables, Constructors and Operators
- Template Haskell
- FFI
- Pragmas
- Builtin names
  - Modules
  - Main function of a program
  - Constructors
  - Special identifiers
  - Type constructors
- Source coordinates

Description

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)

Synopsis

- data Module = Module SrcLoc ModuleName [ModulePragma] (Maybe WarningText) (Maybe [ExportSpec]) [ImportDecl] [Decl]
- data WarningText
  - = DeprText String
  - | WarnText String
- data ExportSpec
  - = EVar QName
  - | EAbs Namespace QName
  - | EThingAll QName
  - | EThingWith QName [CName]
  - | EModuleContents ModuleName
- data ImportDecl = ImportDecl {
  - importLoc :: SrcLoc
  - importModule :: ModuleName
  - importQualified :: Bool
  - importSrc :: Bool
  - importSafe :: Bool
  - importPkg :: Maybe String
  - importAs :: Maybe ModuleName
  - importSpecs :: Maybe (Bool, [ImportSpec])
  }
- data ImportSpec
  - = IVar Name
  - | IAbs Namespace Name
  - | IThingAll Name
  - | IThingWith Name [CName]
- data Assoc
  - = AssocNone
  - | AssocLeft
  - | AssocRight
- data Namespace
  - = NoNamespace
  - | TypeNamespace
  - | PatternNamespace
- data Decl
  - = TypeDecl SrcLoc Name [TyVarBind] Type
  - | TypeFamDecl SrcLoc Name [TyVarBind] (Maybe Kind)
  - | ClosedTypeFamDecl SrcLoc Name [TyVarBind] (Maybe Kind) [TypeEqn]
  - | 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 (Maybe Overlap) [TyVarBind] Context QName [Type] [InstDecl]
  - | DerivDecl SrcLoc (Maybe Overlap) [TyVarBind] Context QName [Type]
  - | InfixDecl SrcLoc Assoc Int [Op]
  - | DefaultDecl SrcLoc [Type]
  - | SpliceDecl SrcLoc Exp
  - | TypeSig SrcLoc [Name] Type
  - | PatSynSig SrcLoc Name (Maybe [TyVarBind]) Context Context Type
  - | FunBind [Match]
  - | PatBind SrcLoc Pat Rhs (Maybe Binds)
  - | ForImp SrcLoc CallConv Safety String Name Type
  - | ForExp SrcLoc CallConv String Name Type
  - | PatSyn SrcLoc Pat Pat PatternSynDirection
  - | RulePragmaDecl SrcLoc [Rule]
  - | DeprPragmaDecl SrcLoc [([Name], String)]
  - | WarnPragmaDecl SrcLoc [([Name], String)]
  - | InlineSig SrcLoc Bool Activation QName
  - | InlineConlikeSig SrcLoc Activation QName
  - | SpecSig SrcLoc Activation QName [Type]
  - | SpecInlineSig SrcLoc Bool Activation QName [Type]
  - | InstSig SrcLoc [TyVarBind] Context QName [Type]
  - | AnnPragma SrcLoc Annotation
  - | MinimalPragma SrcLoc (Maybe BooleanFormula)
  - | RoleAnnotDecl SrcLoc QName [Role]
- data Binds
  - = BDecls [Decl]
  - | IPBinds [IPBind]
- data IPBind = IPBind SrcLoc IPName Exp
- data PatternSynDirection
  - = Unidirectional
  - | ImplicitBidirectional
  - | ExplicitBidirectional [Decl]
- data ClassDecl
  - = ClsDecl Decl
  - | ClsDataFam SrcLoc Context Name [TyVarBind] (Maybe Kind)
  - | ClsTyFam SrcLoc Name [TyVarBind] (Maybe Kind)
  - | ClsTyDef SrcLoc Type Type
  - | ClsDefSig SrcLoc Name Type
- data InstDecl
  - = InsDecl Decl
  - | InsType SrcLoc Type Type
  - | InsData SrcLoc DataOrNew Type [QualConDecl] [Deriving]
  - | InsGData SrcLoc DataOrNew Type (Maybe Kind) [GadtDecl] [Deriving]
- type Deriving = (QName, [Type])
- data DataOrNew
  - = DataType
  - | NewType
- data ConDecl
  - = ConDecl Name [Type]
  - | InfixConDecl Type Name Type
  - | RecDecl Name [([Name], Type)]
- data QualConDecl = QualConDecl SrcLoc [TyVarBind] Context ConDecl
- data GadtDecl = GadtDecl SrcLoc Name [([Name], Type)] Type
- data BangType
  - = BangedTy
  - | UnpackedTy
- data Match = Match SrcLoc Name [Pat] (Maybe Type) Rhs (Maybe 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]
  - | AppA Name [Type]
  - | InfixA Type QName Type
  - | IParam IPName Type
  - | EqualP Type Type
  - | ParenA Asst
  - | WildCardA (Maybe Name)
- data Type
  - = TyForall (Maybe [TyVarBind]) Context Type
  - | TyFun Type Type
  - | TyTuple Boxed [Type]
  - | TyList Type
  - | TyParArray Type
  - | TyApp Type Type
  - | TyVar Name
  - | TyCon QName
  - | TyParen Type
  - | TyInfix Type QName Type
  - | TyKind Type Kind
  - | TyPromoted Promoted
  - | TyEquals Type Type
  - | TySplice Splice
  - | TyBang BangType Type
  - | TyWildCard (Maybe Name)
- data Boxed
  - = Boxed
  - | Unboxed
- data Kind
  - = KindStar
  - | KindFn Kind Kind
  - | KindParen Kind
  - | KindVar QName
  - | KindApp Kind Kind
  - | KindTuple [Kind]
  - | KindList Kind
- data TyVarBind
  - = KindedVar Name Kind
  - | UnkindedVar Name
- data Promoted
  - = PromotedInteger Integer
  - | PromotedString String
  - | PromotedCon Bool QName
  - | PromotedList Bool [Type]
  - | PromotedTuple [Type]
  - | PromotedUnit
- data TypeEqn = TypeEqn Type Type
- 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
  - | MultiIf [GuardedRhs]
  - | Case Exp [Alt]
  - | Do [Stmt]
  - | MDo [Stmt]
  - | Tuple Boxed [Exp]
  - | TupleSection Boxed [Maybe Exp]
  - | List [Exp]
  - | ParArray [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
  - | ParArrayFromTo Exp Exp
  - | ParArrayFromThenTo Exp Exp Exp
  - | ListComp Exp [QualStmt]
  - | ParComp Exp [[QualStmt]]
  - | ParArrayComp 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
  - | XChildTag SrcLoc [Exp]
  - | CorePragma String Exp
  - | SCCPragma String Exp
  - | GenPragma String (Int, Int) (Int, Int) Exp
  - | Proc SrcLoc Pat Exp
  - | LeftArrApp Exp Exp
  - | RightArrApp Exp Exp
  - | LeftArrHighApp Exp Exp
  - | RightArrHighApp Exp Exp
  - | LCase [Alt]
  - | ExprHole
- 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 QName
  - | FieldWildcard
- data Alt = Alt SrcLoc Pat Rhs (Maybe Binds)
- data XAttr = XAttr XName Exp
- data Pat
  - = PVar Name
  - | PLit Sign Literal
  - | PNPlusK Name Integer
  - | PInfixApp Pat QName Pat
  - | PApp QName [Pat]
  - | PTuple Boxed [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]
  - | PQuasiQuote String String
  - | PBangPat Pat
- data PatField
  - = PFieldPat QName Pat
  - | PFieldPun QName
  - | 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
- data Sign
  - = Signless
  - | Negative
- 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 Role
  - = Nominal
  - | Representational
  - | Phantom
  - | RoleWildcard
- data Bracket
  - = ExpBracket Exp
  - | PatBracket Pat
  - | TypeBracket Type
  - | DeclBracket [Decl]
- data Splice
  - = IdSplice String
  - | ParenSplice Exp
- data Safety
  - = PlayRisky
  - | PlaySafe Bool
  - | PlayInterruptible
- data CallConv
  - = StdCall
  - | CCall
  - | CPlusPlus
  - | DotNet
  - | Jvm
  - | Js
  - | JavaScript
  - | CApi
- data ModulePragma
  - = LanguagePragma SrcLoc [Name]
  - | OptionsPragma SrcLoc (Maybe Tool) String
  - | AnnModulePragma SrcLoc Annotation
- data Tool
  - = GHC
  - | HUGS
  - | NHC98
  - | YHC
  - | HADDOCK
  - | UnknownTool String
- data Overlap
  - = NoOverlap
  - | Overlap
  - | Incoherent
- data Rule = Rule String Activation (Maybe [RuleVar]) Exp Exp
- data RuleVar
  - = RuleVar Name
  - | TypedRuleVar Name Type
- data Activation
  - = AlwaysActive
  - | ActiveFrom Int
  - | ActiveUntil Int
- data Annotation
  - = Ann Name Exp
  - | TypeAnn Name Exp
  - | ModuleAnn Exp
- data BooleanFormula
  - = VarFormula Name
  - | AndFormula [BooleanFormula]
  - | OrFormula [BooleanFormula]
  - | ParenFormula BooleanFormula
- 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
- interruptible_name :: Name
- threadsafe_name :: Name
- stdcall_name :: Name
- ccall_name :: Name
- cplusplus_name :: Name
- dotnet_name :: Name
- jvm_name :: Name
- js_name :: Name
- javascript_name :: Name
- capi_name :: Name
- forall_name :: Name
- family_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
  }

# Modules

data Module

A complete Haskell source module.

Constructors

Module SrcLoc ModuleName [ModulePragma] (Maybe WarningText) (Maybe [ExportSpec]) [ImportDecl] [Decl] |

Instances

Eq Module |
Data Module |
Ord Module |
Show Module |
Generic Module |
AppFixity Module |
Pretty Module |
type Rep Module |

data WarningText

Warning text to optionally use in the module header of e.g. a deprecated module.

Constructors

DeprText String |
WarnText String |

Instances

Eq WarningText |
Data WarningText |
Ord WarningText |
Show WarningText |
Generic WarningText |
type Rep WarningText |

data ExportSpec

An item in a module's export specification.

Constructors

EVar QName | variable.
EAbs Namespace QName | `T`: a class or datatype exported abstractly, or a type synonym.
EThingAll QName | `T(..)`: 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 ModuleName | `module M`: re-export a module.

Instances

Eq ExportSpec |
Data ExportSpec |
Ord ExportSpec |
Show ExportSpec |
Generic ExportSpec |
Pretty ExportSpec |
type Rep ExportSpec |

data ImportDecl

An import declaration.

Constructors

ImportDecl |
Fields importLoc :: SrcLoc position of the `import` keyword. importModule :: ModuleName name of the module imported. importQualified :: Bool imported `qualified`? importSrc :: Bool imported with `{-# SOURCE #-}`? importSafe :: Bool Import `safe`? importPkg :: Maybe String imported with explicit package name importAs :: Maybe ModuleName optional 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`.

Instances

Eq ImportDecl |
Data ImportDecl |
Ord ImportDecl |
Show ImportDecl |
Generic ImportDecl |
Pretty ImportDecl |
type Rep ImportDecl |

data ImportSpec

An import specification, representing a single explicit item imported (or hidden) from a module.

Constructors

IVar Name | variable.
IAbs Namespace Name | `T`: the name of a class, datatype or type synonym.
IThingAll Name | `T(..)`: 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.

Instances

Eq ImportSpec |
Data ImportSpec |
Ord ImportSpec |
Show ImportSpec |
Generic ImportSpec |
Pretty ImportSpec |
type Rep ImportSpec |

data Assoc

Associativity of an operator.

Constructors

AssocNone | non-associative operator (declared with `infix`)
AssocLeft | left-associative operator (declared with `infixl`).
AssocRight | right-associative operator (declared with `infixr`)

Instances

Eq Assoc |
Data Assoc |
Ord Assoc |
Show Assoc |
Generic Assoc |
Pretty Assoc |
type Rep Assoc |

data Namespace

Namespaces for imports/exports.

Constructors

NoNamespace |
TypeNamespace |
PatternNamespace |

Instances

Eq Namespace |
Data Namespace |
Ord Namespace |
Show Namespace |
Generic Namespace |
Pretty Namespace |
type Rep Namespace |

# Declarations

data Decl

A top-level declaration.

Constructors

TypeDecl SrcLoc Name [TyVarBind] Type | A type declaration
TypeFamDecl SrcLoc Name [TyVarBind] (Maybe Kind) | A type family declaration
ClosedTypeFamDecl SrcLoc Name [TyVarBind] (Maybe Kind) [TypeEqn] | A closed 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 Type | A 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 (Maybe Overlap) [TyVarBind] Context QName [Type] [InstDecl] | An declaration of a type class instance
DerivDecl SrcLoc (Maybe Overlap) [TyVarBind] 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 Exp | A Template Haskell splicing declaration
TypeSig SrcLoc [Name] Type | A type signature declaration
PatSynSig SrcLoc Name (Maybe [TyVarBind]) Context Context Type | Pattern Synonym Signature
FunBind [Match] | A set of function binding clauses
PatBind SrcLoc Pat Rhs (Maybe Binds) | A pattern binding
ForImp SrcLoc CallConv Safety String Name Type | A foreign import declaration
ForExp SrcLoc CallConv String Name Type | A foreign export declaration
PatSyn SrcLoc Pat Pat PatternSynDirection |
RulePragmaDecl SrcLoc [Rule] | A RULES pragma
DeprPragmaDecl SrcLoc [([Name], String)] | A DEPRECATED pragma
WarnPragmaDecl SrcLoc [([Name], String)] | A WARNING pragma
InlineSig SrcLoc Bool Activation QName | An INLINE pragma
InlineConlikeSig SrcLoc Activation QName | An INLINE CONLIKE pragma
SpecSig SrcLoc Activation QName [Type] | A SPECIALISE pragma
SpecInlineSig SrcLoc Bool Activation QName [Type] | A SPECIALISE INLINE pragma
InstSig SrcLoc [TyVarBind] Context QName [Type] | A SPECIALISE instance pragma
AnnPragma SrcLoc Annotation | An ANN pragma
MinimalPragma SrcLoc (Maybe BooleanFormula) | A MINIMAL pragma
RoleAnnotDecl SrcLoc QName [Role] | A role annotation

Instances

Eq Decl |
Data Decl |
Ord Decl |
Show Decl |
Generic Decl |
AppFixity Decl |
Pretty Decl |
type Rep Decl |

data Binds

A binding group inside a `let` or `where` clause.

Constructors

BDecls [Decl] | An ordinary binding group
IPBinds [IPBind] | A binding group for implicit parameters

Instances

Eq Binds |
Data Binds |
Ord Binds |
Show Binds |
Generic Binds |
AppFixity Binds |
type Rep Binds |

data IPBind

A binding of an implicit parameter.

Constructors

IPBind SrcLoc IPName Exp |

Instances

Eq IPBind |
Data IPBind |
Ord IPBind |
Show IPBind |
Generic IPBind |
AppFixity IPBind |
Pretty IPBind |
type Rep IPBind |

data PatternSynDirection

Constructors

Unidirectional | A unidirectional pattern synonym with "<-"
ImplicitBidirectional | A bidirectional pattern synonym with "="
ExplicitBidirectional [Decl] | A birectional pattern synonym with the construction specified.

Instances

Eq PatternSynDirection |
Data PatternSynDirection |
Ord PatternSynDirection |
Show PatternSynDirection |
Generic PatternSynDirection |
type Rep PatternSynDirection |

## Type classes and instances

data ClassDecl

Declarations inside a class declaration.

Constructors

ClsDecl Decl | ordinary 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 Type | default choice for an associated type synonym
ClsDefSig SrcLoc Name Type | default signature

Instances

Eq ClassDecl |
Data ClassDecl |
Ord ClassDecl |
Show ClassDecl |
Generic ClassDecl |
AppFixity ClassDecl |
Pretty ClassDecl |
type Rep ClassDecl |

data InstDecl

Declarations inside an instance declaration.

Constructors

InsDecl Decl | ordinary declaration
InsType SrcLoc Type Type | an 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

Instances

Eq InstDecl |
Data InstDecl |
Ord InstDecl |
Show InstDecl |
Generic InstDecl |
AppFixity InstDecl |
Pretty InstDecl |
type Rep InstDecl |

type Deriving = (QName, [Type])

A single derived instance, which may have arguments since it may be a MPTC.

## Data type declarations

data DataOrNew

A flag stating whether a declaration is a data or newtype declaration.

Constructors

DataType |
NewType |

Instances

Eq DataOrNew |
Data DataOrNew |
Ord DataOrNew |
Show DataOrNew |
Generic DataOrNew |
Pretty DataOrNew |
type Rep DataOrNew |

data ConDecl

Declaration of an ordinary data constructor.

Constructors

ConDecl Name [Type] | ordinary data constructor
InfixConDecl Type Name Type | infix data constructor
RecDecl Name [([Name], Type)] | record constructor

Instances

Eq ConDecl |
Data ConDecl |
Ord ConDecl |
Show ConDecl |
Generic ConDecl |
Pretty ConDecl |
type Rep ConDecl |

data QualConDecl

A single constructor declaration within a data type declaration, which may have an existential quantification binding.

Constructors

QualConDecl SrcLoc [TyVarBind] Context ConDecl |

Instances

Eq QualConDecl |
Data QualConDecl |
Ord QualConDecl |
Show QualConDecl |
Generic QualConDecl |
Pretty QualConDecl |
type Rep QualConDecl |

data GadtDecl

A single constructor declaration in a GADT data type declaration.

Constructors

GadtDecl SrcLoc Name [([Name], Type)] Type |

Instances

Eq GadtDecl |
Data GadtDecl |
Ord GadtDecl |
Show GadtDecl |
Generic GadtDecl |
Pretty GadtDecl |
type Rep GadtDecl |

data BangType

The type of a constructor argument or field, optionally including a strictness annotation.

Constructors

BangedTy | strict component, marked with "`!`"
UnpackedTy | unboxed component, marked with an UNPACK pragma

Instances

Eq BangType |
Data BangType |
Ord BangType |
Show BangType |
Generic BangType |
Pretty BangType |
type Rep BangType |

## Function bindings

data Match

Clauses of a function binding.

Constructors

Match SrcLoc Name [Pat] (Maybe Type) Rhs (Maybe Binds) |

Instances

Eq Match |
Data Match |
Ord Match |
Show Match |
Generic Match |
AppFixity Match |
Pretty Match |
type Rep Match |

data Rhs

The right hand side of a function binding, pattern binding, or a case alternative.

Constructors

UnGuardedRhs Exp | unguarded right hand side (exp)
GuardedRhss [GuardedRhs] | guarded right hand side (gdrhs)

Instances

Eq Rhs |
Data Rhs |
Ord Rhs |
Show Rhs |
Generic Rhs |
AppFixity Rhs |
Pretty Rhs |
type Rep Rhs |

data GuardedRhs

A guarded right hand side `|` stmts `=` exp, or `|` stmts `->` exp for case alternatives. The guard is a series of statements when using pattern guards, otherwise it will be a single qualifier expression.

Constructors

GuardedRhs SrcLoc [Stmt] Exp |

Instances

Eq GuardedRhs |
Data GuardedRhs |
Ord GuardedRhs |
Show GuardedRhs |
Generic GuardedRhs |
AppFixity GuardedRhs |
Pretty GuardedRhs |
type Rep GuardedRhs |

# Class Assertions and Contexts

type Context = [Asst]

A context is a set of assertions

data FunDep

A functional dependency, given on the form l1 l2 ... ln -> r2 r3 .. rn

Constructors

FunDep [Name] [Name] |

Instances

Eq FunDep |
Data FunDep |
Ord FunDep |
Show FunDep |
Generic FunDep |
Pretty FunDep |
type Rep FunDep |

data Asst

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.

Constructors

ClassA QName [Type] | ordinary class assertion
AppA Name [Type] | constraint kind assertion, `Dict :: cxt a => Dict cxt`
InfixA Type QName Type | class assertion where the class name is given infix
IParam IPName Type | implicit parameter assertion
EqualP Type Type | type equality constraint
ParenA Asst | parenthesised class assertion
WildCardA (Maybe Name) | A wildcard

Instances

Eq Asst |
Data Asst |
Ord Asst |
Show Asst |
Generic Asst |
Pretty Asst |
type Rep Asst |

# Types

data Type

A type qualified with a context. An unqualified type has an empty context.

Constructors

TyForall (Maybe [TyVarBind]) Context Type | qualified type
TyFun Type Type | function type
TyTuple Boxed [Type] | tuple type, possibly boxed
TyList Type | list syntax, e.g. [a], as opposed to [] a
TyParArray Type | parallel array syntax, e.g. [:a:]
TyApp Type Type | application of a type constructor
TyVar Name | type variable
TyCon QName | named type or type constructor
TyParen Type | type surrounded by parentheses
TyInfix Type QName Type | infix type constructor
TyKind Type Kind | type with explicit kind signature
TyPromoted Promoted | promoted data type (-XDataKinds)
TyEquals Type Type | type equality predicate enabled by ConstraintKinds
TySplice Splice | template haskell splice type
TyBang BangType Type | Strict type marked with "`!`" or type marked with UNPACK pragma.
TyWildCard (Maybe Name) | Type wildcard

Instances

Eq Type |
Data Type |
Ord Type |
Show Type |
Pretty Type |

data Boxed

Flag denoting whether a tuple is boxed or unboxed.

Constructors

Boxed |
Unboxed |

Instances

Eq Boxed |
Data Boxed |
Ord Boxed |
Show Boxed |
Generic Boxed |
type Rep Boxed |

data Kind

An explicit kind annotation.

Constructors

KindStar | `*`, the kind of types
KindFn Kind Kind | `->`, the kind of a type constructor
KindParen Kind | a kind surrounded by parentheses
KindVar QName | a kind variable (as of yet unsupported by compilers)
KindApp Kind Kind |
    k1 k2
KindTuple [Kind] | `(k1,k2,k3)`, kind of a promoted tuple
KindList Kind | `[k1]`, kind of a promoted list

Instances

Eq Kind |
Data Kind |
Ord Kind |
Show Kind |
Generic Kind |
Pretty Kind |
type Rep Kind |

data TyVarBind

A type variable declaration, optionally with an explicit kind annotation.

Constructors

KindedVar Name Kind | variable binding with kind annotation
UnkindedVar Name | ordinary variable binding

Instances

Eq TyVarBind |
Data TyVarBind |
Ord TyVarBind |
Show TyVarBind |
Generic TyVarBind |
Pretty TyVarBind |
type Rep TyVarBind |

data Promoted

Constructors

PromotedInteger Integer |
PromotedString String |
PromotedCon Bool QName |
PromotedList Bool [Type] |
PromotedTuple [Type] |
PromotedUnit |

Instances

Eq Promoted |
Data Promoted |
Ord Promoted |
Show Promoted |
Generic Promoted |
Pretty Promoted |
type Rep Promoted |

data TypeEqn

A type equation of the form `rhs = lhs` used in closed type families.

Constructors

TypeEqn Type Type |

Instances

Eq TypeEqn |
Data TypeEqn |
Ord TypeEqn |
Show TypeEqn |
Generic TypeEqn |
Pretty TypeEqn |
type Rep TypeEqn |

# Expressions

data Exp

Haskell expressions.

Constructors

Var QName | variable
IPVar IPName | implicit parameter variable
Con QName | data constructor
Lit Literal | literal constant
InfixApp Exp QOp Exp | infix application
App Exp Exp | ordinary application
NegApp Exp | negation expression `-exp` (unary minus)
Lambda SrcLoc [Pat] Exp | lambda expression
Let Binds Exp | local declarations with `let` ... `in` ...
If Exp Exp Exp | `if` exp `then` exp `else` exp
MultiIf [GuardedRhs] | `if` `|` exp `->` 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 Boxed [Exp] | tuple expression
TupleSection Boxed [Maybe Exp] | tuple section expression, e.g. `(,,3)`
List [Exp] | list expression
ParArray [Exp] | parallel array expression
Paren Exp | parenthesised expression
LeftSection Exp QOp | left section `(`exp qop`)`
RightSection QOp Exp | right section `(`qop exp`)`
RecConstr QName [FieldUpdate] | record construction expression
RecUpdate Exp [FieldUpdate] | record update expression
EnumFrom Exp | unbounded arithmetic sequence, incrementing by 1: `[from ..]`
EnumFromTo Exp Exp | bounded arithmetic sequence, incrementing by 1 `[from .. to]`
EnumFromThen Exp Exp | unbounded arithmetic sequence, with first two elements given `[from, then ..]`
EnumFromThenTo Exp Exp Exp | bounded arithmetic sequence, with first two elements given `[from, then .. to]`
ParArrayFromTo Exp Exp | bounded arithmetic sequence, incrementing by 1 `[from .. to]`
ParArrayFromThenTo Exp Exp Exp | bounded arithmetic sequence, with first two elements given `[from, then .. to]`
ListComp Exp [QualStmt] | ordinary list comprehension
ParComp Exp [[QualStmt]] | parallel list comprehension
ParArrayComp Exp [[QualStmt]] | parallel array comprehension
ExpTypeSig SrcLoc Exp Type | expression with explicit type signature
VarQuote QName | `'x` for template haskell reifying of expressions
TypQuote QName | `''T` for template haskell reifying of types
BracketExp Bracket | template haskell bracket expression
SpliceExp Splice | template haskell splice expression
QuasiQuote String String | quasi-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 String | PCDATA child element
XExpTag Exp | escaped haskell expression inside xml
XChildTag SrcLoc [Exp] | children of an xml element
CorePragma String Exp | CORE pragma
SCCPragma String Exp | SCC pragma
GenPragma String (Int, Int) (Int, Int) Exp | GENERATED pragma
Proc SrcLoc Pat Exp | arrows proc: `proc` pat `->` exp
LeftArrApp Exp Exp | arrow application (from left): exp `-<` exp
RightArrApp Exp Exp | arrow application (from right): exp `>-` exp
LeftArrHighApp Exp Exp | higher-order arrow application (from left): exp `-<<` exp
RightArrHighApp Exp Exp | higher-order arrow application (from right): exp `>>-` exp
LCase [Alt] | `case` alts
ExprHole | Expression hole

Instances

Eq Exp |
Data Exp |
Ord Exp |
Show Exp |
Generic Exp |
AppFixity Exp |
Pretty Exp |
type Rep Exp |

data Stmt

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.

Constructors

Generator SrcLoc Pat Exp | a generator: pat `<-` exp
Qualifier Exp | an exp by itself: in a `do`-expression, an action whose result is discarded; in a list comprehension and pattern guard, a guard expression
LetStmt Binds | local bindings
RecStmt [Stmt] | a recursive binding group for arrows

Instances

Eq Stmt |
Data Stmt |
Ord Stmt |
Show Stmt |
Generic Stmt |
AppFixity Stmt |
Pretty Stmt |
type Rep Stmt |

data QualStmt

A general transqual in a list comprehension, which could potentially be a transform of the kind enabled by TransformListComp.

Constructors

QualStmt Stmt | an ordinary statement
ThenTrans Exp | `then` exp
ThenBy Exp Exp | `then` exp `by` exp
GroupBy Exp | `then` `group` `by` exp
GroupUsing Exp | `then` `group` `using` exp
GroupByUsing Exp Exp | `then` `group` `by` exp `using` exp

Instances

Eq QualStmt |
Data QualStmt |
Ord QualStmt |
Show QualStmt |
Generic QualStmt |
AppFixity QualStmt |
Pretty QualStmt |
type Rep QualStmt |

data FieldUpdate

An fbind in a labeled construction or update expression.

Constructors

FieldUpdate QName Exp | ordinary label-expresion pair
FieldPun QName | record field pun
FieldWildcard | record field wildcard

Instances

Eq FieldUpdate |
Data FieldUpdate |
Ord FieldUpdate |
Show FieldUpdate |
Generic FieldUpdate |
AppFixity FieldUpdate |
Pretty FieldUpdate |
type Rep FieldUpdate |

data Alt

An alt alternative in a `case` expression.

Constructors

Alt SrcLoc Pat Rhs (Maybe Binds) |

Instances

Eq Alt |
Data Alt |
Ord Alt |
Show Alt |
Generic Alt |
AppFixity Alt |
Pretty Alt |
type Rep Alt |

data XAttr

An xml attribute, which is a name-expression pair.

Constructors

XAttr XName Exp |

Instances

Eq XAttr |
Data XAttr |
Ord XAttr |
Show XAttr |
Generic XAttr |
AppFixity XAttr |
Pretty XAttr |
type Rep XAttr |

# Patterns

data Pat

A pattern, to be matched against a value.

Constructors

PVar Name | variable
PLit Sign Literal | literal constant
PNPlusK Name Integer | n+k pattern
PInfixApp Pat QName Pat | pattern with an infix data constructor
PApp QName [Pat] | data constructor and argument patterns
PTuple Boxed [Pat] | tuple pattern
PList [Pat] | list pattern
PParen Pat | parenthesized pattern
PRec QName [PatField] | labelled pattern, record style
PAsPat Name Pat | `@`-pattern
PWildCard | wildcard pattern: `_`
PIrrPat Pat | irrefutable pattern: `~pat`
PatTypeSig SrcLoc Pat Type | pattern with type signature
PViewPat Exp Pat | view 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 String | XML PCDATA pattern
PXPatTag Pat | XML embedded pattern
PXRPats [RPat] | XML regular list pattern
PQuasiQuote String String | quasi quote patter: `[$name| string |]`
PBangPat Pat | strict (bang) pattern: `f !x = ...`

Instances

Eq Pat |
Data Pat |
Ord Pat |
Show Pat |
Generic Pat |
AppFixity Pat |
Pretty Pat |
type Rep Pat |

data PatField

An fpat in a labeled record pattern.

Constructors

PFieldPat QName Pat | ordinary label-pattern pair
PFieldPun QName | record field pun
PFieldWildcard | record field wildcard

Instances

Eq PatField |
Data PatField |
Ord PatField |
Show PatField |
Generic PatField |
AppFixity PatField |
Pretty PatField |
type Rep PatField |

data PXAttr

An XML attribute in a pattern.

Constructors

PXAttr XName Pat |

Instances

Eq PXAttr |
Data PXAttr |
Ord PXAttr |
Show PXAttr |
Generic PXAttr |
AppFixity PXAttr |
Pretty PXAttr |
type Rep PXAttr |

data RPat

An entity in a regular pattern.

Constructors

RPOp RPat RPatOp | operator pattern, e.g. pat*
RPEither RPat RPat | choice pattern, e.g. (1 | 2)
RPSeq [RPat] | sequence pattern, e.g. (| 1, 2, 3 |)
RPGuard Pat [Stmt] | guarded pattern, e.g. (| p | p < 3 |)
RPCAs Name RPat | non-linear variable binding, e.g. (foo@:(1 | 2))*
RPAs Name RPat | linear variable binding, e.g. foo@(1 | 2)
RPParen RPat | parenthesised pattern, e.g. (2*)
RPPat Pat | an ordinary pattern

Instances

Eq RPat |
Data RPat |
Ord RPat |
Show RPat |
Generic RPat |
AppFixity RPat |
Pretty RPat |
type Rep RPat |

data RPatOp

A regular pattern operator.

Constructors

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

Instances

Eq RPatOp |
Data RPatOp |
Ord RPatOp |
Show RPatOp |
Generic RPatOp |
Pretty RPatOp |
type Rep RPatOp |

# Literals

data Literal

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.

Constructors

Char Char | character literal
String String | string literal
Int Integer | integer literal
Frac Rational | floating point literal
PrimInt Integer | unboxed integer literal
PrimWord Integer | unboxed word literal
PrimFloat Rational | unboxed float literal
PrimDouble Rational | unboxed double literal
PrimChar Char | unboxed character literal
PrimString String | unboxed string literal

Instances

Eq Literal |
Data Literal |
Ord Literal |
Show Literal |
Generic Literal |
Pretty Literal |
type Rep Literal |

data Sign

An indication whether a literal pattern has been negated or not.

Constructors

Signless |
Negative |

Instances

Eq Sign |
Data Sign |
Ord Sign |
Show Sign |
Generic Sign |
type Rep Sign |

# Variables, Constructors and Operators

newtype ModuleName

The name of a Haskell module.

Constructors

ModuleName String |

Instances

Eq ModuleName |
Data ModuleName |
Ord ModuleName |
Show ModuleName |
Generic ModuleName |
Pretty ModuleName |
type Rep ModuleName |

data QName

This type is used to represent qualified variables, and also qualified constructors.

Constructors

Qual ModuleName Name | name qualified with a module name
UnQual Name | unqualified local name
Special SpecialCon | built-in constructor with special syntax

Instances

Eq QName |
Data QName |
Ord QName |
Show QName |
Generic QName |
Pretty QName |
type Rep QName |

data Name

This type is used to represent variables, and also constructors.

Constructors

Ident String | varid or conid.
Symbol String | varsym or consym

Instances

Eq Name |
Data Name |
Ord Name |
Show Name |
Generic Name |
Pretty Name |
type Rep Name |

data QOp

Possibly qualified infix operators (qop), appearing in expressions.

Constructors

QVarOp QName | variable operator (qvarop)
QConOp QName | constructor operator (qconop)

Instances

Eq QOp |
Data QOp |
Ord QOp |
Show QOp |
Generic QOp |
Pretty QOp |
type Rep QOp |

data Op

Operators appearing in `infix` declarations are never qualified.

Constructors

VarOp Name | variable operator (varop)
ConOp Name | constructor operator (conop)

Instances

Eq Op |
Data Op |
Ord Op |
Show Op |
Generic Op |
Pretty Op |
type Rep Op |

data SpecialCon

Constructors with special syntax. These names are never qualified, and always refer to builtin type or data constructors.

Constructors

UnitCon | unit type and data constructor `()`
ListCon | list type constructor `[]`
FunCon | function type constructor `->`
TupleCon Boxed Int | n-ary tuple type and data constructors `(,)` etc, possibly boxed `(#,#)`
Cons | list data constructor `(:)`
UnboxedSingleCon | unboxed singleton tuple constructor `(# #)`

Instances

Eq SpecialCon |
Data SpecialCon |
Ord SpecialCon |
Show SpecialCon |
Generic SpecialCon |
Pretty SpecialCon |
type Rep SpecialCon |

data CName

A name (cname) of a component of a class or data type in an `import` or export specification.

Constructors

VarName Name | name of a method or field
ConName Name | name of a data constructor

Instances

Eq CName |
Data CName |
Ord CName |
Show CName |
Generic CName |
Pretty CName |
type Rep CName |

data IPName

An implicit parameter name.

Constructors

IPDup String | ?ident, non-linear implicit parameter
IPLin String | %ident, linear implicit parameter

Instances

Eq IPName |
Data IPName |
Ord IPName |
Show IPName |
Generic IPName |
Pretty IPName |
type Rep IPName |

data XName

The name of an xml element or attribute, possibly qualified with a namespace.

Constructors

XName String |
XDomName String String |

Instances

Eq XName |
Data XName |
Ord XName |
Show XName |
Generic XName |
Pretty XName |
type Rep XName |

data Role

Constructors

Nominal |
Representational |
Phantom |
RoleWildcard |

Instances

Eq Role |
Data Role |
Ord Role |
Show Role |
Generic Role |
Pretty Role |
type Rep Role |

# Template Haskell

data Bracket

A template haskell bracket expression.

Constructors

ExpBracket Exp | expression bracket: `[| ... |]`
PatBracket Pat | pattern bracket: `[p| ... |]`
TypeBracket Type | type bracket: `[t| ... |]`
DeclBracket [Decl] | declaration bracket: `[d| ... |]`

Instances

Eq Bracket |
Data Bracket |
Ord Bracket |
Show Bracket |
Generic Bracket |
AppFixity Bracket |
Pretty Bracket |
type Rep Bracket |

data Splice

A template haskell splice expression

Constructors

IdSplice String | variable splice: `$var`
ParenSplice Exp | parenthesised expression splice: `$(exp)`

Instances

Eq Splice |
Data Splice |
Ord Splice |
Show Splice |
Generic Splice |
AppFixity Splice |
Pretty Splice |
type Rep Splice |

# FFI

data Safety

The safety of a foreign function call.

Constructors

PlayRisky | unsafe
PlaySafe Bool | safe (`False`) or threadsafe (`True`)
PlayInterruptible | interruptible

Instances

Eq Safety |
Data Safety |
Ord Safety |
Show Safety |
Generic Safety |
Pretty Safety |
type Rep Safety |

data CallConv

The calling convention of a foreign function call.

Constructors

StdCall |
CCall |
CPlusPlus |
DotNet |
Jvm |
Js |
JavaScript |
CApi |

Instances

Eq CallConv |
Data CallConv |
Ord CallConv |
Show CallConv |
Generic CallConv |
Pretty CallConv |
type Rep CallConv |

# Pragmas

data ModulePragma

A top level options pragma, preceding the module header.

Constructors

LanguagePragma SrcLoc [Name] | LANGUAGE pragma
OptionsPragma SrcLoc (Maybe Tool) String | OPTIONS pragma, possibly qualified with a tool, e.g. OPTIONS_GHC
AnnModulePragma SrcLoc Annotation | ANN pragma with module scope

Instances

Eq ModulePragma |
Data ModulePragma |
Ord ModulePragma |
Show ModulePragma |
Generic ModulePragma |
Pretty ModulePragma |
type Rep ModulePragma |

data Tool

Recognised tools for OPTIONS pragmas.

Constructors

GHC |
HUGS |
NHC98 |
YHC |
HADDOCK |
UnknownTool String |

Instances

Eq Tool |
Data Tool |
Ord Tool |
Show Tool |
Generic Tool |
Pretty Tool |
type Rep Tool |

data Overlap

Recognised overlaps for overlap pragmas.

Constructors

NoOverlap | NO_OVERLAP pragma
Overlap | OVERLAP pragma
Incoherent | INCOHERENT pragma

Instances

Eq Overlap |
Data Overlap |
Ord Overlap |
Show Overlap |
Generic Overlap |
Pretty Overlap |
type Rep Overlap |

data Rule

The body of a RULES pragma.

Constructors

Rule String Activation (Maybe [RuleVar]) Exp Exp |

Instances

Eq Rule |
Data Rule |
Ord Rule |
Show Rule |
Generic Rule |
Pretty Rule |
type Rep Rule |

data RuleVar

Variables used in a RULES pragma, optionally annotated with types

Constructors

RuleVar Name |
TypedRuleVar Name Type |

Instances

Eq RuleVar |
Data RuleVar |
Ord RuleVar |
Show RuleVar |
Generic RuleVar |
Pretty RuleVar |
type Rep RuleVar |

data Activation

Activation clause of a RULES pragma.

Constructors

AlwaysActive |
ActiveFrom Int |
ActiveUntil Int |

Instances

Eq Activation |
Data Activation |
Ord Activation |
Show Activation |
Generic Activation |
Pretty Activation |
type Rep Activation |

data Annotation

An annotation through an ANN pragma.

Constructors

Ann Name Exp | An annotation for a declared name.
TypeAnn Name Exp | An annotation for a declared type.
ModuleAnn Exp | An annotation for the defining module.

Instances

Eq Annotation |
Data Annotation |
Ord Annotation |
Show Annotation |
Generic Annotation |
AppFixity Annotation |
Pretty Annotation |
type Rep Annotation |

data BooleanFormula

A boolean formula for MINIMAL pragmas.

Constructors

VarFormula Name | A variable.
AndFormula [BooleanFormula] | And boolean formulas.
OrFormula [BooleanFormula] | Or boolean formulas.
ParenFormula BooleanFormula | Parenthesized boolean formulas.

Instances

Eq BooleanFormula |
Data BooleanFormula |
Ord BooleanFormula |
Show BooleanFormula |
Generic BooleanFormula |
Pretty BooleanFormula |
type Rep BooleanFormula |

# Builtin names

## Modules

prelude_mod :: ModuleName

main_mod :: ModuleName

## Main function of a program

main_name :: Name

## Constructors

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

## Special identifiers

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

interruptible_name :: Name

threadsafe_name :: Name

stdcall_name :: Name

ccall_name :: Name

cplusplus_name :: Name

dotnet_name :: Name

jvm_name :: Name

js_name :: Name

javascript_name :: Name

capi_name :: Name

forall_name :: Name

family_name :: Name

## Type constructors

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

# Source coordinates

data SrcLoc

A single position in the source.

Constructors

SrcLoc |
Fields srcFilename :: String srcLine :: Int srcColumn :: Int

Instances

Eq SrcLoc |
Data SrcLoc |
Ord SrcLoc |
Show SrcLoc |
Generic SrcLoc |
SrcInfo SrcLoc |
Pretty SrcLoc |
type Rep SrcLoc |