[Haskell-cafe] getting exported original names using the GHC API

AlanKim Zimmerman alan.zimm at gmail.com
Thu Jul 4 20:25:09 CEST 2013


If you use the ParsedSource representation,
http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-7.6.3/HsSyn.html#t:HsModule,
the LIE entry still has a RdrName which is represented as

(IEVar
      (Qual {ModuleName: L} {OccName: find})))])





On Thu, Jul 4, 2013 at 7:11 PM, Pasqualino "Titto" Assini <
tittoassini at gmail.com> wrote:

> Say that I have a module like:
>
>
> module Test(L.find) where
>
> import Data.List as L
>
>
> Using the GHC API, I extract the module exports (using GHC.modInfoExports)
> and I get a list of names.
>
> Now, I want to get the name of the export with the namespace stated in the
> source ("L.find")  but I seem to be able to get it only as "Data.List.find".
>
> I have tried different variations of functions on Name or OccName but
> nothing seems to work.
>
> Obviously, I could just parse the module and get the info that way, but I
> wondered if it could be done via the API.
>
> Thanks,
>
>     titto
>
> --
> Dr. Pasqualino "Titto" Assini
> http://quid2.org/
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130704/dbf520a7/attachment.htm>


More information about the Haskell-Cafe mailing list