[Haskell-begin] .hi files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
B
Reply | Threaded
Open this post in threaded view
|

[Haskell-begin] .hi files

B
So it looks like the ghc libraries come installed in *.hi files.  This
looks to be a binary library.  Is that the case?  Is there a tool to see
what Haskell functions and etc are in a .hi file?

Ben

Reply | Threaded
Open this post in threaded view
|

[Haskell-begin] .hi files

John Dorsey-2
Ben,

> So it looks like the ghc libraries come installed in *.hi files.  This
> looks to be a binary library.  Is that the case?  Is there a tool to see
> what Haskell functions and etc are in a .hi file?

GHC's *.hi files are "interface files", a product of GHC's separate
compilation.  foo.hi contains the information needed to compile a
different module which depends on foo.

So a binary library package needs to contain both the object code, and
the matching interface description, which is the *.hi file.  By the way,
both are very sensitive to the version of GHC that compiled them.
There's no attempt or claim at binary compatibility between GHC versions.

The GHC user manual is a great resource:
http://www.haskell.org/ghc/docs/6.8.3/html/users_guide/separate-compilation.html

John

Reply | Threaded
Open this post in threaded view
|

[Haskell-begin] .hi files

Abhay Parvate
You can inspect a few things in the .hi files:
    ghc --show-iface abc.hi
and it is usually used to see what conclusions ghc was able to reach about
your code (since your code will also generate .hi files). I don't think it's
much use looking into library .hi files however unless you are yourself the
library author. The library documentation is usually the best way to learn
about the library.

Regards,
Abhay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20080719/6f37c88e/attachment.htm