For those of you who are as lazy as me about fixing and reinstalling broken GHC packages, I’ve ripped off the well-known and loved ghc-pkg-clean script and made it recursive. No promises of termination: function ghc-pkg-supercleaner() { b="0" for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` do echo unregistering $p; ghc-pkg $* unregister $p; cabal install $p;