Make the canonicaliser do unification
- This function calls
checkTyVarEq, both of which are fairly elaborate tests.
- Then we go to
canEqCanLHSFinish, which calls
checkTypeEq, repeating that
- All this just gets the orientation right. Then we forget all that, and later, in
unifyTestagain. What a mess.
One thing that discouraged me was the miasma of
rewriteCastedEquality and do-swap stuff. I just can't get my head round it. In some of my traces (eg EqCanOccursCheck) we seem to swap and swap back. Bizarre.
@rae and I agree that the canonicaliser should just do unification on the spot. This ticket is to track that point.