
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

Hi Erik,
haskell-names (https://github.com/haskell-suite/haskell-names) will help you
here.
* Erik Rantapaa
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@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi Erik,
Can anyone suggest modules or programs I should look at?
hsimport[1] and especially vim-hsimport[2] might be of help. Greetings, Daniel [1] https://github.com/dan-t/hsimport [2] https://github.com/dan-t/vim-hsimport
participants (3)
-
Daniel Trstenjak
-
Erik Rantapaa
-
Roman Cheplyaka