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

Neil Mitchell ndmitchell at gmail.com
Tue Aug 4 09:50:22 EDT 2009


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.

Thanks

Neil


More information about the Haskell-Cafe mailing list