[Haskell-cafe] determining the origin of imported symbols

Roman Cheplyaka roma at ro-che.info
Thu Jul 24 09:11:07 UTC 2014


Hi Erik,

haskell-names (https://github.com/haskell-suite/haskell-names) will help you
here.

* Erik Rantapaa <erantapaa at gmail.com> [2014-07-24 01:29:03-0700]
> 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

> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140724/9d346d0b/attachment.sig>


More information about the Haskell-Cafe mailing list