--show-iface grammar?

Simon Peyton-Jones simonpj at microsoft.com
Tue Aug 1 03:40:35 EDT 2006


The "right" thing to do is to use the GHC API to parse the interface
files.  That way, when the details change, your program won't get
confused.  However, the GHC API is neither well designed nor well
documented at the moment.  This is a bit chicken-and-egg-ish; until
people start to use it, it'll stay that way!

You are perfectly welcome to parse the output of --show-iface, but it's
totally undocumented, and was never designed for easy parsing.  On the
other hand, that also means that you are welcome to change the syntax in
which it prints, by committing changes to GHC.

You'll find the printing code in iface/IfaceSyn, IfaceType mainly.
Reading that code may also help in understanding what the current syntax
is, of course.

We'd welcome help on either front, especially the former.

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org
[mailto:glasgow-haskell-users-bounces at haskell.org]
| On Behalf Of Neil Mitchell
| Sent: 31 July 2006 23:25
| To: David House
| Cc: glasgow-haskell-users at haskell.org
| Subject: Re: --show-iface grammar?
| 
| Hi David,
| 
| For a while hoogle used to parse iface files with some Perl, its in
| the hoogle repo under data/hihoo. It was particularly unreliable, but
| might give some insights...
| 
| And there probably shouldn't be one, if people want it then use the
| GHC API. Rather than defining a weak text format, we could then define
| a data structure.
| 
| Thanks
| 
| Neil
| 
| On 7/31/06, David House <dmhouse at gmail.com> wrote:
| > Hi list.
| >
| > Is there a document anywhere describing the grammar of the
| > --show-iface output? Should there be one? This seems like a fairly
| > complicated output, and parsing it could be very useful for tools
| > that, e.g., need to know the strictness of various functions.
| >
| > Thanks in advance.
| >
| > --
| > -David House, dmhouse at gmail.com
| > _______________________________________________
| > Glasgow-haskell-users mailing list
| > Glasgow-haskell-users at haskell.org
| > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
| >
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


More information about the Glasgow-haskell-users mailing list