diff options
author | Luite Stegeman <stegeman@gmail.com> | 2014-12-19 18:28:17 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-12-20 15:03:02 -0600 |
commit | e7eef005c1743d5fdc1162d717e98b304cd9fc5e (patch) | |
tree | 0d01817c0411c17434b16f51678330ea08b0fce1 /compiler/main/Hooks.hs | |
parent | 5326348076b9ba091b5af8f5dababdb2a9ea1977 (diff) | |
download | haskell-e7eef005c1743d5fdc1162d717e98b304cd9fc5e.tar.gz |
add runMeta hook
Summary:
The runMeta hook can be used to override how metaprogramming expressions
are evaluated. It makes the metaprogramming request types explicit and
has access to the TcM monad. This makes it a much more convenient starting
point for implementing out of process Template Haskell than the existing
hscCompileCoreExpr hook.
Reviewers: hvr, edsko, austin, simonpj
Reviewed By: austin
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D501
Diffstat (limited to 'compiler/main/Hooks.hs')
-rw-r--r-- | compiler/main/Hooks.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/main/Hooks.hs b/compiler/main/Hooks.hs index 3e797cad2e..fd25e330b4 100644 --- a/compiler/main/Hooks.hs +++ b/compiler/main/Hooks.hs @@ -18,6 +18,7 @@ module Hooks ( Hooks , hscCompileCoreExprHook , ghcPrimIfaceHook , runPhaseHook + , runMetaHook , linkHook , runQuasiQuoteHook , runRnSpliceHook @@ -59,6 +60,7 @@ import Data.Maybe emptyHooks :: Hooks emptyHooks = Hooks Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing + Nothing data Hooks = Hooks { dsForeignsHook :: Maybe ([LForeignDecl Id] -> DsM (ForeignStubs, OrdList (Id, CoreExpr))) @@ -69,6 +71,7 @@ data Hooks = Hooks , hscCompileCoreExprHook :: Maybe (HscEnv -> SrcSpan -> CoreExpr -> IO HValue) , ghcPrimIfaceHook :: Maybe ModIface , runPhaseHook :: Maybe (PhasePlus -> FilePath -> DynFlags -> CompPipeline (PhasePlus, FilePath)) + , runMetaHook :: Maybe (MetaHook TcM) , linkHook :: Maybe (GhcLink -> DynFlags -> Bool -> HomePackageTable -> IO SuccessFlag) , runQuasiQuoteHook :: Maybe (HsQuasiQuote Name -> RnM (HsQuasiQuote Name)) , runRnSpliceHook :: Maybe (LHsExpr Name -> RnM (LHsExpr Name)) |