
I have a question which came up as a result of some attempts to enforce seperate compilation. Suppose we have two modules as follows:
------ A.hs -------- module A (AbstractType) where
data AbstractType = it's hidden implementation
f :: AbstractType -> String f _ = "foo"
g :: AbstractType g = something
------ B.hs --------- module B where import A
s = f g
Now, I want to be able to Compile A, Compile B, change the implementation of AbstractType in A, recompile A, and then not have to recompile B. Unfortunately, this doesn't seem to happen in GHC 6.0.1, as the representation of AbstractType is placed in A.hi, so when the representation changes, it forces a recompilation of B.
Good point. Following some changes made by Simon P.J. recently, GHC will in the future not put the representation of an abstract type in the interface file when not optimising. This change will appear in 6.4. Your .hi-boot trick looks like it *might* be ok, but no guarantees! Cheers, Simon
participants (1)
-
Simon Marlow