Conversation

This Tweet was deleted by the Tweet author. Learn more
Bottom line: I don't know what the best thing is yet. But Haskell is quite painful in many ways, so I choose to believe that there is some better option out there waiting to be found. :) I haven't heard any arguments against named instances, but would love to hear some.
2
4
By named instances do you mean non-coherent instances? Ed Kmett did a loong talk "Type Classes vs. The World" which outlined some of the problems. I don't necessarily agree - I'm interested in exploring the modular type classes approach, but it brings up important points.
1
1
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
This Tweet was deleted by the Tweet author. Learn more
The syntax looks familiar enough that I'm sure it would trip up Haskellers if they weren't careful. Thankfully this is more of a problem for library authors than more general users.
Replying to and
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
Show replies