ghc5.03 .hi and .hi-boot files don't you just love those incompatible changes?

George Russell
Mon, 15 Apr 2002 16:29:20 +0200

Formerly .hi and .hi-boot files had the same format; however ghc5.03 has a binary format for
.hi files and a textual one for .hi-boot files.  This is a nuisance for me, because I have an
ingenious scheme by which .hi-boot files are themselves from Haskell files by ghc, which thinks
it is generating .hi files.  Since I don't particularly want to go from writing to Haskell to
writing interface files, I would like to keep the old scheme, but then I need a way of getting
GHC to generate .hi-boot files from .hs files.  

One might think the options -ddump-hi or --show-iface would do the job, but they don't.
--show-iface produces a file which causes Haskell later to choke with the message    

failed to load interface for `DisplayView':
        Bad interface file: DisplayView.hi-boot
            DisplayView.hi-boot:1: parse error on input `__interface'
-ddump-hi is even worse, since it adds an extra two totally useless lines at the start
(but otherwise appears to be the same as --show-iface).

So is there any way of getting GHC to generate .hi-boot files?  Or should I give up on
using .hi-boot altogether and simply compile the Haskell direct to the .hi file?