[Haskell-cafe] .hi inconsistency bug.

Daniel Gorín dgorin at dc.uba.ar
Wed Mar 18 00:21:52 EDT 2009


Just a wild guess but maybe the interpreter is recompiling (in  
runtime) code that has already been compiled to build your application  
(in compile-time). This may lead to inconsistencies since a type such  
as HackMail.Data.Main.Types.Filter may refer to two different (and  
incompatible) types.

To see if this is the case, make sure your "dynamic" code is not  
located together with your base code (i.e., move it to another  
directory, and set the src file directory for the interpreter  
accordingly). Now you may get another runtime error, something along  
the lines of "Module not found: HackMail.Data.MainTypes". This  
basically means that you need to make your (already compiled) types  
available to the interpreter. I think the simplest way is to put all  
your support types in a package, register it with ghc, link your  
application to it, and ask the interpreter to use this package (with a  
"-package " flag).

Hope this helps!


On Mar 17, 2009, at 11:52 PM, Joe Fredette wrote:

> List,
> I've got this project, source on patch-tag here[1]
> It's a nice little project, I've got the whole thing roughly  
> working, it compiles okay, everything seems to work, until I try to  
> run it, specifically when I run it in ghci, or when I run the main  
> executable (which uses hint), and look at any type involving my  
> "Email" type, it gives me the following error:
>   Type syonym HackMail.Data.MainTypes.Filter:
>     Can't find interface-file declaration for type constructor or  
> class HackMail.Data.ParseEmail.Email
>       Probable cause: bug in .hi-boot file, or inconsistent .hi file
>       Use -ddump-if-trace to get an idea of which file caused the  
> error
> As far as I understand, it wants to find the interface-file  
> declaration for a specific type (Email) exported by the ParseEmail  
> module, all of the exports (I think) are in order. I've tried  
> mucking around with it a bit, but I don't fully understand what the  
> error even means, much less how to fix it.
> Other relevant info, Email is exported in a roundabout way, namely  
> by importing a module MainTypes, which exports a module Email, which  
> exports a the ParseEmail Module, which exports the datatype Email.
> The "Filter" delcaration it _actually_ complains about (it's just  
> the first place the email type is invoked) is:
>   type Filter a = ReaderT (Config, Email) IO a
> nothing particularly special.
> Any help fixing this is greatly appreciated, I did find this bug  
> report[2] which seems like it might be relevant.
> But trying to unregister -> cabal clean -> cabal install doesn't fix  
> it. I've also tried manually removing the dist/ folder, and also  
> unregistering the package.
> Thanks again.
> /Joe
> [1] http://patch-tag.com/repo/Hackmail/browse
> [2] http://hackage.haskell.org/trac/ghc/ticket/2057
> <jfredett.vcf>_______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list