Safe Haskell | None |
---|---|
Language | Haskell2010 |
Simplified interface to the GHC API.
- compile :: Compile a => [String] -> IO (CompResult [CompiledModule a])
- compileWith :: Compile a => CompConfig a -> [String] -> IO (CompResult [CompiledModule a])
- compileFold :: CompConfig b -> (a -> CompiledModule b -> IO a) -> a -> [String] -> IO (CompResult a)
- type StgModule = CompiledModule [StgBinding]
- getDynFlagsForConfig :: CompConfig a -> IO (DynFlags, [String])
- module CoreSyn
- module StgSyn
- module Module
- module Id
- module IdInfo
- module Var
- module Literal
- module DataCon
- module OccName
- module Name
- module Type
- module TysPrim
- module TyCon
- module ForeignCall
- module PrimOp
- module DynFlags
- module SrcLoc
- data ModSummary :: * = ModSummary {}
- data ModGuts :: * = ModGuts {
- mg_module :: !Module
- mg_boot :: IsBootInterface
- mg_exports :: ![AvailInfo]
- mg_deps :: !Dependencies
- mg_dir_imps :: !ImportedMods
- mg_used_names :: !NameSet
- mg_used_th :: !Bool
- mg_rdr_env :: !GlobalRdrEnv
- mg_fix_env :: !FixityEnv
- mg_tcs :: ![TyCon]
- mg_insts :: ![ClsInst]
- mg_fam_insts :: ![FamInst]
- mg_patsyns :: ![PatSyn]
- mg_rules :: ![CoreRule]
- mg_binds :: !CoreProgram
- mg_foreign :: !ForeignStubs
- mg_warns :: !Warnings
- mg_anns :: [Annotation]
- mg_hpc_info :: !HpcInfo
- mg_modBreaks :: !ModBreaks
- mg_vect_decls :: ![CoreVect]
- mg_vect_info :: !VectInfo
- mg_inst_env :: InstEnv
- mg_fam_inst_env :: FamInstEnv
- mg_safe_haskell :: SafeHaskellMode
- mg_trust_pkg :: Bool
- mg_dependent_files :: [FilePath]
- type PkgKey = PackageId
- pkgKeyString :: PkgKey -> String
- modulePkgKey :: Module -> PkgKey
Entry points
:: Compile a | |
=> [String] | List of compilation targets. A target can be either a module or a file name. |
-> IO (CompResult [CompiledModule a]) |
Compile a list of targets and their dependencies into intermediate code.
Uses settings from the the default CompConfig
.
:: Compile a | |
=> CompConfig a | GHC pipeline configuration. |
-> [String] | List of compilation targets. A target can be either a module
or a file name. Targets may also be read from the specified
|
-> IO (CompResult [CompiledModule a]) |
Compile a list of targets and their dependencies using a custom configuration.
:: CompConfig b | GHC pipeline configuration. |
-> (a -> CompiledModule b -> IO a) | Compilation function. |
-> a | Initial accumulator. |
-> [String] | List of compilation targets. A target can be either a module
or a file name. Targets may also be read from the specified
|
-> IO (CompResult a) |
Left fold over a list of compilation targets and their dependencies.
Sometimes you don't just want a huge pile of intermediate code lying around; chances are you either want to dump it to file or combine it with some other intermediate code, without having to keep it all in memory at the same time.
Configuration, input and output types
type StgModule = CompiledModule [StgBinding] Source
getDynFlagsForConfig :: CompConfig a -> IO (DynFlags, [String]) Source
Obtain the dynamic flags and extra targets that would be used to compile anything with the given config.
GHC re-exports for processing STG and Core
module CoreSyn
module StgSyn
module Module
module Id
module IdInfo
module Var
module Literal
module DataCon
module OccName
module Name
module Type
module TysPrim
module TyCon
module ForeignCall
module PrimOp
module DynFlags
module SrcLoc
data ModSummary :: *
A single node in a 'ModuleGraph. The nodes of the module graph are one of:
- A regular Haskell source module
- A hi-boot source module
- An external-core source module
ModSummary | |
|
data ModGuts :: *
A ModGuts is carried through the compiler, accumulating stuff as it goes
There is only one ModGuts at any time, the one for the module
being compiled right now. Once it is compiled, a ModIface
and
ModDetails
are extracted and the ModGuts is discarded.
ModGuts | |
|
type PkgKey = PackageId Source
Synonym for PackageId
, to bridge a slight incompatibility between
GHC 7.8 and 7.10.
pkgKeyString :: PkgKey -> String Source
String representation of a package ID/key.
modulePkgKey :: Module -> PkgKey Source
Package ID/key of a module.