Conversation

You definitely want to avoid Scala's situation where you never are sure what instance you have in scope at any time - and the instance resolution algorithm is mysterious and confusing.
1
1
Coherent instances also tend to end up with people relying on it when designing their APIs, so you need to figure out how to train people out relying on that and provide alternatives.
1
For example you'll need some way of statically ensuring that hash maps use a consistent hashing implementation over their life, lest all craziness ensue. There are solutions to this, but it does end up looking less 'pretty' than what Haskellers are typically used to.
1
1
Type classes can be used in the way they do because they violate modularity, assuming global coherence across packages. But once you remove, and perhaps even encourage people to break global coherence, you need to have a way to get back what you traded away.
2
1
Scala uses implicits, not named instances. I don't think Ed's talk about type class coherence said anything about named instances, if I recall correctly. His point is that no matter which "path" you choose when solving constraints, you should end up at the same point.
2
Ack, in looking over the modular implicits paper again I think I might be conflating the terms 'canonicity' and 'coherence'. Note that while this topic interests me quite a bit, I'm by no means an expert, nor have I tried implementing it! 😬
2
1