[Haskell] Re: package mounting
simonmarhaskell at gmail.com
Mon Nov 6 06:44:24 EST 2006
Benjamin Franksen wrote:
> Assume library A uses library B. Then, presumably, lib A must chose a mount
> point for its use of lib B. Now imagine a program P wants to use lib A as
> well as directly import some module from lib B. Is P now free to give lib B
> its own mount point, independent of the one that was chosen by lib A? I
> think this should definitely be possible. There may, however, be some
> issues regarding implementation: Can a compilation system share code
> between both 'versions' of lib B (I assume they are /not/ really different
> versions but exactly the same one, only referred to via a different 'mount
> point')? Hmm, maybe this isn't really a problem. The compiler could simply
> alias the module names, similar as to what it does for 'import M as N'.
Right - mounting is just a way of manipulating names in source code. If you
import a module twice with different names ('import A as B" and "import A as
C"), this doesn't give you two copies of A, and mounting would work the same way.
(not that I necessarily agree that mounting is the best approach, I just wanted
to answer this point).
More information about the Haskell