[Haskell-cafe] Injective type classes?
Henning Thielemann
lemming at henning-thielemann.de
Tue Mar 30 14:36:57 UTC 2021
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)'?
More information about the Haskell-Cafe
mailing list