Warning about certain instances (Was: Add conspicuously missing Functor instances for tuples)

Henning Thielemann lemming at henning-thielemann.de
Wed Feb 17 10:30:17 UTC 2016

On Mon, 18 Jan 2016, Eric Seidel wrote:

> We might be able to make this work as a type-checker plugin (which would 
> be quite nice at least for experimentation). I don't recall off the top 
> of my head if the constraint solver calls plugins before or after it 
> tries to discharge the constraints on its own, but if plugins get access 
> to constraints first we could write one that simply marks undesired 
> instances as insoluble.

Nice to see that you have concrete suggestions how to implement such a 
warning. Once I proposed an extension for forbidding certain instances:

I was forwarded to the "instance chain" proposal that would solve my 

This ticket also contains a solution that requires only existing 
extensions. However this solution does not allow to only warn about a 
problematic instance or to prevent the use of such an instance only 

A proper solution would allow to define a set of forbidden instances and 
import that in other packages, but does not affect packages later in the 
import chain. A way for explicit import of instances was discussed every 
now and then. This might also provide a way to get rid of specific 

However, every solution seems to be a long way to go. Eventually, it looks 
wrong to me to add security holes first and then start to fix them, or 
defer that for an indefinite time.

Btw. I see that the problem was already discussed on Reddit:

More information about the Libraries mailing list