Libraries and hierarchies

Simon Marlow
Mon, 4 Aug 2003 12:33:27 +0100

> It also gives the advantage that modules can be moved in the=20
> hierarchy (by a
> command-line flag or whatever) specifically to support=20
> whatever a particular
> program happens to require.=20
> Would the following be possible under your proposal:
> module M1.A imports Collections.Foo and only works with version 1
> module M2.B imports Collections.Foo and only works with version 2
> module C imports M1.A and M2.B
> Could we compile/use M1.A with Graphics.UI mapped to=20
> Graphics.UI.v1 and M2.B
> with Graphics.UI mapped to Graphics.UI.v2 and then correctly=20
> compile module C?

Yes, absolutely.

There are issues about exactly what the programmer would have to do to
make this happen: under the story I had in mind you would have to fiddle
with a user-local package.conf file to change the mapping.  Perhaps
command-line flags could be added to make this more convenient, though.