base 3 + base 4 compatibility?
Simon Marlow
marlowsd at gmail.com
Mon Oct 6 10:55:25 EDT 2008
Claus Reinke wrote:
>>> Is it really always safe to combine packages that depend on one base
>>> with packages that depend on another? My guess is "no, but ghc will
>>> catch any compatibility issues", so the cabal warning perhaps
>>> shouldn't be dropped?
>>
>> As far as I can see the answer is yes but I'd be interested to see a
>> counter-example.
>
> The reason it is supposed to be safe is that base-3 _only_ re-exports
> base-4 and syb, right? So it is not just a question of base-3 directly
> depending on base-4, but of base-3 being nothing but a different path
> to the same code. Ok, makes sense.
It's a heuristic that will usually work, but could be broken. For example,
base-3 could define a new 'Maybe' type, which would be incompatible with
the one from base-4.
The reason the heuristic is sensible is because if P depends on Q, it
probably means that the author of P intends it to be compatible with Q. It
excludes the cases where P and Q are different versions of the same package
and only in the dependency graph by virtue of being dependencies of other
packages (this is the case we want to avoid, because it can lead to type
errors).
base-3 isn't just a re-export of modules from base-4 and syb. It
selectively re-exports things in cases where base-4 exports more stuff than
base-3 did, and it moves some modules around (e.g. base-3:Control.Exception
is base-4:Control.OldException).
Cheers,
Simon
More information about the Cvs-ghc
mailing list