Safe Haskell | None |
---|
Conversion of Disciple Lite to Disciple Salt.
- saltOfTetraModule :: Show a => Platform -> Config -> DataDefs Name -> KindEnv Name -> TypeEnv Name -> Module (AnTEC a Name) Name -> Either (Error a) (Module a Name)
- data Error a
- = ErrorMainHasNoMain
- | ErrorMalformed String
- | ErrorMistyped (Exp (AnTEC a Name) Name)
- | ErrorUnsupported (Exp (AnTEC a Name) Name) Doc
- | ErrorBotAnnot
- | ErrorUnexpectedSum
- | ErrorInvalidBinder Name
- | ErrorInvalidBound (Bound Name)
- | ErrorInvalidDaCon (DaCon Name)
- | ErrorInvalidAlt
Documentation
:: 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.
Things that can go wrong during the conversion.
ErrorMainHasNoMain | The |
ErrorMalformed String | Found unexpected AST node, like |
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. |