free-compiler-0.3.0.0: A Haskell to Coq compiler.

Safe HaskellSafe
LanguageHaskell2010

FreeC.IR.Base.Prelude

Description

This module contains the names of built-in data types and operations from the Prelude module that are needed for code generation.

For example, to infer the type of integer literals, we have to know the name of the Integer data type and to desugar list literals we have to know the names of the list constructors.

However, this module contains only names, the actual environment entries are defined in the module interface file of the Prelude. This way, the Prelude and the compiler are decoupled from each other. Even though the names listed in this module are not allowed to be changed, additional functions can be added to the Prelude without rebuilding the compiler.

Synopsis

Documentation

modName :: ModName Source #

The name of the Prelude module.

TODO once import ... as ... is supported, the Prelude could be renamed by the user.

unitTypeConName :: TypeConName Source #

The name of the unit type constructor.

tupleTypeConName :: Int -> TypeConName Source #

The name of the n-ary tuple type constructor.

listTypeConName :: TypeConName Source #

The name of the list type constructor.

unitConName :: ConName Source #

Name of the unit data constructor.

nilConName :: ConName Source #

The name of the empty list data constructor.

consConName :: ConName Source #

The name of the non-empty list data constructor.

tupleConName :: Int -> ConName Source #

The name of the n-ary tuple data constructor.

integerTypeConName :: TypeConName Source #

When inferring the type of integer literals this is the type to infer.

boolTypeConName :: TypeConName Source #

When inferring the type of if expressions this is the type to infer for the condition.

negateOpName :: VarName Source #

The unary prefix operator - is translated to the application of the negate function.

errorFuncName :: VarName Source #

The name of the error function.

undefinedFuncName :: VarName Source #

The name of the undefined function.

traceFuncName :: VarName Source #

The name of the trace function.