
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@gmail.com

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
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@gmail.com _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

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@haskell.org
[mailto:glasgow-haskell-users-bounces@haskell.org]
| On Behalf Of Neil Mitchell
| Sent: 31 July 2006 23:25
| To: David House
| Cc: glasgow-haskell-users@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
participants (3)
-
David House
-
Neil Mitchell
-
Simon Peyton-Jones