Make -XDeriveFunctor more generous about non-last arguments (Trac #8678)
When deriving Functor, Foldable, Traversable, we need only look at the way that the last type argument is treated. It's fine for there to be existentials etc, provided they don't affect the last type argument. See Note [Check that the type variable is truly universal] in TcDeriv.
Showing with 97 additions and 31 deletions