<div dir="ltr"><div><div><div>Have you looked at ModuleInfo [1] ?<br><br></div>This is accesible from a <a name="t:TypecheckedModule" class="">TypecheckedModule</a>.<br><br></div>And what do you mean by the exported declarations?<br><br></div>If you are prepared to use the HaRe API (ony up to GHC 7.6.3) you can use definingDeclsNames [2]<br><br>[1] <a href="https://downloads.haskell.org/~ghc/7.8.3/docs/html/libraries/ghc-7.8.3/GHC.html#t:ModuleInfo">https://downloads.haskell.org/~ghc/7.8.3/docs/html/libraries/ghc-7.8.3/GHC.html#t:ModuleInfo</a><br>[2] <a href="http://hackage.haskell.org/package/HaRe-0.7.2.8/docs/Language-Haskell-Refact-API.html#v:definingDeclsNames">http://hackage.haskell.org/package/HaRe-0.7.2.8/docs/Language-Haskell-Refact-API.html#v:definingDeclsNames</a><br><br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 2, 2015 at 6:58 PM, Jochen Keil <span dir="ltr"><<a href="mailto:jochen.keil@gmail.com" target="_blank">jochen.keil@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Erik,<br>
<span class=""><br>
On 02.02.2015 12:55, Erik Hesselink wrote:<br>
> On Mon, Feb 2, 2015 at 12:46 PM, Jochen Keil <<a href="mailto:jochen.keil@gmail.com">jochen.keil@gmail.com</a>> wrote:<br>
>> Hello Peter,<br>
>><br>
>> On 02.02.2015 12:31, Peter Simons wrote:<br>
>>> Hi Jochen,<br>
>>><br>
>>>  > My main goal would be to have a program which takes two modules of<br>
>>>  > different versions, compare them and highlight the differences<br>
>>>  > between them.<br>
>>><br>
>>> maybe <a href="http://hackage.haskell.org/package/hackage-diff" target="_blank">http://hackage.haskell.org/package/hackage-diff</a> would work for<br>
>>> your purposes?<br>
>><br>
>> Thanks for the hint, this looks pretty good.<br>
>><br>
>> One thing though: hackage-diff uses haskell-src-exts for parsing<br>
>> modules. Does haskell-src-exts re-use the GHC API or does it run its own<br>
>> parser? (from a quick glance I'd say the latter case)<br>
><br>
> There are basically two routes to choose from with such a tool (of<br>
> which a few already exist, I think): you can use GHC and its API, like<br>
> you're doing, or you can use haskell-src-exts, which is a separate<br>
> parser, and use haskell-names for name resolution (and<br>
> haskell-packages for dependency information). Sadly there's no<br>
> haskell-type-exts for typechecking (yet). The GHC route is probably<br>
> more powerful, the haskell-suite route is simpler and doesn't depend<br>
> on GHC.<br>
<br>
</span>thanks for the clarification!<br>
Indeed it seems to me that the GHC approach is more powerful, because<br>
after running the typechecker I would have the AST available for<br>
comparing modules (did I get this right?). Drawback would obviously be<br>
the need for running the typechecker. :)<br>
<br>
So, just for the sake of my curiosity:<br>
Is there a way to get the exported declarations (and not just the<br>
RdrNames) from GHC without running the typechecker?<br>
I don't understand why it's necessary to run the typechecker in order to<br>
get this list. The parser already returns a list with all declarations,<br>
so shouldn't it be possible to filter this list for only the exported ones?<br>
<br>
Thanks,<br>
  Jochen<br>
<br>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>