Roman Cheplyaka | 20 Jun 17:13 2013

ANNOUNCE: haskell-names-0.1

I am pleased to announce the first public release of haskell-names, a
name resolution library for haskell-src-exts AST.

Namely, it can do the following:

*   for a module, compute its interface, i.e. the set of entities
    exported by the module, together with their original names.

*   for each name in the module, figure out what it refers to — whether
    it's bound locally (say, by a where clause) or globally (and then
    give its origin).

Thanks to haskell-packages, this library is fully integrated with Cabal,
so that you can easily generate name interfaces for any Cabalized package.

See more details in the README:
http://documentup.com/haskell-suite/haskell-names

This library is based on the code written by Lennart Augustsson in 2010.
Little of that code survived, but nevertheless it's been a great help.

Roman

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Andrew Cowie | 21 Jun 08:12 2013

Re: ANNOUNCE: haskell-names-0.1

On Thu, 2013-06-20 at 18:13 +0300, Roman Cheplyaka wrote:
> Namely, it can do the following:
> 
> *   for a module, compute its interface, i.e. the set of entities
>     exported by the module, together with their original names.
> 
> *   for each name in the module, figure out what it refers to — whether
>     it's bound locally (say, by a where clause) or globally (and then
>     give its origin).

Is this a step toward being able to automatically derive an API version
number [in the SO version sense of the word; ie, has a change happened
requiring a version bump?]

AfC
Sydney

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Michael Sloan | 21 Jun 08:44 2013
Picon

Re: ANNOUNCE: haskell-names-0.1

Roman: Awesome!  I'm really glad that this is ready for use! 

Andrew: I have a tool that's a step towards doing this.  Instead of using haskell suite, it uses ghci via hint to query module exports, and then uses TH to reify them.  This has the benefit of supporting everything that GHC supports, whereas there are currently some cases that haskell-src-exts can't parse.  There's also the issue of supporting declarations generated by template haskell.

Here's an example of diffing some of its output:

https://github.com/mgsloan/api-compat/blob/master/examples/template-haskell.api.diff

The main reason I haven't released the tool is that I was intending to do structural diffs / handle renaming, so it's somewhat unfinished.  However I believe it's reasonably usable: instead, the output is just structured in a way that's reasonably amenable to diffing.

-Michael


On Thu, Jun 20, 2013 at 11:12 PM, Andrew Cowie <andrew <at> operationaldynamics.com> wrote:
On Thu, 2013-06-20 at 18:13 +0300, Roman Cheplyaka wrote:
> Namely, it can do the following:
>
> *   for a module, compute its interface, i.e. the set of entities
>     exported by the module, together with their original names.
>
> *   for each name in the module, figure out what it refers to — whether
>     it's bound locally (say, by a where clause) or globally (and then
>     give its origin).

Is this a step toward being able to automatically derive an API version
number [in the SO version sense of the word; ie, has a change happened
requiring a version bump?]

AfC
Sydney


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


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
AlanKim Zimmerman | 21 Jun 09:05 2013
Picon

Re: ANNOUNCE: haskell-names-0.1

I have a feeling the work-in-progress Haskell Refactorer using the GHC API may be able to provide this information through its library interface.

When I have some time over the weekend I will have a look.

Alan


On Fri, Jun 21, 2013 at 8:44 AM, Michael Sloan <mgsloan <at> gmail.com> wrote:
Roman: Awesome!  I'm really glad that this is ready for use! 

Andrew: I have a tool that's a step towards doing this.  Instead of using haskell suite, it uses ghci via hint to query module exports, and then uses TH to reify them.  This has the benefit of supporting everything that GHC supports, whereas there are currently some cases that haskell-src-exts can't parse.  There's also the issue of supporting declarations generated by template haskell.

Here's an example of diffing some of its output:

https://github.com/mgsloan/api-compat/blob/master/examples/template-haskell.api.diff

The main reason I haven't released the tool is that I was intending to do structural diffs / handle renaming, so it's somewhat unfinished.  However I believe it's reasonably usable: instead, the output is just structured in a way that's reasonably amenable to diffing.

-Michael


On Thu, Jun 20, 2013 at 11:12 PM, Andrew Cowie <andrew <at> operationaldynamics.com> wrote:
On Thu, 2013-06-20 at 18:13 +0300, Roman Cheplyaka wrote:
> Namely, it can do the following:
>
> *   for a module, compute its interface, i.e. the set of entities
>     exported by the module, together with their original names.
>
> *   for each name in the module, figure out what it refers to — whether
>     it's bound locally (say, by a where clause) or globally (and then
>     give its origin).

Is this a step toward being able to automatically derive an API version
number [in the SO version sense of the word; ie, has a change happened
requiring a version bump?]

AfC
Sydney


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



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


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
AlanKim Zimmerman | 23 Jun 20:48 2013
Picon

Re: ANNOUNCE: haskell-names-0.1

I took a quick look at this, and came to the conclusion that the scope info is available from GHC, but is not exposed by HaRe at this stage.

Rather than chasing something just to show it can be done, I am going to use my limited time for HaRe.

By the way, I think buildwrapper generates a summary of a project as as well, in JSON format.

Also, for GHC RenamedSource, querying any Name entity will provide the package it came from (via  http://www.haskell.org/ghc/docs/7.6.3/html/libraries/ghc-7.6.3/Name.html#v:nameModule)

e.g.

(Data.Generics.Text.gshow, syb-0.4.0:Data.Generics.Text),

Alan


On Fri, Jun 21, 2013 at 9:05 AM, AlanKim Zimmerman <alan.zimm <at> gmail.com> wrote:
I have a feeling the work-in-progress Haskell Refactorer using the GHC API may be able to provide this information through its library interface.

When I have some time over the weekend I will have a look.

Alan


On Fri, Jun 21, 2013 at 8:44 AM, Michael Sloan <mgsloan <at> gmail.com> wrote:
Roman: Awesome!  I'm really glad that this is ready for use! 

Andrew: I have a tool that's a step towards doing this.  Instead of using haskell suite, it uses ghci via hint to query module exports, and then uses TH to reify them.  This has the benefit of supporting everything that GHC supports, whereas there are currently some cases that haskell-src-exts can't parse.  There's also the issue of supporting declarations generated by template haskell.

Here's an example of diffing some of its output:

https://github.com/mgsloan/api-compat/blob/master/examples/template-haskell.api.diff

The main reason I haven't released the tool is that I was intending to do structural diffs / handle renaming, so it's somewhat unfinished.  However I believe it's reasonably usable: instead, the output is just structured in a way that's reasonably amenable to diffing.

-Michael


On Thu, Jun 20, 2013 at 11:12 PM, Andrew Cowie <andrew <at> operationaldynamics.com> wrote:
On Thu, 2013-06-20 at 18:13 +0300, Roman Cheplyaka wrote:
> Namely, it can do the following:
>
> *   for a module, compute its interface, i.e. the set of entities
>     exported by the module, together with their original names.
>
> *   for each name in the module, figure out what it refers to — whether
>     it's bound locally (say, by a where clause) or globally (and then
>     give its origin).

Is this a step toward being able to automatically derive an API version
number [in the SO version sense of the word; ie, has a change happened
requiring a version bump?]

AfC
Sydney


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



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



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Roman Cheplyaka | 21 Jun 11:00 2013

Re: ANNOUNCE: haskell-names-0.1

* Andrew Cowie <andrew <at> operationaldynamics.com> [2013-06-21 16:12:55+1000]
> On Thu, 2013-06-20 at 18:13 +0300, Roman Cheplyaka wrote:
> > Namely, it can do the following:
> > 
> > *   for a module, compute its interface, i.e. the set of entities
> >     exported by the module, together with their original names.
> > 
> > *   for each name in the module, figure out what it refers to — whether
> >     it's bound locally (say, by a where clause) or globally (and then
> >     give its origin).
> 
> Is this a step toward being able to automatically derive an API version
> number [in the SO version sense of the word; ie, has a change happened
> requiring a version bump?]

Yes, this sounds like a good weekend project for someone interested.

Roman

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Evan Laforge | 25 Jun 06:30 2013
Picon

Re: ANNOUNCE: haskell-names-0.1

This is neat, it sounds like I could use this with fix-imports to find
only modules that export the right function name, or even to add
non-qualified imports.  But since it's already 95% good enough for my
use case, I probably won't get around to it any time soon.

On Thu, Jun 20, 2013 at 8:13 AM, Roman Cheplyaka <roma <at> ro-che.info> wrote:
> I am pleased to announce the first public release of haskell-names, a
> name resolution library for haskell-src-exts AST.
>
> Namely, it can do the following:
>
> *   for a module, compute its interface, i.e. the set of entities
>     exported by the module, together with their original names.
>
> *   for each name in the module, figure out what it refers to — whether
>     it's bound locally (say, by a where clause) or globally (and then
>     give its origin).
>
> Thanks to haskell-packages, this library is fully integrated with Cabal,
> so that you can easily generate name interfaces for any Cabalized package.
>
> See more details in the README:
> http://documentup.com/haskell-suite/haskell-names
>
> This library is based on the code written by Lennart Augustsson in 2010.
> Little of that code survived, but nevertheless it's been a great help.
>
> Roman
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Erik Hesselink | 25 Jun 08:58 2013
Picon

Re: ANNOUNCE: haskell-names-0.1

Tom Lokhorst and myself worked on a tool to generate missing imports,
both qualified and unqualified, at the Odessa hackathon. We created a
working proof of concept [0]. I wasn't aware of fix-imports.

Erik

[0] https://github.com/haskell-suite/halberd

On Tue, Jun 25, 2013 at 6:30 AM, Evan Laforge <qdunkan <at> gmail.com> wrote:
> This is neat, it sounds like I could use this with fix-imports to find
> only modules that export the right function name, or even to add
> non-qualified imports.  But since it's already 95% good enough for my
> use case, I probably won't get around to it any time soon.
>
> On Thu, Jun 20, 2013 at 8:13 AM, Roman Cheplyaka <roma <at> ro-che.info> wrote:
>> I am pleased to announce the first public release of haskell-names, a
>> name resolution library for haskell-src-exts AST.
>>
>> Namely, it can do the following:
>>
>> *   for a module, compute its interface, i.e. the set of entities
>>     exported by the module, together with their original names.
>>
>> *   for each name in the module, figure out what it refers to — whether
>>     it's bound locally (say, by a where clause) or globally (and then
>>     give its origin).
>>
>> Thanks to haskell-packages, this library is fully integrated with Cabal,
>> so that you can easily generate name interfaces for any Cabalized package.
>>
>> See more details in the README:
>> http://documentup.com/haskell-suite/haskell-names
>>
>> This library is based on the code written by Lennart Augustsson in 2010.
>> Little of that code survived, but nevertheless it's been a great help.
>>
>> Roman
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe <at> haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
Evan Laforge | 25 Jun 20:06 2013
Picon

Re: ANNOUNCE: haskell-names-0.1

Yeah, no one seems to know about it, which is surprising to me.  I've
been using it for over 2 years and I'd never want to go back.  I guess
most people don't mind maintaining import lists, my guess is that few
people work on large projects, so they never see a long import list.

On Mon, Jun 24, 2013 at 11:58 PM, Erik Hesselink <hesselink <at> gmail.com> wrote:
> Tom Lokhorst and myself worked on a tool to generate missing imports,
> both qualified and unqualified, at the Odessa hackathon. We created a
> working proof of concept [0]. I wasn't aware of fix-imports.
>
> Erik
>
> [0] https://github.com/haskell-suite/halberd
>
> On Tue, Jun 25, 2013 at 6:30 AM, Evan Laforge <qdunkan <at> gmail.com> wrote:
>> This is neat, it sounds like I could use this with fix-imports to find
>> only modules that export the right function name, or even to add
>> non-qualified imports.  But since it's already 95% good enough for my
>> use case, I probably won't get around to it any time soon.
>>
>> On Thu, Jun 20, 2013 at 8:13 AM, Roman Cheplyaka <roma <at> ro-che.info> wrote:
>>> I am pleased to announce the first public release of haskell-names, a
>>> name resolution library for haskell-src-exts AST.
>>>
>>> Namely, it can do the following:
>>>
>>> *   for a module, compute its interface, i.e. the set of entities
>>>     exported by the module, together with their original names.
>>>
>>> *   for each name in the module, figure out what it refers to — whether
>>>     it's bound locally (say, by a where clause) or globally (and then
>>>     give its origin).
>>>
>>> Thanks to haskell-packages, this library is fully integrated with Cabal,
>>> so that you can easily generate name interfaces for any Cabalized package.
>>>
>>> See more details in the README:
>>> http://documentup.com/haskell-suite/haskell-names
>>>
>>> This library is based on the code written by Lennart Augustsson in 2010.
>>> Little of that code survived, but nevertheless it's been a great help.
>>>
>>> Roman
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe <at> haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe <at> haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe

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

Gmane