
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

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.... John

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
participants (3)
-
Abhay Parvate
-
B
-
John Dorsey