So impredicative types might be worth the cost of the simplified subsumption.
Yes, I agree that seems plausible… and that is precisely the thrust of my aforementioned /r/haskell comment. Since it is now topical, I suppose I may as well reproduce it here in full:
I will add my voice to the pile of people saying that I am unhappy about this change. I was skeptical of it when I first saw the proposal, but I did not say anything then, so I cannot complain too loudly… and, frankly, my unhappiness is quite minimal. I think I was right in my assessment at the time that it was not worth wading into the discussion over.
This is not the first time something like this has happened. All the way back in 2010, GHC argued that Let Should Not Be Generalized, which made a similar case that trying to be too clever during type inference was not worth the costs. Instead, the authors argue, it is better to allow the programmer to be explicit. Having said this, there is a big difference between Let Should Not Be Generalized and Simplify Subsumption, namely that the former did not eliminate let generalization in general: it is still performed if neither
GADTs
norTypeFamilies
is enabled. So the choice to eliminate let generalization was much more explicitly focused on a poor interaction between two type system features, rather than being primarily a way to simplify the compiler’s implementation.As it happens, I am personally skeptical that the elimination of let generalization was the right choice, but I also acknowledge that the interactions addressed in the paper are genuinely challenging to resolve. I am definitely grateful for GADTs and type families, and all things considered, I am willing to give up let generalization to use them. The point I am trying to make is that my choice is at least clear: I get to pick one or the other. Over time, this choice has effectively served as an informal survey: since programmers overwhelmingly agree to this tradeoff, it abundantly obvious that programmers believe those type system features pay their weight.
Can we say the same about the elimination of higher-rank subsumption? No, we cannot, as there is no choice, and we cannot even really understand yet what we, as users of GHC, have gotten in return. I suspect that if a similar strategy had been taken for this change—that is, if a release introduced an extension
SimplifiedSubsumption
that was implicitly enabled byImpredicativeTypes
—then programmers would be a lot more willing to consider it. However, that would obviously not provide the same benefit from the perspective of compiler implementors, who now have to maintain both possible scenarios.With all that in mind, did the committee get this one wrong? Honestly, I don’t think I’m confident enough to take a firm stance one way or the other. Type system design is hard, and maintaining GHC requires an enormous amount of work—the cost of features like these are not free, and we as users of the compiler should have some sympathy for that… not just because we acknowledge the GHC maintainers are human, too, but also because we indirectly benefit from allowing them to focus on other things. That is not to say that this change was unequivocally justified—personally I lean towards saying it was not—but more that I think you can make arguments for both sides, it isn’t a binary choice of whether it was right or wrong, and it is inevitable that sometimes the committee will make mistakes. Perfection is a good goal to aim for, but sometimes we miss. I think this sort of discussion is precisely the sort of healthy reflection that allows us to learn from our missteps, so for that reason, I am glad to see it.