
29 Apr
2018
29 Apr
'18
7:37 p.m.
On 4/29/18, Edward Kmett
This isn't sound.
You lose the global uniqueness of instance resolution, which is a key part of how libraries like Data.Set and Data.Map move the constraints from being carried around in the Set to the actual use sites. With "local" instances it is very easy to construct such a map in one local context and use it in another with a different instance.
Ah, i forgot to say explicitly: local instances of types declared at greater scope are not allowed. Is it unsound nonetheless?