Fix generalisation during type inference (again); fixes Trac #1564
Fix generalisation during type inference (again); fixes Trac #1564

Figuring out which type variables to generalise when inferring the type
of a let-bound function is always trickier than I think!  This patch
fixes a bug (related, inevitably, to functional depenencies) found by
iampure, Trac #1564.  I'll add a test shortly.


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