Note [Stuck type families]

GHC/Tc/Utils/TcType.hs:2242 compiler 1 ticket

A type-family application generally has infinite size (PS_TyFam);
see (PC3) in Note [Paterson conditions] in GHC.Tc.Validity.

But a couple of built-in type families have no axioms, and can never
expand into anything else.  They are:

* (TypeError "stuff").  E.g. consider

     type family F a where
       F Int  = Bool
       F Bool = Char
       F _    = TypeError "Bad"

  We don't want to complain about possible non-termination of F, in
  GHC.Tc.Validity.checkFamInstRhs.  cf indexed-types/should_fail/T13271

* (Any @k).

For now we treat them as being size zero, but (#22696) I think we should
actually treat them as big (like any other ype family) because we don't
want to abstract over them in e.g. validDerivPred.

The type-family termination test, in GHC.Tc.Validity.checkFamInstRhs, already
has a separate call to isStuckTypeFamily, so the `F` above will still be accepted.

References 1

Referenced by 3