[Haskell-cafe] Haskell interface files: Why used? What about same data in object files?

Iavor Diatchki iavor.diatchki at gmail.com
Wed Aug 5 04:11:40 EDT 2009


Hello,

On Tue, Aug 4, 2009 at 2:50 PM, Neil Mitchell<ndmitchell at gmail.com> wrote:
> Hi
>
>> Some good reasons for having a separate interface are:  they can be
>> human-readable and human-writable (ghc's do not fulfill this criterion);
>> they can be used to bootstrap mutually recursive modules in the absence of
>> any object files (ghc uses .hs-boot files instead); other tools can extract
>> information about modules without having to understand either the full
>> Haskell syntax or the object language.
>
> An additional reason is that for some changes of .hs file (where just
> the implementation changes) the .o file can be regenerated without
> touching the .hi file. This allows more accurate build dependencies
> and less recompilation.

Is that really the case?  I thought that GHC may add code to the
interface files for cross-module inlining purposes, which means that
changing the implementation might change the interface too.
-Iavor


More information about the Haskell-Cafe mailing list