[Haskell-beginners] interface files

Luca Padovani luca.padovani at uniurb.it
Mon Sep 21 09:12:45 EDT 2009


I'd like to be able to extract the "interface" of a Haskell module,
where the interface should basically contain the list of values
defined within the module along with their type, as well as the types
defined in the module.

It seems to me like the only way of doing this is with GHC and the
option --show-iface, which dumps the .hi file into some readable
format. However, the dumped interface seems to contain far more
information than the one I'm looking for (like annotations to the data
types explaining whether they are recursive, etc.), and am not sure
whether the grammar of this format is documented anywhere (other than
the actual source of GHC, I mean).

Is there any other convenient utility to automatically extract this
kind of "interfaces"? [*]

Thanks in advance.

Luca


More information about the Beginners mailing list