circ-0.0.3: A Compiler IR Compiler.

Safe HaskellSafe-Infered

Language.CIRC

Contents

Description

Compiler IR Compiler (CIRC): A language for specifying compiler intermediate representations.

Synopsis

CIRC Specifications

data Spec Source

A specification is a module name for the initial type, common imports, the root type, the initial type definitions, and a list of transforms.

data Transform Source

A transform is a module name, the constructor to be transformed, a list of new type definitions, and the implementation (imports and code).

data Type Source

A type expression.

Constructors

T TypeName [Type] 
TList Type 
TMaybe Type 
TTuple [Type] 

data TypeDef Source

A type definition is a name, a list of type parameters, and a list of constructor definitions.

Constructors

TypeDef TypeName [TypeParam] [CtorDef] 

data CtorDef Source

A constructor definition is a name and a list of type arguments.

Constructors

CtorDef CtorName [Type] 

data TypeRefinement Source

A type refinement.

t :: String -> TypeSource

An unparameterized type.

indent :: String -> StringSource

Indents code with 2 spaces.

CIRC Compilation

circ :: Spec -> IO ()Source

Compiles a CIRC spec.