Fix TcUnify.matchExpectedTyConApp so that it returns types of compatible kinds
Fix TcUnify.matchExpectedTyConApp so that it returns types of compatible kinds

This fixes Trac #7368. The problem was that we were matching
   Bad w ~ f (Bad f)
where (f :: * -> *).  Thta leads to (w ~ Bad f), which is
ill-kinded, but matchExpectedTyConApp was returning the (Bad f)
as the argument type, and that was being used to instanatiate
w in the data constructor type, which is very bad.

The code also becomes simpler and easier to understand, which is
an excellent thing.

fmthoma/ghc,christiaanb/ghc,gridaphobe/ghc,sdiehl/ghc,holzensp/ghc,mfine/ghc,shlevy/ghc,mcschroeder/ghc,nkaretnikov/ghc,nkaretnikov/ghc,nushio3/ghc,sdiehl/ghc,snoyberg/ghc,wxwxwwxxx/ghc,tjakway/ghcjvm,nathyong/microghc-ghc,TomMD/ghc,GaloisInc/halvm-ghc,nushio3/ghc,shlevy/ghc,olsner/ghc,gcampax/ghc,AlexanderPankiv/ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,spacekitteh/smcghc,hferreiro/replay,oldmanmike/ghc,christiaanb/ghc,spacekitteh/smcghc,ekmett/ghc,spacekitteh/smcghc,vikraman/ghc,tjakway/ghcjvm,tibbe/ghc,bitemyapp/ghc,oldmanmike/ghc,wxwxwwxxx/ghc,lukexi/ghc-7.8-arm64,christiaanb/ghc,acowley/ghc,vTurbine/ghc,anton-dessiatov/ghc,sgillespie/ghc,mcschroeder/ghc,anton-dessiatov/ghc,urbanslug/ghc,ezyang/ghc,sgillespie/ghc,tibbe/ghc,forked-upstream-packages-for-ghcjs/ghc,da-x/ghc,urbanslug/ghc,christiaanb/ghc,anton-dessiatov/ghc,oldmanmike/ghc,spacekitteh/smcghc,mettekou/ghc,elieux/ghc,green-haskell/ghc,wxwxwwxxx/ghc,forked-upstream-packages-for-ghcjs/ghc,nkaretnikov/ghc,forked-upstream-packages-for-ghcjs/ghc,urbanslug/ghc,shlevy/ghc,tjakway/ghcjvm,mcschroeder/ghc,nushio3/ghc,sdiehl/ghc,wxwxwwxxx/ghc,vikraman/ghc,ryantm/ghc,oldmanmike/ghc,snoyberg/ghc,vTurbine/ghc,hferreiro/replay,lukexi/ghc-7.8-arm64,christiaanb/ghc,mcschroeder/ghc,GaloisInc/halvm-ghc,christiaanb/ghc,elieux/ghc,anton-dessiatov/ghc,hferreiro/replay,sgillespie/ghc,TomMD/ghc,olsner/ghc,ezyang/ghc,mettekou/ghc,mfine/ghc,fmthoma/ghc,GaloisInc/halvm-ghc,holzensp/ghc,frantisekfarka/ghc-dsi,lukexi/ghc-7.8-arm64,ghc-android/ghc,snoyberg/ghc,ml9951/ghc,oldmanmike/ghc,ezyang/ghc,bitemyapp/ghc,da-x/ghc,holzensp/ghc,nkaretnikov/ghc,ml9951/ghc,frantisekfarka/ghc-dsi,ezyang/ghc,nkaretnikov/ghc,elieux/ghc,ml9951/ghc,mfine/ghc,frantisekfarka/ghc-dsi,wxwxwwxxx/ghc,ml9951/ghc,shlevy/ghc,olsner/ghc,spacekitteh/smcghc,ezyang/ghc,mfine/ghc,mfine/ghc,bitemyapp/ghc,ryantm/ghc,nathyong/microghc-ghc,snoyberg/ghc,urbanslug/ghc,hferreiro/replay,AlexanderPankiv/ghc,ghc-android/ghc,forked-upstream-packages-for-ghcjs/ghc,tjakway/ghcjvm,gridaphobe/ghc,nathyong/microghc-ghc,urbanslug/ghc,ekmett/ghc,ryantm/ghc,ghc-android/ghc,GaloisInc/halvm-ghc,ekmett/ghc,TomMD/ghc,gridaphobe/ghc,gridaphobe/ghc,olsner/ghc,vikraman/ghc,christiaanb/ghc,olsner/ghc,jstolarek/ghc,sdiehl/ghc,green-haskell/ghc,nathyong/microghc-ghc,ghc-android/ghc,mettekou/ghc,tibbe/ghc,gcampax/ghc,ezyang/ghc,olsner/ghc,green-haskell/ghc,shlevy/ghc,oldmanmike/ghc,da-x/ghc,nushio3/ghc,vTurbine/ghc,TomMD/ghc,ekmett/ghc,mettekou/ghc,urbanslug/ghc,sdiehl/ghc,acowley/ghc,fmthoma/ghc,olsner/ghc,siddhanathan/ghc,fmthoma/ghc,fmthoma/ghc,AlexanderPankiv/ghc,bitemyapp/ghc,da-x/ghc,sgillespie/ghc,ezyang/ghc,da-x/ghc,gcampax/ghc,acowley/ghc,GaloisInc/halvm-ghc,tjakway/ghcjvm,ryantm/ghc,elieux/ghc,shlevy/ghc,AlexanderPankiv/ghc,ml9951/ghc,snoyberg/ghc,jstolarek/ghc,fmthoma/ghc,siddhanathan/ghc,acowley/ghc,siddhanathan/ghc,da-x/ghc,sgillespie/ghc,ghc-android/ghc,vikraman/ghc,gridaphobe/ghc,nathyong/microghc-ghc,snoyberg/ghc,ml9951/ghc,lukexi/ghc,gcampax/ghc,mettekou/ghc,forked-upstream-packages-for-ghcjs/ghc,urbanslug/ghc,snoyberg/ghc,nushio3/ghc,frantisekfarka/ghc-dsi,jstolarek/ghc,gcampax/ghc,mcschroeder/ghc,nushio3/ghc,green-haskell/ghc,lukexi/ghc-7.8-arm64,hferreiro/replay,forked-upstream-packages-for-ghcjs/ghc,anton-dessiatov/ghc,siddhanathan/ghc,da-x/ghc,wxwxwwxxx/ghc,GaloisInc/halvm-ghc,vTurbine/ghc,frantisekfarka/ghc-dsi,tibbe/ghc,green-haskell/ghc,shlevy/ghc,mfine/ghc,vTurbine/ghc,AlexanderPankiv/ghc,sdiehl/ghc,holzensp/ghc,mcschroeder/ghc,ekmett/ghc,AlexanderPankiv/ghc,nushio3/ghc,vikraman/ghc,ryantm/ghc,gridaphobe/ghc,hferreiro/replay,acowley/ghc,elieux/ghc,anton-dessiatov/ghc,ml9951/ghc,elieux/ghc,vikraman/ghc,sgillespie/ghc,jstolarek/ghc,nkaretnikov/ghc,hferreiro/replay,tjakway/ghcjvm,siddhanathan/ghc,oldmanmike/ghc,gcampax/ghc,nathyong/microghc-ghc,nkaretnikov/ghc,lukexi/ghc,wxwxwwxxx/ghc,mettekou/ghc,fmthoma/ghc,AlexanderPankiv/ghc,TomMD/ghc,elieux/ghc,ml9951/ghc,TomMD/ghc,holzensp/ghc,lukexi/ghc-7.8-arm64,jstolarek/ghc,sgillespie/ghc,mettekou/ghc,mfine/ghc,bitemyapp/ghc,anton-dessiatov/ghc,sdiehl/ghc,vikraman/ghc,lukexi/ghc,ghc-android/ghc,siddhanathan/ghc,acowley/ghc,forked-upstream-packages-for-ghcjs/ghc,TomMD/ghc,acowley/ghc,vTurbine/ghc,tibbe/ghc,ghc-android/ghc,tjakway/ghcjvm,lukexi/ghc,gridaphobe/ghc,vTurbine/ghc,lukexi/ghc,gcampax/ghc,nathyong/microghc-ghc,mcschroeder/ghc