fix #3822: desugaring case command in arrow notation
fix #3822: desugaring case command in arrow notation

Get the set of free variables from the generated case expression:
includes variables in the guards and decls that were missed before,
and is also a bit simpler.

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