ddc-core-eval-0.3.1.1: Disciplined Disciple Compiler semantic evaluator for the core language.

Safe HaskellNone

DDC.Core.Eval.Name

Synopsis

Documentation

data Name Source

Names of things recognised by the evaluator.

Constructors

NameVar String

User variables.

NameCon String

User constructors.

NameInt Integer

Integer literals (which data constructors).

NamePrimCon PrimCon

Primitive constructors (eg List, Nil).

NamePrimOp PrimOp

Primitive operators (eg addInt, subInt).

NameLoc Loc

Store locations.

NameRgn Rgn

Region handles.

NameCap Cap

Store capabilities.

data PrimCon Source

A primitive constructor.

Constructors

PrimTyConInt

Int type constructor.

PrimTyConPair

Pair type constructor.

PrimTyConList

List type constructor.

PrimDaConPr

P data construct (pairs).

PrimDaConNil

Nil data constructor.

PrimDaConCons

Cons data constructor.

data Loc Source

A store location.

These are pretty printed like L4#.

Constructors

Loc Int 

Instances

data Rgn Source

A region handle.

These are pretty printed like R5#.

Constructors

Rgn Int 

Instances

data Cap Source

These are primitive witnesses that guarantee the associated property of the program. Ostensibly, they are only introduced by the system at runtime, but for testing purposes we can also inject them into the source program.

Constructors

CapGlobal

Witness that a region is global. Global regions live for the duration of the program and are not deallocated in a stack like manner. This lets us hide the use of such regions, and rely on the garbage collector to reclaim the space.

CapConst

Witness that a region is constant. This lets us purify read and allocation effects on it, and prevents it from being Mutable.

CapMutable

Witness that a region is mutable. This lets us update objects in the region, and prevents it from being Constant.

CapDistinct Int

Witness that some regions are distinct This lets us perform aliasing based optimisations.

CapLazy

Witness that a region is lazy. This lets is allocate thunks into the region, and prevents it from being Manifest.

CapManifest

Witness that a region is manifest. This ensures there are no thunks in the region, which prevents it from being Lazy.

Instances

readName :: String -> Maybe NameSource

Read a primitive name.

lexModuleString :: String -> Int -> String -> [Token (Tok Name)]Source

Lex a string to tokens, using primitive names.

The first argument gives the starting source line number.

lexExpString :: String -> Int -> String -> [Token (Tok Name)]Source

Lex a string to tokens, using primitive names.

The first argument gives the starting source line number.