Agda-2.5.1: A dependently typed functional programming language and proof assistant

Safe HaskellNone
LanguageHaskell98

Agda.Compiler.UHC.FromAgda

Description

Convert from Agda's internal representation to UHC Core via Treeless.

The coinduction kit is translated the same way as in MAlonzo: flat = id sharp = id -> There is no runtime representation of Coinductive values.

Synopsis

Documentation

fromAgdaModule :: ModuleName -> [ModuleName] -> Interface -> TCM CModule Source

Convert from Agda's internal representation to our auxiliary AST.

translateDefn :: (QName, Definition) -> Compile [CBind] Source

Translate an Agda definition to an UHC Core function where applicable

data TTEnv Source

Constructors

TTEnv 

Fields

nmEnv :: [HsName]
 

addToEnv :: [HsName] -> TT a -> TT a Source

data BuiltinKit Source

Constructors

BuiltinKit 

Fields

isNat :: QName -> Bool
 
isInt :: QName -> Bool
 

compileTerm :: TTerm -> TT CExpr Source

Translate the actual Agda terms, with an environment of all the bound variables from patternmatching. Agda terms are in de Bruijn so we just check the new names in the position.

buildPrimCases Source

Arguments

:: CExpr

equality function

-> CExpr

case scrutinee (in WHNF)

-> [TAlt] 
-> CExpr

default value

-> TT CExpr 

defaultBranches :: QName -> [TAlt] -> CExpr -> TT [CAlt] Source

Constructs an alternative for all constructors not explicitly matched by a branch.