circ-0.0.3: A Compiler IR Compiler.

Safe HaskellSafe-Infered




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


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.


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.


TypeDef TypeName [TypeParam] [CtorDef] 

data CtorDef Source

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


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.