mini-ml-0.1.0.0: MiniML compiler
Safe HaskellSafe-Inferred
LanguageHaskell2010

Trees.Common

Synopsis

Common Components of Program Representations

Identifier

type IdCnt = Int Source #

Operators

data BinaryOperator Source #

Binary operator.

Constructors

BoolOp BooleanOperator

Boolean operator, see BooleanOperator.

ArithOp ArithmeticOperator

Arithmetic operator, see ArithmeticOperator.

CompOp ComparisonOperator

Comparison operator, see ComparisonOperator.

Instances

Instances details
Show BinaryOperator Source # 
Instance details

Defined in Trees.Common

Eq BinaryOperator Source # 
Instance details

Defined in Trees.Common

data ComparisonOperator Source #

Comparison operator.

Constructors

EqOp

Equality operator (a = b).

NeOp

Non-equality operator (a <> b).

LtOp

Less than operator (a < b).

LeOp

Less than or equal operator (a <= b).

GtOp

Greater than operator (a > b).

GeOp

Greater than or equal operator (a >= b).

Recursive Functions

Types

data Type Source #

All existing types.

Constructors

TUnit

Unit type

TBool

Boolean type.

TInt

Integer type.

TFun Type Type

Function type.

It contains the type of the first parameter and the result of the function (e.g., int -> (int -> bool -> bool)).

Instances

Instances details
Show Type Source # 
Instance details

Defined in Trees.Common

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Eq Type Source # 
Instance details

Defined in Trees.Common

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Ord Type Source # 
Instance details

Defined in Trees.Common

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

type Arity = Int Source #

Arity of a function.

Values

data PrimitiveValue Source #

Primitive value.

Constructors

PrimValUnit

Unit value (()).

PrimValBool Bool

Boolean value (true, false).

PrimValInt Int64

Int value (e.g., 0, 4, 15, 23).

Instances

Instances details
Show PrimitiveValue Source # 
Instance details

Defined in Trees.Common

Eq PrimitiveValue Source # 
Instance details

Defined in Trees.Common