+ let kPairs = zip argKs tks
+ let kindsOk = all (uncurry eqKind) kPairs
+ if not kindsOk &&
+ all (uncurry subKindOf) kPairs
+ -- GHC occasionally generates code like:
+ -- :Co:TTypeable2 (->)
+ -- where in this case, :Co:TTypeable2 expects an
+ -- argument of kind (*->(*->*)) and (->) has kind
+ -- (?->(?->*)). In general, I don't think it's
+ -- sound to apply an arbitrary coercion to an
+ -- argument that's a subkind of what it expects.
+ then warn $ "Applying coercion " ++ show tc ++
+ " to arguments of kind " ++ show argKs
+ ++ " when it expects: " ++ show tks
+ else require kindsOk