[Haskell-cafe] determining the origin of imported symbols

Erik Rantapaa erantapaa at gmail.com
Thu Jul 24 08:29:03 UTC 2014


Hi everyone,

I looking for a way to analyze Haskell source to determine which module 
each imported symbol comes from. My goal is to transform source code like 
this:

    import Data.List
    ...
    main = do
      nums <- fmap (map read . words) getLine :: IO [Int]
      print $ sort nums

to code like this:

    import qualified Prelude as B
    import qualified Data.List as A
    ...
    main = do
      nums <- B.fmap (B.map B.read B.. B.words) B.getLine :: B.IO [B.Int]
      B.print B.$ A.sort nums

That is, I want to qualify all imported symbols with a module alias.

Can anyone suggest modules or programs I should look at?

Thanks,
ER
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140724/6ca8142e/attachment.html>


More information about the Haskell-Cafe mailing list