summaryrefslogtreecommitdiff
path: root/compiler/main/Plugins.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthew.pickering@tweag.io>2018-06-07 13:31:52 -0400
committerBen Gamari <ben@smart-cactus.org>2018-06-07 18:06:30 -0400
commitdc8c03b2a5c70d3169e88d407f3ef28e0cb26af5 (patch)
treea3ae0e90a74335433c87d2248891900d38b2efb8 /compiler/main/Plugins.hs
parentfa34ced5204b13ba809a3441a89b9cf98de2d54e (diff)
downloadhaskell-dc8c03b2a5c70d3169e88d407f3ef28e0cb26af5.tar.gz
Run typeCheckResultAction and renamedResultAction in TcM rather than Hsc
The primary motivation for this is that this allows users to access the warnings and error machinery present in TcM. However, it also allows users to use TcM actions which means they can typecheck GhcPs which could be significantly easier than constructing GhcTc. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15229 Differential Revision: https://phabricator.haskell.org/D4792
Diffstat (limited to 'compiler/main/Plugins.hs')
-rw-r--r--compiler/main/Plugins.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/main/Plugins.hs b/compiler/main/Plugins.hs
index 34f3298b0d..0ad46bdb99 100644
--- a/compiler/main/Plugins.hs
+++ b/compiler/main/Plugins.hs
@@ -59,13 +59,13 @@ data Plugin = Plugin {
-- ^ Modify the module when it is parsed. This is called by
-- HscMain when the parsing is successful.
, renamedResultAction :: Maybe ([CommandLineOption] -> ModSummary
- -> RenamedSource -> Hsc ())
+ -> RenamedSource -> TcM ())
-- ^ Installs a read-only pass that receives the renamed syntax tree as an
-- argument when type checking is successful.
, typeCheckResultAction :: [CommandLineOption] -> ModSummary -> TcGblEnv
- -> Hsc TcGblEnv
- -- ^ Modify the module when it is type checked. This is called by
- -- HscMain when the type checking is successful.
+ -> TcM TcGblEnv
+ -- ^ Modify the module when it is type checked. This is called add the
+ -- very end of typechecking.
, spliceRunAction :: [CommandLineOption] -> LHsExpr GhcTc
-> TcM (LHsExpr GhcTc)
-- ^ Modify the TH splice or quasiqoute before it is run.