Make Data.List.takeWhile fuse: fix #9132
Make Data.List.takeWhile fuse: fix #9132

Summary:
Rewrites takeWhile to a build/foldr form; fuses repeated
applications of takeWhile.

Reviewers: nomeata, austin

Reviewed By: nomeata

Subscribers: thomie, carter, ezyang, simonmar

Projects: #ghc

Differential Revision: https://phabricator.haskell.org/D322

GHC Trac Issues: #9132

green-haskell/ghc,ezyang/ghc,siddhanathan/ghc,shlevy/ghc,gridaphobe/ghc,sgillespie/ghc,vikraman/ghc,ezyang/ghc,nathyong/microghc-ghc,snoyberg/ghc,nathyong/microghc-ghc,ml9951/ghc,sgillespie/ghc,nkaretnikov/ghc,TomMD/ghc,forked-upstream-packages-for-ghcjs/ghc,vikraman/ghc,gridaphobe/ghc,AlexanderPankiv/ghc,da-x/ghc,da-x/ghc,acowley/ghc,fmthoma/ghc,tjakway/ghcjvm,da-x/ghc,sgillespie/ghc,christiaanb/ghc,AlexanderPankiv/ghc,forked-upstream-packages-for-ghcjs/ghc,mettekou/ghc,snoyberg/ghc,ml9951/ghc,urbanslug/ghc,ghc-android/ghc,GaloisInc/halvm-ghc,urbanslug/ghc,elieux/ghc,vTurbine/ghc,ml9951/ghc,gcampax/ghc,siddhanathan/ghc,shlevy/ghc,forked-upstream-packages-for-ghcjs/ghc,snoyberg/ghc,vikraman/ghc,bitemyapp/ghc,snoyberg/ghc,gcampax/ghc,oldmanmike/ghc,TomMD/ghc,ghc-android/ghc,GaloisInc/halvm-ghc,gcampax/ghc,GaloisInc/halvm-ghc,green-haskell/ghc,gcampax/ghc,acowley/ghc,AlexanderPankiv/ghc,anton-dessiatov/ghc,fmthoma/ghc,mcschroeder/ghc,christiaanb/ghc,olsner/ghc,gcampax/ghc,christiaanb/ghc,tjakway/ghcjvm,tjakway/ghcjvm,forked-upstream-packages-for-ghcjs/ghc,vTurbine/ghc,sdiehl/ghc,sgillespie/ghc,mettekou/ghc,mfine/ghc,bitemyapp/ghc,olsner/ghc,urbanslug/ghc,nushio3/ghc,jstolarek/ghc,mfine/ghc,vTurbine/ghc,sdiehl/ghc,wxwxwwxxx/ghc,da-x/ghc,anton-dessiatov/ghc,mettekou/ghc,gridaphobe/ghc,fmthoma/ghc,gcampax/ghc,tjakway/ghcjvm,sdiehl/ghc,vTurbine/ghc,snoyberg/ghc,ghc-android/ghc,wxwxwwxxx/ghc,vikraman/ghc,siddhanathan/ghc,mfine/ghc,shlevy/ghc,ghc-android/ghc,mettekou/ghc,shlevy/ghc,anton-dessiatov/ghc,bitemyapp/ghc,sgillespie/ghc,forked-upstream-packages-for-ghcjs/ghc,AlexanderPankiv/ghc,da-x/ghc,jstolarek/ghc,elieux/ghc,nushio3/ghc,anton-dessiatov/ghc,anton-dessiatov/ghc,green-haskell/ghc,TomMD/ghc,urbanslug/ghc,mcschroeder/ghc,GaloisInc/halvm-ghc,ml9951/ghc,mcschroeder/ghc,nushio3/ghc,ml9951/ghc,snoyberg/ghc,TomMD/ghc,wxwxwwxxx/ghc,ezyang/ghc,GaloisInc/halvm-ghc,tjakway/ghcjvm,gridaphobe/ghc,christiaanb/ghc,fmthoma/ghc,nushio3/ghc,nathyong/microghc-ghc,fmthoma/ghc,siddhanathan/ghc,TomMD/ghc,nkaretnikov/ghc,mfine/ghc,wxwxwwxxx/ghc,vikraman/ghc,mfine/ghc,ezyang/ghc,nushio3/ghc,jstolarek/ghc,shlevy/ghc,shlevy/ghc,elieux/ghc,green-haskell/ghc,nathyong/microghc-ghc,TomMD/ghc,olsner/ghc,ezyang/ghc,urbanslug/ghc,oldmanmike/ghc,anton-dessiatov/ghc,green-haskell/ghc,GaloisInc/halvm-ghc,acowley/ghc,oldmanmike/ghc,mcschroeder/ghc,tjakway/ghcjvm,ml9951/ghc,forked-upstream-packages-for-ghcjs/ghc,olsner/ghc,vTurbine/ghc,nushio3/ghc,mcschroeder/ghc,fmthoma/ghc,urbanslug/ghc,mettekou/ghc,mettekou/ghc,AlexanderPankiv/ghc,shlevy/ghc,siddhanathan/ghc,acowley/ghc,christiaanb/ghc,snoyberg/ghc,jstolarek/ghc,acowley/ghc,vikraman/ghc,TomMD/ghc,ghc-android/ghc,vTurbine/ghc,GaloisInc/halvm-ghc,acowley/ghc,mcschroeder/ghc,mettekou/ghc,nkaretnikov/ghc,nkaretnikov/ghc,ghc-android/ghc,oldmanmike/ghc,nushio3/ghc,wxwxwwxxx/ghc,AlexanderPankiv/ghc,nathyong/microghc-ghc,siddhanathan/ghc,sdiehl/ghc,elieux/ghc,olsner/ghc,vikraman/ghc,ezyang/ghc,gcampax/ghc,nathyong/microghc-ghc,gridaphobe/ghc,nkaretnikov/ghc,tjakway/ghcjvm,nathyong/microghc-ghc,urbanslug/ghc,ml9951/ghc,jstolarek/ghc,da-x/ghc,bitemyapp/ghc,da-x/ghc,anton-dessiatov/ghc,oldmanmike/ghc,gridaphobe/ghc,oldmanmike/ghc,acowley/ghc,bitemyapp/ghc,ghc-android/ghc,siddhanathan/ghc,sdiehl/ghc,wxwxwwxxx/ghc,sgillespie/ghc,olsner/ghc,elieux/ghc,gridaphobe/ghc,ezyang/ghc,nkaretnikov/ghc,nkaretnikov/ghc,mfine/ghc,wxwxwwxxx/ghc,oldmanmike/ghc,olsner/ghc,sdiehl/ghc,christiaanb/ghc,sdiehl/ghc,fmthoma/ghc,mcschroeder/ghc,AlexanderPankiv/ghc,christiaanb/ghc,sgillespie/ghc,forked-upstream-packages-for-ghcjs/ghc,elieux/ghc,vTurbine/ghc,mfine/ghc,elieux/ghc,ml9951/ghc