Safe Haskell | Safe-Infered |
---|
Compiler IR Compiler (CIRC): A language for specifying compiler intermediate representations.
- data Spec = Spec Name [Import] TypeName [TypeDef] [Transform]
- data Transform = Transform ModuleName [Import] [Import] [(CtorName, ModuleName -> Code)] [TypeRefinement]
- data Type
- data TypeDef = TypeDef TypeName [TypeParam] [CtorDef]
- data CtorDef = CtorDef CtorName [Type]
- data TypeRefinement
- type Name = String
- type ModuleName = String
- type CtorName = String
- type TypeName = String
- type TypeParam = String
- type Code = String
- type Import = String
- t :: String -> Type
- indent :: String -> String
- circ :: Spec -> IO ()
CIRC Specifications
A specification is a module name for the initial type, common imports, the root type, the initial type definitions, and a list of transforms.
A transform is a module name, the constructor to be transformed, a list of new type definitions, and the implementation (imports and code).
Transform ModuleName [Import] [Import] [(CtorName, ModuleName -> Code)] [TypeRefinement] |
A type definition is a name, a list of type parameters, and a list of constructor definitions.
A constructor definition is a name and a list of type arguments.
data TypeRefinement Source
A type refinement.
type ModuleName = StringSource