| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Agda.Compiler.MAlonzo.Compiler
Synopsis
- ghcBackend :: Backend
 - ghcBackend' :: Backend' GHCOptions GHCOptions GHCModuleEnv IsMain [Decl]
 - data GHCOptions = GHCOptions {
- optGhcCompile :: Bool
 - optGhcCallGhc :: Bool
 - optGhcFlags :: [String]
 
 - defaultGHCOptions :: GHCOptions
 - ghcCommandLineFlags :: [OptDescr (Flag GHCOptions)]
 - ghcPreCompile :: GHCOptions -> TCM GHCOptions
 - ghcPostCompile :: GHCOptions -> IsMain -> Map ModuleName IsMain -> TCM ()
 - type GHCModuleEnv = ()
 - ghcPreModule :: GHCOptions -> IsMain -> ModuleName -> FilePath -> TCM (Recompile GHCModuleEnv IsMain)
 - ghcPostModule :: GHCOptions -> GHCModuleEnv -> IsMain -> ModuleName -> [[Decl]] -> TCM IsMain
 - ghcCompileDef :: GHCOptions -> GHCModuleEnv -> IsMain -> Definition -> TCM [Decl]
 - ghcMayEraseType :: QName -> TCM Bool
 - imports :: TCM [ImportDecl]
 - definition :: GHCModuleEnv -> IsMain -> Definition -> TCM [Decl]
 - constructorCoverageCode :: QName -> Int -> [QName] -> HaskellType -> [HaskellCode] -> TCM [Decl]
 - data CCEnv = CCEnv {}
 - type NameSupply = [Name]
 - type CCContext = [Name]
 - ccNameSupply :: Lens' NameSupply CCEnv
 - ccContext :: Lens' CCContext CCEnv
 - initCCEnv :: CCEnv
 - lookupIndex :: Int -> CCContext -> Name
 - type CC = ReaderT CCEnv TCM
 - freshNames :: Int -> ([Name] -> CC a) -> CC a
 - intros :: Int -> ([Name] -> CC a) -> CC a
 - checkConstructorType :: QName -> HaskellCode -> TCM [Decl]
 - checkCover :: QName -> HaskellType -> Nat -> [QName] -> [HaskellCode] -> TCM [Decl]
 - closedTerm :: TTerm -> TCM Exp
 - mkIf :: TTerm -> CC TTerm
 - term :: TTerm -> CC Exp
 - noApplication :: TTerm -> CC Exp
 - hsCoerce :: Exp -> Exp
 - compilePrim :: TPrim -> Exp
 - alt :: Int -> TAlt -> CC Alt
 - literal :: Literal -> Exp
 - hslit :: Literal -> Literal
 - litString :: String -> Exp
 - litqname :: QName -> Exp
 - litqnamepat :: QName -> Pat
 - condecl :: QName -> Induction -> TCM ConDecl
 - compiledcondecl :: QName -> TCM Decl
 - compiledTypeSynonym :: QName -> String -> Nat -> Decl
 - tvaldecl :: QName -> Induction -> Nat -> [ConDecl] -> Maybe Clause -> [Decl]
 - infodecl :: QName -> [Decl] -> [Decl]
 - copyRTEModules :: TCM ()
 - writeModule :: Module -> TCM ()
 - outFile' :: Pretty a => a -> TCM (FilePath, FilePath)
 - outFile :: ModuleName -> TCM FilePath
 - outFile_ :: TCM FilePath
 - callGHC :: GHCOptions -> IsMain -> Map ModuleName IsMain -> TCM ()
 
Documentation
ghcBackend :: Backend Source #
data GHCOptions Source #
Constructors
| GHCOptions | |
Fields 
  | |
ghcCommandLineFlags :: [OptDescr (Flag GHCOptions)] Source #
ghcPreCompile :: GHCOptions -> TCM GHCOptions Source #
ghcPostCompile :: GHCOptions -> IsMain -> Map ModuleName IsMain -> TCM () Source #
type GHCModuleEnv = () Source #
This environment is no longer used for anything.
Arguments
| :: GHCOptions | |
| -> IsMain | Are we looking at the main module?  | 
| -> ModuleName | |
| -> FilePath | Path to the   | 
| -> TCM (Recompile GHCModuleEnv IsMain) | Could we confirm the existence of a main function?  | 
Arguments
| :: GHCOptions | |
| -> GHCModuleEnv | |
| -> IsMain | Are we looking at the main module?  | 
| -> ModuleName | |
| -> [[Decl]] | Compiled module content.  | 
| -> TCM IsMain | Could we confirm the existence of a main function?  | 
ghcCompileDef :: GHCOptions -> GHCModuleEnv -> IsMain -> Definition -> TCM [Decl] Source #
ghcMayEraseType :: QName -> TCM Bool Source #
We do not erase types that have a HsData pragma.
   This is to ensure a stable interface to third-party code.
imports :: TCM [ImportDecl] Source #
definition :: GHCModuleEnv -> IsMain -> Definition -> TCM [Decl] Source #
constructorCoverageCode :: QName -> Int -> [QName] -> HaskellType -> [HaskellCode] -> TCM [Decl] Source #
Environment for naming of local variables.
   Invariant: reverse ccCxt ++ ccNameSupply
Constructors
| CCEnv | |
Fields 
  | |
type NameSupply = [Name] Source #
checkConstructorType :: QName -> HaskellCode -> TCM [Decl] Source #
checkCover :: QName -> HaskellType -> Nat -> [QName] -> [HaskellCode] -> TCM [Decl] Source #
term :: TTerm -> CC Exp Source #
Extract Agda term to Haskell expression.
   Erased arguments are extracted as ().
   Types are extracted as ().
noApplication :: TTerm -> CC Exp Source #
Translate a non-application, non-coercion, non-constructor, non-definition term.
compilePrim :: TPrim -> Exp Source #
litqnamepat :: QName -> Pat Source #
copyRTEModules :: TCM () Source #
writeModule :: Module -> TCM () Source #
callGHC :: GHCOptions -> IsMain -> Map ModuleName IsMain -> TCM () Source #