[Haskell-begin] .hi files

John Dorsey haskell at colquitt.org
Sat Jul 19 01:52:43 EDT 2008


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



More information about the Beginners mailing list