ddc-core-tetra-0.4.1.3: Disciplined Disciple Compiler intermediate language.

Safe HaskellNone

DDC.Core.Tetra.Convert

Description

Conversion of Disciple Lite to Disciple Salt.

Synopsis

Documentation

saltOfTetraModuleSource

Arguments

:: Show a 
=> Platform

Platform specification.

-> Config

Runtime configuration.

-> DataDefs Name

Data type definitions.

-> KindEnv Name

Kind environment.

-> TypeEnv Name

Type environment.

-> Module (AnTEC a Name) Name

Lite module to convert.

-> Either (Error a) (Module a Name)

Salt module.

Convert a Core Tetra module to Core Salt.

The input module needs to be: well typed, fully named with no deBruijn indices, have all functions defined at top-level, have type annotations on every bound variable and constructor, be a-normalised, have saturated function applications, not have over-applied function applications. If not then Error.

The output code contains: debruijn indices. These then need to be eliminated before it will pass the Salt fragment checks.

data Error a Source

Things that can go wrong during the conversion.

Constructors

ErrorMainHasNoMain

The Main module has no main function.

ErrorMalformed String

Found unexpected AST node, like LWithRegion.

ErrorMistyped (Exp (AnTEC a Name) Name)

The program is definately not well typed.

ErrorUnsupported (Exp (AnTEC a Name) Name) Doc

The program wasn't normalised, or we don't support the feature.

ErrorBotAnnot

The program has bottom (missing) type annotations.

ErrorUnexpectedSum

Found an unexpected type sum.

ErrorInvalidBinder Name

An invalid name used in a binding position

ErrorInvalidBound (Bound Name)

An invalid name used in a bound position

ErrorInvalidDaCon (DaCon Name)

An invalid data constructor name.

ErrorInvalidAlt

An invalid name used for the constructor of an alternative.

Instances

Show a => Pretty (Error a)