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

Safe HaskellNone
LanguageHaskell98

Agda.Compiler.MAlonzo.Compiler

Synopsis

Documentation

definition :: Maybe CoinductionKit -> Definition -> TCM [Decl] Source

Note that the INFINITY, SHARP and FLAT builtins are translated as follows (if a CoinductionKit is given):

  type Infinity a b = b

  sharp :: a -> a
  sharp x = x

  flat :: a -> a
  flat x = x

data CCEnv Source

Environment for naming of local variables. Invariant: reverse ccCxt ++ ccNameSupply

Constructors

CCEnv 

Fields

ccFunName :: Maybe QName

Agda function we are currently compiling.

ccNameSupply :: NameSupply

Supply of fresh names

ccCxt :: CCContext

Names currently in scope

ccCatchAll :: Maybe CompiledClauses

Naive catch-all implementation. If an inner case has no catch-all clause, we use the one from its parent.

initCCEnv :: Maybe QName -> CCEnv Source

Initial environment for expression generation.

lookupIndex :: Int -> CCContext -> Name Source

Term variables are de Bruijn indices.

lookupLevel :: Int -> CCContext -> Name Source

Case variables are de Bruijn levels.

casetree :: CompiledClauses -> CC Exp Source

Compile a case tree into nested case and record expressions.

updateCatchAll :: Maybe CompiledClauses -> CC a -> CC a Source

Replace the current catch-all clause with a new one, if given.

replaceVar :: Int -> Int -> ([Name] -> CC a) -> CC a Source

Replace de Bruijn Level x by n new variables.

mkRecord :: Map QName Exp -> CC Exp Source

Precondition: Map not empty.

lambdasUpTo :: Int -> CC Exp -> CC Exp Source

Introduce lambdas such that n variables are in scope.

lambdas :: Int -> CC Exp -> CC Exp Source

Introduce n lambdas.

intros :: Int -> ([Name] -> CC Exp) -> CC Exp Source

Introduce n variables into the context.

mkLams :: [Name] -> Exp -> Exp Source

Prefix a Haskell expression with lambda abstractions.

conArityAndPars :: QName -> TCM (Nat, Nat) Source

Move somewhere else!

term :: Term -> CC Exp Source

Extract Agda term to Haskell expression. Irrelevant arguments are extracted as (). Types are extracted as (). DontCare outside of irrelevant arguments is extracted as error.

term' :: Arg Term -> CC Exp Source

Irrelevant arguments are replaced by Haskells' ().

tvaldecl Source

Arguments

:: QName 
-> Induction

Is the type inductive or coinductive?

-> Nat 
-> Nat 
-> [ConDecl] 
-> Maybe Clause 
-> [Decl]