Use the haskell-scope package.