[Haskell-cafe] determining the origin of imported symbols
erantapaa at gmail.com
Thu Jul 24 17:56:14 UTC 2014
Thanks, everyone, for all of the suggestions!
On Thursday, July 24, 2014 5:53:59 AM UTC-5, Eyal Lotem wrote:
> There's also ghc's -ddump-minimal-imports which might help you.
> On Thu, Jul 24, 2014 at 12:06 PM, JP Moresmau <jpmor... at gmail.com
>> BuildWrapper doesn't do the transformation, but it resolves all symbols
>> to build a usage map, so it would tell you that Data.List.sort is used at
>> line xxx, using the GHC API. So have a look at around
>> BuildWrapper takes the GHC AST, transforms it into a JSON structure, and
>> extracts all usage information. There is also an import reorganization
>> function that may be useful.
>> On Thu, Jul 24, 2014 at 10:29 AM, Erik Rantapaa <eran... at gmail.com
>>> 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
>>> 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.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?
>>> Haskell-Cafe mailing list
>> JP Moresmau
>> You received this message because you are subscribed to the Google Groups
>> "Haskell-cafe" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> To post to this group, send email to haskel... at googlegroups.com
>> Visit this group at http://groups.google.com/group/haskell-cafe.
>> For more options, visit https://groups.google.com/d/optout.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe