[Haskell-cafe] Strange problem with inference
kane at kane.cx
Sat Sep 12 20:31:10 UTC 2015
~ isn't equivalent. Type signatures are solved by unification and then all
occurring constraints are solved. By putting a ~ constraint you explicitly
instruct GHC to not attempt unification.
When using associated type synonyms you need to use ~, as the choice of
TestT a depends on what instance is picked for Test a. There doesn't even
have to be an instance at all. As the unifier is iirc mostly independent
from the constraint solver, you get that error.
See the relevant paper "Associated Type Synonyms" for details.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe