Copyright | (c) Henrique Ferreiro García 2008 (c) David Castro Pérez 2008 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Alex Kropivny <alex.kropivny@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
A suite of datatypes describing the abstract syntax of CoreErlang 1.0.3. http://www.it.uu.se/research/group/hipe/cerl/
- data Module = Module Atom [Function] [(Atom, Const)] [FunDef]
- data FunDef = FunDef (Ann Function) (Ann Exp)
- data Exp
- = Var Var
- | Lit Literal
- | Fun Function
- | App Exps [Exps]
- | ModCall (Exps, Exps) [Exps]
- | Lambda [Var] Exps
- | Seq Exps Exps
- | Let ([Var], Exps) Exps
- | LetRec [FunDef] Exps
- | Case Exps [Ann Alt]
- | Tuple [Exps]
- | List (List Exps)
- | Binary [BitString Exps]
- | Op Atom [Exps]
- | Try Exps ([Var], Exps) ([Var], Exps)
- | Rec [Ann Alt] TimeOut
- | Catch Exps
- data Exps
- data Alt = Alt Pats Guard Exps
- data Guard = Guard Exps
- data List a
- data TimeOut = TimeOut Exps Exps
- data BitString a = BitString a [Exps]
- data Function = Function (Atom, Integer)
- data Pats
- data Pat
- data Alias = Alias Var Pat
- data Literal
- data Const
- data Atom = Atom String
- type Var = String
- data Ann a
Modules
A CoreErlang source module.
Declarations
This type is used to represent lambdas
Expressions
CoreErlang expression.
Var Var | variable |
Lit Literal | literal constant |
Fun Function | function name |
App Exps [Exps] | application |
ModCall (Exps, Exps) [Exps] | module call |
Lambda [Var] Exps | lambda expression |
Seq Exps Exps | sequencing |
Let ([Var], Exps) Exps | local declaration |
LetRec [FunDef] Exps | letrec expression |
Case Exps [Ann Alt] |
|
Tuple [Exps] | tuple expression |
List (List Exps) | list expression |
Binary [BitString Exps] | binary expression |
Op Atom [Exps] | operator application |
Try Exps ([Var], Exps) ([Var], Exps) | try expression |
Rec [Ann Alt] TimeOut | receive expression |
Catch Exps | catch expression |
CoreErlang expressions.
An alt in a case
expression
A guarded alternative when
exp ->
exp.
The first expression will be Boolean-valued.
A list of expressions
The timeout of a receive expression
A bitstring.
This type is used to represent function names
Patterns
A pattern, to be matched against a value.
An alias, used in patterns
Literals
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.
This type is used to represent constants
This type is used to represent atoms