
30 Mar
2021
30 Mar
'21
10:36 a.m.
On Tue, 30 Mar 2021, Tom Smeding wrote:
Note that: - In my actual use case, 'C' is of course not empty. - In my actual use case, my type class instances _are_ in fact injective, even though I do enable FlexibleInstances to be able to write e.g. 'instance C (T a Int)'. - Above, the dictionary for 'C (a, b)' includes a dictionary for 'C b', doesn't it? So if inference can resolve 'C b', then the compilation to Core can find the right dictionary, I think? (Not sure about this part.)
How shall GHC find the method implementations for 'b' if it only has the methods for '(a,b)'?