Hooks

ghc-8.10.2: The GHC API

Safe Haskell | None
Language | Haskell2010

Hooks

Synopsis

- data Hooks
- emptyHooks :: Hooks
- lookupHook :: (Hooks -> Maybe a) -> a -> DynFlags -> a
- getHooked :: (Functor f, HasDynFlags f) => (Hooks -> Maybe a) -> a -> f a
- dsForeignsHook :: Hooks -> Maybe ([LForeignDecl GhcTc] -> DsM (ForeignStubs, OrdList (Id, CoreExpr)))
- tcForeignImportsHook :: Hooks -> Maybe ([LForeignDecl GhcRn] -> TcM ([Id], [LForeignDecl GhcTc], Bag GlobalRdrElt))
- tcForeignExportsHook :: Hooks -> Maybe ([LForeignDecl GhcRn] -> TcM (LHsBinds GhcTcId, [LForeignDecl GhcTcId], Bag GlobalRdrElt))
- hscFrontendHook :: Hooks -> Maybe (ModSummary -> Hsc FrontendResult)
- hscCompileCoreExprHook :: Hooks -> Maybe (HscEnv -> SrcSpan -> CoreExpr -> IO ForeignHValue)
- ghcPrimIfaceHook :: Hooks -> Maybe ModIface
- runPhaseHook :: Hooks -> Maybe (PhasePlus -> FilePath -> DynFlags -> CompPipeline (PhasePlus, FilePath))
- runMetaHook :: Hooks -> Maybe (MetaHook TcM)
- linkHook :: Hooks -> Maybe (GhcLink -> DynFlags -> Bool -> HomePackageTable -> IO SuccessFlag)
- runRnSpliceHook :: Hooks -> Maybe (HsSplice GhcRn -> RnM (HsSplice GhcRn))
- getValueSafelyHook :: Hooks -> Maybe (HscEnv -> Name -> Type -> IO (Maybe HValue))
- createIservProcessHook :: Hooks -> Maybe (CreateProcess -> IO ProcessHandle)

# Documentation

data Hooks Source #

emptyHooks :: Hooks Source #

Hooks can be used by GHC API clients to replace parts of the compiler pipeline. If a hook is not installed, GHC uses the default built-in behaviour

lookupHook :: (Hooks -> Maybe a) -> a -> DynFlags -> a Source #

getHooked :: (Functor f, HasDynFlags f) => (Hooks -> Maybe a) -> a -> f a Source #

dsForeignsHook :: Hooks -> Maybe ([LForeignDecl GhcTc] -> DsM (ForeignStubs, OrdList (Id, CoreExpr))) Source #

tcForeignImportsHook :: Hooks -> Maybe ([LForeignDecl GhcRn] -> TcM ([Id], [LForeignDecl GhcTc], Bag GlobalRdrElt)) Source #

tcForeignExportsHook :: Hooks -> Maybe ([LForeignDecl GhcRn] -> TcM (LHsBinds GhcTcId, [LForeignDecl GhcTcId], Bag GlobalRdrElt)) Source #

hscFrontendHook :: Hooks -> Maybe (ModSummary -> Hsc FrontendResult) Source #

hscCompileCoreExprHook :: Hooks -> Maybe (HscEnv -> SrcSpan -> CoreExpr -> IO ForeignHValue) Source #

ghcPrimIfaceHook :: Hooks -> Maybe ModIface Source #

runPhaseHook :: Hooks -> Maybe (PhasePlus -> FilePath -> DynFlags -> CompPipeline (PhasePlus, FilePath)) Source #

runMetaHook :: Hooks -> Maybe (MetaHook TcM) Source #

linkHook :: Hooks -> Maybe (GhcLink -> DynFlags -> Bool -> HomePackageTable -> IO SuccessFlag) Source #

runRnSpliceHook :: Hooks -> Maybe (HsSplice GhcRn -> RnM (HsSplice GhcRn)) Source #

getValueSafelyHook :: Hooks -> Maybe (HscEnv -> Name -> Type -> IO (Maybe HValue)) Source #

createIservProcessHook :: Hooks -> Maybe (CreateProcess -> IO ProcessHandle) Source #