|
Language.Haskell.Syntax | Portability | portable | Stability | experimental | Maintainer | libraries@haskell.org |
|
|
|
|
Contents |
- Modules
- Declarations
- Class Assertions and Contexts
- Types
- Expressions
- Patterns
- Literals
- Variables, Constructors and Operators
- 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 a few extensions: |
|
Synopsis |
|
|
|
|
Modules |
|
data HsModule |
|
|
data HsExportSpec |
Export specification. | Constructors | HsEVar HsQName | variable | HsEAbs HsQName | T:
a class or datatype exported abstractly,
or a type synonym. | HsEThingAll HsQName | T(..):
a class exported with all of its methods, or
a datatype exported with all of its constructors. | HsEThingWith HsQName [HsCName] | T(C_1,...,C_n):
a class exported with some of its methods, or
a datatype exported with some of its constructors. | HsEModuleContents Module | module M:
re-export a module. |
| Instances | |
|
|
data HsImportDecl |
Import declaration. | Constructors | | Instances | |
|
|
data HsImportSpec |
Import specification. | Constructors | HsIVar HsName | variable | HsIAbs HsName | T:
the name of a class, datatype or type synonym. | HsIThingAll HsName | T(..):
a class imported with all of its methods, or
a datatype imported with all of its constructors. | HsIThingWith HsName [HsCName] | T(C_1,...,C_n):
a class imported with some of its methods, or
a datatype imported with some of its constructors. |
| Instances | |
|
|
data HsAssoc |
Constructors | HsAssocNone | | HsAssocLeft | | HsAssocRight | |
| Instances | |
|
|
Declarations |
|
data HsDecl |
|
|
data HsConDecl |
|
|
data HsBangType |
|
|
data HsMatch |
|
|
data HsRhs |
|
|
data HsGuardedRhs |
|
|
Class Assertions and Contexts |
|
data HsQualType |
A type qualified with a context.
An unqualified type has an empty context. | Constructors | | Instances | |
|
|
type HsContext = [HsAsst] |
|
type HsAsst = (HsQName, [HsType]) |
Class assertions.
In Haskell 98, the argument would be a tyvar, but this definition
allows multiple parameters, and allows them to be types. |
|
Types |
|
data HsType |
|
|
Expressions |
|
data HsExp |
Haskell expressions.
Because it is difficult for parsers to distinguish patterns from
expressions, they typically parse them in the same way and then check
that they have the appropriate form. Hence the expression type
includes some forms that are found only in patterns. After these
checks, these constructors should not be used. | Constructors | | Instances | |
|
|
data HsStmt |
This type represents both stmt in a do-expression,
and qual in a list comprehension. | Constructors | | Instances | |
|
|
data HsFieldUpdate |
An fbind in a labeled construction or update. | Constructors | | Instances | |
|
|
data HsAlt |
|
|
data HsGuardedAlts |
|
|
data HsGuardedAlt |
|
|
Patterns |
|
data HsPat |
|
|
data HsPatField |
|
|
Literals |
|
data HsLiteral |
literal | Constructors | | Instances | |
|
|
Variables, Constructors and Operators |
|
data Module |
|
|
data HsQName |
This type is used to represent qualified variables, and also
qualified constructors. | Constructors | | Instances | |
|
|
data HsName |
This type is used to represent variables, and also constructors. | Constructors | HsIdent String | varid or conid. | HsSymbol String | varsym or consym |
| Instances | |
|
|
data HsQOp |
Possibly qualified infix operators (qop), appearing in expressions. | Constructors | | Instances | |
|
|
data HsOp |
Operators, appearing in infix declarations. | Constructors | | Instances | |
|
|
data HsSpecialCon |
Constructors with special syntax.
These names are never qualified, and always refer to builtin type or
data constructors. | Constructors | HsUnitCon | Unit type and data constructor () | HsListCon | List type constructor [] | HsFunCon | Function type constructor -> | HsTupleCon Int | n-ary tuple type and data
constructors (,) etc | HsCons | list data constructor (:) |
| Instances | |
|
|
data HsCName |
|
|
Builtin names |
|
Modules |
|
prelude_mod :: Module |
|
main_mod :: Module |
|
Main function of a program |
|
main_name :: HsName |
|
Constructors |
|
unit_con_name :: HsQName |
|
tuple_con_name :: Int -> HsQName |
|
list_cons_name :: HsQName |
|
unit_con :: HsExp |
|
tuple_con :: Int -> HsExp |
|
Special identifiers |
|
as_name :: HsName |
|
qualified_name :: HsName |
|
hiding_name :: HsName |
|
minus_name :: HsName |
|
pling_name :: HsName |
|
Type constructors |
|
unit_tycon_name :: HsQName |
|
fun_tycon_name :: HsQName |
|
list_tycon_name :: HsQName |
|
tuple_tycon_name :: Int -> HsQName |
|
unit_tycon :: HsType |
|
fun_tycon :: HsType |
|
list_tycon :: HsType |
|
tuple_tycon :: Int -> HsType |
|
Source coordinates |
|
data SrcLoc |
A position in the source. | Constructors | |
|
|
Produced by Haddock version 0.3 |