Typechecker plugins: request for review and another workflow question

Eric Seidel eric at seidel.io
Fri Nov 14 18:09:05 UTC 2014

> On Nov 14, 2014, at 09:14, Adam Gundry <adam at well-typed.com> wrote:
> Thanks, Simon! I've been convinced that TcS is more than we need, and I
> think the right thing to do is to (optionally) invoke the plugin after
> the constraints have been unflattened anyway. I've just pushed a commit
> to wip/tc-plugins-amg that does this. Iavor, Eric, your views on how
> convenient this alternative is would be most welcome. I'm also wondering
> if the plugin should be told how many times it has been called, to make
> it easier to prevent infinite loops.

Thanks, I was just sitting down to figure out how to call the plugins
with the unflattened constraints. Is there really a point though in
calling the plugins with flattened and unflattened versions of the same
constraints? Perhaps we should just settle on one or the other? I think
Iavor and I are fine with only passing unflattened constraints to the
plugins. It means a bit more work for the type-nat plugin, but shouldn't
be a huge issue (I'll confirm this before next week).

I don't think the plugins should be told how often they're being called,
I'd prefer for GHC to track that and break the loop, if anything. I'm
generally unconvinced that tracking the invocations is necessary at all
though. The only way I can see an infinite loop occurring is if the plugins
keep emitting *new* facts. Disregarding the possibility of a malicious
plugin, that should mean that we're making progress towards a solution,


More information about the ghc-devs mailing list