
#11457: Run type-checker plugins before GHC's solver -------------------------------------+------------------------------------- Reporter: gridaphobe | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 8.0.1-rc1 checker) | Resolution: | Keywords: plugin Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by adamgundry): Indeed, rejecting potentially-solvable constraints would be a bit tricky to do accurately, because of the intertwining of different kinds of constraint solving. It should be easy to run the plugins first and permit them to reject dictionary constraints that have arisen directly from the source, but it's not clear that is very useful because many constraints arise during solving. (Moreover, this would not work for equality constraints, because those are handled eagerly by the unifier.) I suppose one could imagine an alternative architecture for plugins that gave them each new constraint as GHC generated it, which would be capable of doing this, but would be much more deeply tied into GHC's constraint- solving algorithm. Another possibility we've considered in the past is making it possible for a plugin to replace GHC's entire constraint solver pipeline. That could be interesting from the point of view of experimenting with alternative constraint-solving algorithms, but I'm not sure how feasible it is. For this specific feature request, I suspect it would be easier to do it inside GHC itself, by checking for suppression pragmas during instance lookup. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11457#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler