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

Safe HaskellNone
LanguageHaskell98

DDC.Core.Tetra.Convert

Description

Conversion of Disciple Core Tetra to Disciple Core Salt.

Synopsis

Documentation

saltOfTetraModule Source #

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

Tetra 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, have all supers in prenex form, with type parameters before value parameters. 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

ErrorCurry Error 
ErrorMainHasNoMain

The Main module has no main function.

ErrorMalformed

Found unexpected AST node, like LWithRegion.

Fields

ErrorMistyped

The program is definately not well typed.

Fields

ErrorUnsupported

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

Fields

ErrorBotAnnot

The program has bottom (missing) type annotations.

ErrorUnexpectedSum

Found an unexpected type sum.

ErrorUnbound

Found an unbound variable.

Fields

ErrorInvalidBinder

An invalid name used in a binding position

Fields

ErrorInvalidBound

An invalid name used in a bound position

Fields

ErrorInvalidDaCon

An invalid data constructor name.

ErrorInvalidAlt

An invalid name used for the constructor of an alternative.

Fields

ErrorInvalidScrut

Something that we can't destruct in a case expression.

Fields

Instances

Show a => Pretty (Error a) Source # 

Associated Types

data PrettyMode (Error a) :: * #

Methods

pprDefaultMode :: PrettyMode (Error a) #

ppr :: Error a -> Doc #

pprPrec :: Int -> Error a -> Doc #

pprModePrec :: PrettyMode (Error a) -> Int -> Error a -> Doc #