Safe Haskell | None |
---|---|
Language | Haskell2010 |
Simplified interface to the GHC API.
- compile :: (Intermediate a, Binary b) => (ModMetadata -> a -> IO b) -> [String] -> IO (CompResult [CompiledModule b])
- compileWith :: (Intermediate a, Binary b) => CompConfig -> (ModMetadata -> a -> IO b) -> [String] -> IO (CompResult [CompiledModule b])
- compileFold :: (Intermediate a, Binary b) => CompConfig -> (ModMetadata -> a -> IO b) -> (acc -> CompiledModule b -> IO acc) -> acc -> [String] -> IO (CompResult acc)
- getDynFlagsForConfig :: CompConfig -> 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
- module DriverPhases
- data ModSummary :: * = ModSummary {
- ms_mod :: Module
- ms_hsc_src :: HscSource
- ms_location :: ModLocation
- ms_hs_date :: UTCTime
- ms_obj_date :: Maybe UTCTime
- ms_iface_date :: Maybe UTCTime
- ms_srcimps :: [(Maybe FastString, Located ModuleName)]
- ms_textual_imps :: [(Maybe FastString, Located ModuleName)]
- ms_hspp_file :: FilePath
- ms_hspp_opts :: DynFlags
- ms_hspp_buf :: Maybe StringBuffer
- data ModGuts :: * = ModGuts {
- mg_module :: ~Module
- mg_hsc_src :: HscSource
- mg_loc :: SrcSpan
- mg_exports :: ~[AvailInfo]
- mg_deps :: ~Dependencies
- mg_usages :: ~[Usage]
- 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 :: ~(Maybe 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
- type PkgKey = UnitId
- pkgKeyString :: PkgKey -> String
- modulePkgKey :: Module -> PkgKey
Entry points
:: (Intermediate a, Binary b) | |
=> (ModMetadata -> a -> IO b) | Compilation function from some intermediate language to the
desired output. The output type needs to be an instance of
|
-> [String] | List of compilation targets. A target can be either a module or a file name. |
-> IO (CompResult [CompiledModule b]) |
Compile a list of targets and their dependencies into intermediate code.
Uses settings from the the default CompConfig
.
:: (Intermediate a, Binary b) | |
=> CompConfig | GHC pipeline configuration. |
-> (ModMetadata -> a -> IO b) | Compilation function. |
-> [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 b]) |
Compile a list of targets and their dependencies using a custom configuration.
:: (Intermediate a, Binary b) | |
=> CompConfig | GHC pipeline configuration. |
-> (ModMetadata -> a -> IO b) | Per module compilation function. |
-> (acc -> CompiledModule b -> IO acc) | Folding function. |
-> acc | 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 acc) |
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
getDynFlagsForConfig :: CompConfig -> 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
module DriverPhases
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
ModSummary | |
|
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 | |
|
Synonym for UnitId
, to bridge a slight incompatibility between
GHC 7.87.108.0.
pkgKeyString :: PkgKey -> String Source #
String representation of a package ID/key.
modulePkgKey :: Module -> PkgKey Source #
Package ID/key of a module.