Safe Haskell | None |
---|---|
Language | Haskell2010 |
Lower level building blocks for custom code generation.
- class Compile a where
- toCode :: DynFlags -> ModSummary -> Ghc a
- data Ghc a :: * -> *
- type StgModule = CompiledModule [StgBinding]
- type PkgKey = PackageId
- liftIO :: MonadIO m => forall a. IO a -> m a
- toSimplifiedStg :: GhcMonad m => DynFlags -> ModSummary -> m [StgBinding]
- toSimplifiedCore :: GhcMonad m => ModSummary -> m CgGuts
- toModGuts :: GhcMonad m => ModSummary -> m ModGuts
- simplify :: GhcMonad m => ModGuts -> m CgGuts
- prepare :: GhcMonad m => DynFlags -> ModSummary -> CgGuts -> m CoreProgram
- toStgBindings :: GhcMonad m => DynFlags -> ModSummary -> CoreProgram -> m [StgBinding]
- toCompiledModule :: GhcMonad m => (DynFlags -> ModSummary -> m a) -> DynFlags -> ModSummary -> m (CompiledModule a)
- modulePkgKey :: Module -> PkgKey
- pkgKeyString :: PkgKey -> String
Documentation
Any type we can generate intermediate code for.
toCode :: DynFlags -> ModSummary -> Ghc a Source
Generate some sort of code (or other output) from a Haskell module.
data Ghc a :: * -> *
type StgModule = CompiledModule [StgBinding] Source
type PkgKey = PackageId Source
Synonym for PackageId
, to bridge a slight incompatibility between
GHC 7.8 and 7.10.
toSimplifiedStg :: GhcMonad m => DynFlags -> ModSummary -> m [StgBinding] Source
Compile a ModSummary
into a list of simplified StgBinding
s.
See https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/StgSynType
for more information about STG and how it relates to core and Haskell.
toSimplifiedCore :: GhcMonad m => ModSummary -> m CgGuts Source
Compile a ModSummary
into a CgGuts
, containing all information about
a core module that one could wish for.
toModGuts :: GhcMonad m => ModSummary -> m ModGuts Source
Parse, typecheck and desugar a module. Returned ModGuts
structure is not
simplified in any way.
prepare :: GhcMonad m => DynFlags -> ModSummary -> CgGuts -> m CoreProgram Source
Prepare a core module for code generation.
toStgBindings :: GhcMonad m => DynFlags -> ModSummary -> CoreProgram -> m [StgBinding] Source
Turn a core module into a list of simplified STG bindings.
toCompiledModule :: GhcMonad m => (DynFlags -> ModSummary -> m a) -> DynFlags -> ModSummary -> m (CompiledModule a) Source
Compile a ModSummary
into a module with metadata using a custom
compilation function.
modulePkgKey :: Module -> PkgKey Source
Package ID/key of a module.
pkgKeyString :: PkgKey -> String Source
String representation of a package ID/key.