In my codebase I have several types with a different number of type variables.
For example, consider
data MyType a b c = ...
data MyOtherType a b c d e = ...
Then I am defining functions using these types and I want to require that every type variable is an instance of Show.
To avoid too much repetition I used ConstraintKinds to define types
type Show2 a b = (Show a, Show b)
type Show3 a b c = (Show2 a b, Show c)
type Show4 a b c d = (Show3 a b c, Show d)
type Show5 a b c d e = (Show4 a b c d, Show e)
so that in the definition of my functions I can use
f :: (Show5 a b c d e) => MyOtherType a b c d e -> ...
Now my question is: is there a way to simplify the definition of types Show2, ..., Show5? It looks like their definition is recursive and I was wondering if there was an extension which allowed me to define them in one go