Note [Orienting TyFamLHS/TyFamLHS]

GHC/Tc/Solver/Equality.hs:1880 compiler

If we have a TyFamLHS on both sides, we choose how to orient it.

* swap_for_size.  If we have
      S a ~ F (G (H (Maybe a)))
  then we swap so that we tend to rewrite the bigger type (F (G (H (Maybe a))))
  into the smaller one (S a).  This same test tends to avoid occurs-check
  errors.  E.g.
      S g ~ F (G (S g))
  Here (S g) occurs on the RHS, so this is not canonical.  But if we swap it
  around, it /is/ canonical
      F (G (S g)) ~ S g

* swap_for_rewriting: put touchable meta-tyvars on the left:
  see Note [Put touchable variables on the left]

References 1

Referenced by 3