
#14709: Extend the plugin mechanism to access program representation -------------------------------------+------------------------------------- Reporter: lazac | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: GHC API | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | https://phabricator.haskell.org/D4342 https://ghc.haskell.org/trac/ghc/wiki/ExtendedPluginsProposal| -------------------------------------+------------------------------------- Comment (by mpickering): These examples are useful for discussing the problems with recompilation but I don't think they should stop the progress of this patch. If we all agree that this is a good direction, which I think we should, we should consider each of the proposed plugins and decide whether each of them is desirable in turn. To summarise, here are the five proposed extensions. {{{ parsedResultAction :: [CommandLineOption] -> ModSummary -> HsParsedModule needsRenamedSyntax :: [CommandLineOption] -> ModSummary -> Hsc Bool typeCheckResultAction :: [CommandLineOption] -> ModSummary -> TcGblEnv spliceRunAction :: [CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc) interfaceLoadAction :: forall lcl . [CommandLineOption] -> ModIface -> IfM lcl ModIface }}} I think that `parsedResultAction`, `typecheckResultAction` and `splitRunAction` are well motivated hooks which we should definitely include. I am indifferent towards `interfaceLoadAction`, I don't see a more direct place to implement this but feel the hook should instead run after the interface is type checked. I won't accept a patch which includes the `needsRenamedSyntax` hook which is ad-hoc. Can other interested parties please comment on these specific so we can move this patch forward in a reasonable time frame? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14709#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler