[Haskell-cafe] Cabal dependencies
duncan.coutts at googlemail.com
Sat Oct 6 19:06:31 CEST 2012
On 6 October 2012 17:25, José Lopes <jose.lopes at ist.utl.pt> wrote:
> But, wouldn't it be possible for xmobar to use mtl-22.214.171.124 and for parsec to
> use mtl-2.1.1, while xmobar would use this parsec version?
> In this case, I am assuming that mtl-126.96.36.199 and mtl-2.1.1 are considered
> two different libraries.
Possibly, yes, but cabal doesn't know that. It has to make the
conservative assumption that you might use them together and so they'd
better be the same type.
If cabal knew for sure that parsec did not expose types from mtl, then
it'd be fine for it to use parsec built against a different version of
mtl, because there would be no way to end up trying to equate types
from two different package instances.
This is the idea behind private or encapsulated dependencies: we would
declare in .cabal files that our use of some dependency does not "leak
out". But to be clear: this feature has not yet been implemented.
But actually in this case I think parsec does expose the fact that it
uses types from mtl. So it actually would not help here.
More information about the Haskell-Cafe