Safe Haskell | None |
---|---|
Language | Haskell2010 |
Config, input and output types for the simplified GHC API.
- data CompConfig
- defaultConfig :: CompConfig
- cfgGhcFlags :: CompConfig -> [String]
- cfgUseTargetsFromFlags :: CompConfig -> Bool
- cfgUpdateDynFlags :: CompConfig -> DynFlags -> DynFlags
- cfgGhcLibDir :: CompConfig -> Maybe FilePath
- cfgUseGhcErrorLogger :: CompConfig -> Bool
- cfgCustomPrimIface :: CompConfig -> Maybe (PrimOp -> PrimOpInfo, PrimOp -> Arity -> StrictSig)
- data CompiledModule a = CompiledModule {}
- data CompResult a
- = Success {
- compResult :: [CompiledModule a]
- compWarnings :: [Warning]
- compDynFlags :: DynFlags
- | Failure {
- compErrors :: [Error]
- compWarnings :: [Warning]
- = Success {
- data Error = Error {}
- data Warning = Warning {
- warnSpan :: SrcSpan
- warnMessage :: String
- compSuccess :: CompResult a -> Bool
Documentation
data CompConfig Source
defaultConfig :: CompConfig Source
Default configuration.
cfgGhcFlags :: CompConfig -> [String] Source
GHC command line flags to control the Haskell to STG compilation
pipeline. Both static and dynamic flags may be set here.
For instance, passing ["-O2", "-DHELLO"]
here is equivalent to
passing -O2 -DHELLO
to the ghc
binary.
Note that flags set here are overridden by any changes to DynFlags
performed by cfgUpdateDynFlags
, and that '--make' mode is always
in effect.
Default: []
cfgUseTargetsFromFlags :: CompConfig -> Bool Source
If file or module names are found among the cfgGhcFlags
,
should they be used as targets, in addition to any targets given by
other arguments to withStg
et al?
Default: True
cfgUpdateDynFlags :: CompConfig -> DynFlags -> DynFlags Source
Modify the dynamic flags governing the compilation process.
Changes made here take precedence over any flags passed through
cfgGhcFlags
.
Default: id
cfgGhcLibDir :: CompConfig -> Maybe FilePath Source
Path to GHC's library directory. If Nothing
, the library directory
of the system's default GHC compiler will be used.
Default: Nothing
cfgUseGhcErrorLogger :: CompConfig -> Bool Source
Use GHC's standard logger to log errors and warnings to the command line? Errors and warnings are always collected and returned, regardless of the value of this setting.
Output other than errors and warnings (dumps, etc.) are logged using
the standard logger by default. For finer control over logging
behavior, you should override log_action
in cfgUpdateDynFlags
.
Default: False
cfgCustomPrimIface :: CompConfig -> Maybe (PrimOp -> PrimOpInfo, PrimOp -> Arity -> StrictSig) Source
Use a custom interface for GHC.Prim
.
This is useful if you want to, for instance, compile to a 32 bit
target architecture on a 64 bit host.
For more information, see Language.Haskell.GHC.Simple.PrimIface.
Default: Nothing
data CompiledModule a Source
Compiler output and metadata for a given module.
CompiledModule | |
|
data CompResult a Source
Result of a compilation.
Success | |
| |
Failure | |
|
A GHC error message.
Error | |
|
A GHC warning.
Warning | |
|
compSuccess :: CompResult a -> Bool Source
Does the given CompResult
represent a successful compilation?