CoreErlang-0.0.3: Manipulating Core Erlang source code

Copyright(c) Henrique Ferreiro García 2008 (c) David Castro Pérez 2008
LicenseBSD-style (see the file LICENSE)
MaintainerAlex Kropivny <alex.kropivny@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Language.CoreErlang.Syntax

Contents

Description

A suite of datatypes describing the abstract syntax of CoreErlang 1.0.3. http://www.it.uu.se/research/group/hipe/cerl/

Synopsis

Modules

data Module Source

A CoreErlang source module.

Constructors

Module Atom [Function] [(Atom, Const)] [FunDef] 

Declarations

data FunDef Source

This type is used to represent lambdas

Constructors

FunDef (Ann Function) (Ann Exp) 

Expressions

data Exp Source

CoreErlang expression.

Constructors

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]

case exp of alts end

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

data Exps Source

CoreErlang expressions.

Constructors

Exp (Ann Exp)

single expression

Exps (Ann [Ann Exp])

list of expressions

data Alt Source

An alt in a case expression

Constructors

Alt Pats Guard Exps 

data Guard Source

A guarded alternative when exp -> exp. The first expression will be Boolean-valued.

Constructors

Guard Exps 

data List a Source

A list of expressions

Constructors

L [a] 
LL [a] a 

Instances

Eq a => Eq (List a) Source 
Data a => Data (List a) Source 
Ord a => Ord (List a) Source 
Show a => Show (List a) Source 
Pretty a => Pretty (List a) Source 

data TimeOut Source

The timeout of a receive expression

Constructors

TimeOut Exps Exps 

data BitString a Source

A bitstring.

Constructors

BitString a [Exps] 

Instances

data Function Source

This type is used to represent function names

Constructors

Function (Atom, Integer) 

Patterns

data Pats Source

Constructors

Pat Pat

single pattern

Pats [Pat]

list of patterns

data Pat Source

A pattern, to be matched against a value.

Constructors

PVar Var

variable

PLit Literal

literal constant

PTuple [Pat]

tuple pattern

PList (List Pat)

list pattern

PBinary [BitString Pat]

list of bitstring patterns

PAlias Alias

alias pattern

data Alias Source

An alias, used in patterns

Constructors

Alias Var Pat 

Literals

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.

Constructors

LChar Char

character literal

LString String

string literal

LInt Integer

integer literal

LFloat Double

floating point literal

LAtom Atom

atom literal

LNil

empty list

data Const Source

This type is used to represent constants

Constructors

CLit Literal 
CTuple [Const] 
CList (List Const) 

data Atom Source

This type is used to represent atoms

Constructors

Atom String 

Variables

type Var = String Source

This type is used to represent variables

Annotations

data Ann a Source

An annotation for modules, variables, ...

Constructors

Constr a

core erlang construct

Ann a [Const]

core erlang annotated construct

Instances

Eq a => Eq (Ann a) Source 
Data a => Data (Ann a) Source 
Ord a => Ord (Ann a) Source 
Show a => Show (Ann a) Source 
Pretty a => Pretty (Ann a) Source