Safe Haskell | None |
---|---|
Language | Haskell98 |
- compilerMain :: Bool -> Interface -> TCM ()
- compile :: Interface -> TCM ()
- imports :: TCM [ImportDecl]
- definitions :: Definitions -> TCM [Decl]
- definition :: Maybe CoinductionKit -> Definition -> TCM [Decl]
- data CCEnv = CCEnv {}
- type NameSupply = [Name]
- type CCContext = [Name]
- mapNameSupply :: (NameSupply -> NameSupply) -> CCEnv -> CCEnv
- mapContext :: (CCContext -> CCContext) -> CCEnv -> CCEnv
- initCCEnv :: Maybe QName -> CCEnv
- lookupIndex :: Int -> CCContext -> Name
- lookupLevel :: Int -> CCContext -> Name
- type CC = ReaderT CCEnv TCM
- casetree :: CompiledClauses -> CC Exp
- updateCatchAll :: Maybe CompiledClauses -> CC a -> CC a
- conAlts :: Int -> Map QName (WithArity CompiledClauses) -> CC [Alt]
- litAlts :: Map Literal CompiledClauses -> CC [Alt]
- catchAllAlts :: Maybe CompiledClauses -> CC [Alt]
- branch :: Pat -> CompiledClauses -> CC Alt
- replaceVar :: Int -> Int -> ([Name] -> CC a) -> CC a
- mkRecord :: Map QName Exp -> CC Exp
- recConFromProj :: QName -> TCM ConHead
- lambdasUpTo :: Int -> CC Exp -> CC Exp
- lambdas :: Int -> CC Exp -> CC Exp
- intros :: Int -> ([Name] -> CC Exp) -> CC Exp
- mkLams :: [Name] -> Exp -> Exp
- checkConstructorType :: QName -> TCM [Decl]
- checkCover :: QName -> HaskellType -> Nat -> [QName] -> TCM [Decl]
- conArityAndPars :: QName -> TCM (Nat, Nat)
- clause :: QName -> Maybe String -> (Nat, Bool, Clause) -> TCM Decl
- argpatts :: [NamedArg Pattern] -> [Pat] -> TCM [Pat]
- clausebody :: ClauseBody -> TCM Exp
- closedTerm :: Term -> TCM Exp
- term :: Term -> CC Exp
- term' :: Arg Term -> CC Exp
- literal :: Literal -> TCM Exp
- hslit :: Literal -> Literal
- litqname :: QName -> Exp
- litqnamepat :: QName -> Pat
- condecl :: QName -> TCM (Nat, ConDecl)
- cdecl :: QName -> Nat -> ConDecl
- tvaldecl :: QName -> Induction -> Nat -> Nat -> [ConDecl] -> Maybe Clause -> [Decl]
- infodecl :: QName -> Decl
- hsCast :: Exp -> Exp
- hsCast' :: Exp -> Exp
- hsCoerce :: Exp -> Exp
- writeModule :: Module -> TCM ()
- rteModule :: Module
- compileDir :: TCM FilePath
- outFile' :: (Pretty a, TransformBi ModuleName (Wrap a)) => a -> TCM (FilePath, FilePath)
- outFile :: ModuleName -> TCM FilePath
- outFile_ :: TCM FilePath
- callGHC :: Bool -> Interface -> TCM ()
Documentation
compilerMain :: Bool -> Interface -> TCM () Source
definitions :: Definitions -> TCM [Decl] Source
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
Environment for naming of local variables.
Invariant: reverse ccCxt ++ ccNameSupply
CCEnv | |
|
type NameSupply = [Name] Source
mapNameSupply :: (NameSupply -> NameSupply) -> CCEnv -> CCEnv Source
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.
catchAllAlts :: Maybe CompiledClauses -> CC [Alt] Source
branch :: Pat -> CompiledClauses -> CC Alt Source
replaceVar :: Int -> Int -> ([Name] -> CC a) -> CC a Source
Replace de Bruijn Level x
by n
new variables.
recConFromProj :: QName -> TCM ConHead Source
lambdasUpTo :: Int -> CC Exp -> CC Exp Source
Introduce lambdas such that n
variables are in scope.
checkConstructorType :: QName -> TCM [Decl] Source
checkCover :: QName -> HaskellType -> Nat -> [QName] -> TCM [Decl] Source
clausebody :: ClauseBody -> TCM Exp Source
closedTerm :: Term -> TCM 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
.
litqnamepat :: QName -> Pat Source
writeModule :: Module -> TCM () Source